in reply to Efficient N-Queen solution with Perl

Thanks for posting your original code. It was about 100-times slower than runrig's code (for fairly small numbers of queens and only counting how long it took runrig's code to find the first match).

My updated code actually does more than runrig's (checks for duplicates) but runs quite a bit faster. For example, runrig's takes about 28 seconds to find the 2680 solutions for 11 queens while mine takes about 7 seconds (and notes that only 341 solutions are unique). Sorry, I don't feel like running more samples and making more comparisons than those at the moment.

So at least a great deal of the speed problem isn't Perl's fault in this case. ;)

        - tye (but my friends call me "Tye")
  • Comment on (tye)Re2: Efficient N-Queen solution with Perl