Proceedings

Complexity of n-Queens Completion (Extended Abstract)

Download BibTeX Cite

Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence. Journal track. Pages 5608-5611.

https://doi.org/10.24963/ijcai.2018/794

Abstract

The n-Queens problem is to place n chess queens on an n by n chessboard so that no two queens are on the same row, column or diagonal. The n-Queens Completion problem is a variant, dating to 1850, in which some queens are already placed and the solver is asked to place the rest, if possible. We show that n-Queens Completion is both NP-Complete and #P-Complete. A corollary is that any non-attacking arrangement of queens can be included as a part of a solution to a larger n-Queens problem. We introduce generators of random instances for n-Queens Completion and the closely related Blocked n-Queens and Excluded Diagonals Problem. We describe three solvers for these problems, and empirically analyse the hardness of randomly generated instances. For Blocked n-Queens and the Excluded Diagonals Problem, we show the existence of a phase transition associated with hard instances as has been seen in other NP-Complete problems, but a natural generator for n-Queens Completion did not generate consistently hard instances. The significance of this work is that the n-Queens problem has been very widely used as a benchmark in Artificial Intelligence, but conclusions on it are often disputable because of the simple complexity of the decision problem. Our results give alternative benchmarks which are hard theoretically and empirically, but for which solving techniques designed for n-Queens need minimal or no change.

  1. [Bell and Stevens, 2009] Jordan Bell and Brett Stevens. A survey of known results and research areas for n-queens. Discrete Mathematics, 309(1):1 -31, 2009.
  2. [Bernhardsson, 1991] Bo Bernhardsson. Explicit solutions to the n-queens problem for all n. SIGART Bulletin, 2(2):7, 1991.
  3. [Bezzel, 1848] Max Bezzel. Schachfreund. Berliner Schachzeitung, 3:363, 1848. Cited in [Campbell, 1977].
  4. [Bitner and Reingold, 1975] James R. Bitner and Edward M. Reingold. Backtrack programming techniques. Communi- cations of the ACM, 18(11):651-656, 1975.
  5. [Cadoli and Schaerf, 2006] Marco Cadoli and Marco Schaerf. Partial solutions with unique completion. In Oliviero Stock and Marco Schaerf, editors, Reasoning, Action and Interaction in AI Theories and Systems, Essays Dedicated to Luigia Carlucci Aiello, volume 4155 of Lecture Notes in Computer Science, pages 101-115. Springer, 2006.
  6. [Campbell, 1977] Paul J. Campbell. Gauss and the eight queens problem: A study in miniature of the propagation of historical error. Historia Mathematica, 4(4):397 -404, 1977.
  7. [Chaiken et al., 2015] Seth Chaiken, ChristopherR.H. Hanusa, and Thomas Zaslavsky. A q-queens problem. ii. the square board. Journal of Algebraic Combinatorics, 41(3):619-642, 2015.
  8. [Colbourn, 1984] Charles J. Colbourn. The complexity of completing partial latin squares. Discrete Applied Mathe- matics, 8:25-30, 1984.
  9. [Crawford et al., 1996] James M. Crawford, Matthew L. Ginsberg, Eugene M. Luks, and Amitabha Roy. Symmetry-breaking predicates for search problems. In Luigia Carlucci Aiello, Jon Doyle, and Stuart C. Shapiro, editors, Proceedings of the Fifth International Conference on Principles of Knowledge Representation and Reason- ing (KR'96), Cambridge, Massachusetts, USA, November 5-8, 1996., pages 148-159.
  10. Morgan Kaufmann, 1996.
  11. [Demaine and Hearn, 2009] Erik D Demaine and Robert A Hearn. Playing games with algorithms: algorithmic com- binatorial game theory. In Games of No Chance 3, pages 3-56. Cambridge University Press, 2009.
  12. [Erickson, 2014] Jeff Erickson. Complexity of n-queens-completion? Theoretical Com- puter Science Stack Exchange, December 2014. URL:http://cstheory.stackexchange.com/q/28002 (ver- sion: 2014-12-29). Link
  13. [Fraenkel and Lichtenstein, 1981] Aviezri S Fraenkel and David Lichtenstein. Computing a perfect strategy for n×n chess requires time exponential in n. Journal of Combina- torial Theory, Series A, 31(2):199 -214, 1981.
  14. [Gent et al., 2007] Ian P. Gent, Christopher Jefferson, Tom Kelsey, Inês Lynce, Ian Miguel, Peter Nightingale, Bar- bara M. Smith, and Armagan Tarim. Search in the patience game 'Black Hole'. AI Communications, 20(3):211-226, 2007.
  15. [Gent et al., 2017] Ian P. Gent, Christopher Jefferson, and Peter Nightingale. Complexity of n-queens completion. Journal of Artificial Intelligence Research, 59:815-848, 2017.
  16. [Golomb and Baumert, 1965] Solomon W. Golomb and Leonard D. Baumert. Backtrack programming. Journal of the ACM, 12(4):516-524, 1965.
  17. [Gomes and Selman, 1997] Carla P. Gomes and Bart Sel- man. Problem structure in the presence of perturbations. In Proceedings of the Fourteenth National Conference on Artificial Intelligence (AAAI 97), pages 221-226, 1997.
  18. [Gu, 1991] Jun Gu. On a general framework for large-scale constraint-based optimization. SIGART Bulletin, 2(2):8, 1991.
  19. [Guala et al., 2014] Luciano Guala, Stefano Leucci, and Emanuele Natale. Bejeweled, Candy Crush and other match-three games are (NP-) hard. In 2014 IEEE Con- ference on Computational Intelligence and Games, 2014.
  20. [Helmert, 2003] Malte Helmert. Complexity results for stan- dard benchmark domains in planning. Artificial Intelli- gence, 143(2):219-262, 2003.
  21. [Hsiang et al., 2004] Jieh Hsiang, D.Frank Hsu, and Yuh- Pyng Shieh. On the hardness of counting problems of complete mappings. Discrete Mathematics, 277(1-3):87 -100, 2004.
  22. [Johnson, 1991] W. Lewis Johnson. Letter from the editor. SIGART Bulletin, 2(2):1, 1991.
  23. [Kaye, 2000] Richard Kaye. Minesweeper is NP-complete. The Mathematical Intelligencer, 22(2):9-15, 2000.
  24. [Kendall et al., 2008] Graham Kendall, Andrew J. Parkes, and Kristian Spoerer. A survey of NP-complete puzzles. ICGA Journal, 31(1):13-34, 2008.
  25. [Longpré and McKenzie, 2009] Luc Longpré and Pierre McKenzie. The complexity of solitaire. Theoretical Com- puter Science, 410(50):5252-5260, November 2009.
  26. [Mackworth and Freuder, 1985] Alan K. Mackworth and Eugene C. Freuder. The complexity of some polynomial network consistency algorithms for constraint satisfaction problems. Artificial Intelligence, 25(1):65-74, 1985.
  27. [Mandziuk, 1995] Jacek Mandziuk. Solving the n-queens problem with a binary Hopfield-type network. syn- chronous and asynchronous model. Biological Cybernet- ics, 72(5):439-446, 1995.
  28. [Martin, 2007] Barnaby Martin. On the complexity of a derivative chess problem. CoRR, arXiv:cs/0701049 [cs.CC], 2007.
  29. [Martinjak and Golub, 2007] I. Martinjak and M. Golub. Comparison of heuristic algorithms for the n-queen prob- lem. In 2007 29th International Conference on Informa- tion Technology Interfaces, pages 759-764, June 2007.
  30. [Minton et al., 1992] Steven Minton, Mark D. Johnston, An- drew B. Philips, and Philip Laird. Minimizing conflicts: A heuristic repair method for constraint satisfaction and scheduling problems. Artificial Intelligence, 58(1-3):161- 205, 1992.
  31. [Nakaguchi et al., 1999] Toshiya Nakaguchi, JIN'NO Kenya, and Mamoru Tanaka. Hysteresis neural networks for n-queens problems. IEICE TRANSACTIONS on Fun- damentals of Electronics, Communications and Computer Sciences, 82(9):1851-1859, 1999.
  32. [Namasivayam and Truszczynski, 2009] Gayathri Na- masivayam and Miroslaw Truszczynski. Blocked n-queens. https://dtai.cs.kuleuven.be/ events/ASP-competition/Benchmarks/ BlockedQueens.shtml, 2009. Link
  33. [Nauck, 1850] Franz Nauck. Schach: Eine in das Gebiet der Mathematik fallende Aufgabe von Herrn Dr. Nauck in Schleusingen. Illustrirte Zeitung, 14(361):352, June 1850. Cited in [Campbell, 1977].
  34. [Preußer, 2016] Thomas B. Preußer. 27-queens puzzle: Massively parellel enumeration and solution counting. https://github.com/preusser/q27, Septem- ber 2016. Link
  35. [Selman et al., 1992] Bart Selman, Hector J. Levesque, and David G. Mitchell. A new method for solving hard satisfia- bility problems. In Proceedings of the 10th National Con- ference on Artificial Intelligence (AAAI-92), pages 440- 446, 1992.
  36. [Shah-Hosseini, 2009] Hamed Shah-Hosseini. The intelli- gent water drops algorithm: a nature-inspired swarm- based optimization algorithm. International Journal of Bio-Inspired Computation, 1(1-2):71-79, 2009.
  37. [Sloane, 2016] N. J. A. Sloane. The on-line encyclopedia of integer sequences. https://oeis.org, 2016. Link
  38. [Smet, 2014] Geoffrey De Smet. Cheating on the n queens benchmark. http://www. optaplanner.org/blog/2014/05/12/ CheatingOnTheNQueensBenchmark.html, May 2014. Link
  39. [Sosic and Gu, 1990] Rok Sosic and Jun Gu. A polynomial time algorithm for the n-queens problem. SIGART Bul- letin, 1(3):7-11, 1990.
  40. [Takayuki and Takahiro, 2003] YATO Takayuki and Seta Takahiro. Complexity and completeness of finding another solution and its application to puzzles. IEICE transactions on fundamentals of electronics, communications and com- puter sciences, 86(5):1052-1060, 2003.
  41. [Valtorta, 1991] Marco Valtorta. Response to "explicit solu- tions to the n-queens problem for all n". SIGART Bulletin, 2(4):7-5, February 1991.
  42. [Viglietta, 2014] Giovanni Viglietta. Gaming is a hard job, but someone has to do it! Theory of Computing Systems, 54(4):595-621, 2014.
  43. [Walker, 1960] Robert J Walker. An enumerative tech- nique for a class of combinatorial problems. In Richard Bellmann and Marshall Hall Jr, editors, Combinatorial Analysis: Proceedings Of The Tenth Symposium In Ap- plied Mathematics Of The American Mathematical Soci- ety, pages 91-94. American Mathematical Society, 1960.
  44. [Walsh, 2014] Toby Walsh. Candy Crush is NP-hard. CoRR, arXiv:1403.1911 [cs.CC], 2014.

References were extracted automatically from the PDF and may contain errors.

Welcome Future Conferences AI Journal Division IJCAI Proceedings About IJCAI IJCAI Awards