You are right. The algorithm shown in
https://en.wikipedia.org/wiki/Eight_queens_puzzle gives one solution only. I
did not realize that you want all solutions. Sorry for that. In order to
find all solutions you indeeed need a backtracking algorithm, I think, which
requires much more computation. In that respect the times you report seem
very reasonably to me. As you have shown it is not too difficult to compute
all solutions, but the question which algorithm would be the fastest one
remains an open question for me too. My advice: first look at the efficiency
of the algorithm you want to use. In the past I have run into problems by
not doing so, producing programs running parallelly on many processors, but
not faster than when running on one processor only. First consider the
algorithm, then the implementation. A simple example where the
implementation may go wrong in respect to computing time, is in computing
binomial coefficients. I am sure there are much more examples. May be a
define-with-hash may help, producing functions that use a hash to remember
previous calls with the same arguments. It may be necessary to define the
hash such as to recognize distinct, but computationaly symmetrical problems.
Best wishes, Jos


-----Original Message-----
From: Brian Adkins [mailto:lojicdot...@gmail.com] 
Sent: sábado, 12 de marzo de 2016 23:33
To: Jos Koot
Cc: Racket Users
Subject: Re: [racket-users] Sequential vs. Parallel 13-Queens program

The code is a little difficult for me to read. It doesn't seem to collect
*all* solutions for a given N. If that's the case, would you be able to
modify it to do so to allow a more direct comparison?

> On Mar 12, 2016, at 1:19 PM, Jos Koot <jos.k...@gmail.com> wrote:
> 
snip

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to