Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's just a good heuristic, though, it does not guarantee finding a solution. Also note that NP is a class of decision problems, and finding a solution for the n-Queens problem is not.

None of the two decision problems that arise naturally from n-queens, deciding whether there exists solutions for a given board size, and verifying whether a candidate is indeed a solution, are NP-hard (solutions exist for n \not\in {2, 3}; verification can clearly be done in time quadratic in n). Counting solutions is #P-complete, though.



> Counting solutions is #P-complete, though.

Are you sure? Where was this proven? It could easily be that http://oeis.org/A000170 had a polynomial time combinatorial formula.

Maybe some completion-counting problem could be shown to be #P-complete though.


If you read the cites on that link, you'll see that the value for 26 was only added in 2016. They do not have a closed form formula, or they would have shown it.

I mean, they could just be slow revealing. I doubt it, though.


Computational hardness doesn't depend on whether anybody knows an efficient algorithm. Just whether one exists.


Fair enough. I was obviously reading the above as having a polynomial time as having an efficient time one. Where efficient was shorthand for "quick." Both leaps, I concede were misguided.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: