Newsgroups: comp.ai
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!oitnews.harvard.edu!purdue!haven.umd.edu!darwin.sura.net!blaze.cs.jhu.edu!RacerX.mse.jhu.edu!news.jhu.edu!aplcenmp!hall
From: hall@aplcenmp.apl.jhu.edu (Marty Hall)
Subject: Re: How to construct of a solution of the N-Queen problem?
Message-ID: <DGE1sJ.6KH@aplcenmp.apl.jhu.edu>
Organization: JHU/APL AI Lab, Hopkins P/T CS Faculty
References: <45jhda$38i@news.ust.hk>
Date: Fri, 13 Oct 1995 13:07:30 GMT
Lines: 14

In article <45jhda$38i@news.ust.hk> wwkin@cs.ust.hk (Wong Wing Kin) writes:
>How to construct of a solution of the N-Queen problem?
>I know some methods like Depth First Search and Local Search.
>Are there any fast methods?

If all you want is *one* solution (rather than *all* solutions), then
there are simple published algorithms that find the locations for
all the queens for any N >= 4 in linear time. Thus, printing out the
board is the rate-limiting step, and no search is required. A simple
Common Lisp implementation, based on an algorithm published in the
SigArt Bulletin is available on my Lisp-Hints page:
<http://www.apl.jhu.edu/~hall/lisp.html> 
						- Marty
(proclaim '(inline skates))
