|
|
|
|
|
by djvu9
4489 days ago
|
|
I feel nowadays to meaningfully talk about performance of N-queens problem N should start with 18 instead of 8.. Here is a C++ solution with 40 lines of code and can solve 18-queens in less than a minute on a laptop: https://gist.github.com/jdeng/7915749 |
|
That'll do ~N=1e6 in a second (I'm sure there are lots of optimisations that could be done in it though), or solutions for N=4 to N=1000 in less than 10.
The more complex problem is finding out how many solutions there are in total.