Abstract
This paper presents two Las Vegas algorithms to generate single solutions to the n-queens problem. One algorithm generates and improves on random permutation vectors until it achieves one that is a successful solution, while the other algorithm randomly positions queens within each row in positions not under attack from above.
- E. J. Hoffman, J. C. Loessi and R. C. Moore, "Constructions for the Solution of the m Queens Problem", Mathematics Magazine, Vol. 42, No. 2 (Mar. 1969), p. 66--72. The construction is that of A. M. Yaglom and I. M. Yaglom, Neelementarnye Zadachi v Elementarnom Izlozhenii (Moscow, 1954), translated by James McCawley, Jr., revised and edited by Basil Gordon, Challenging Mathematical Problems with Elementary Solutions: Volume I, Combinatorial Analysis and Probability Theory (1964, reprinted by Dover 1987), pp. 92--98.Google ScholarCross Ref
- Bo Bernhardsson, "Explicit solutions to the n-queens problems for all n", ACM SIGART Bulletin, Vol. 2, No. 2 (Apr. 1991), p.7. Google ScholarDigital Library
- Rok Sosič and Jun Gu, "A Polynomial Time Algorithm for the N-Queens Problem", ACM SIGART Bulletin, Vol. 1, No. 3 (xx, 1990), pp. 7--11. Google ScholarDigital Library
- Rok Sosič and Jun Gu, "Fast Search Algorithms for the N-Queens Problem", IEEE Transactions on Systems, Man, and Cybernetics, Vo. 21, No. 6 (Nov/Dec 1991), pp. 1572--76.Google ScholarCross Ref
- http://www.acmcontest-pacnw.org/ProblemSet/2005/Problem I.Google Scholar
- Niklaus Wirth, "Program Development by Stepwise Refinement", Communications of the ACM, Vol. 14, No. 4 (April 1971), pp. 221--27, specifically p. 224. Google ScholarDigital Library
- Niklaus Wirth, Algorithms and Data Structures (Prentice-Hall, 1986), pp. 153--57. Google ScholarDigital Library
- http://penguin.ewu.edu/~trolfe/QueenLasVegas/Google Scholar
Index Terms
- Las Vegas does n-queens
Recommendations
Nearly optimal static Las Vegas succinct dictionary
STOC 2020: Proceedings of the 52nd Annual ACM SIGACT Symposium on Theory of ComputingGiven a set S of n (distinct) keys from key space [U], each associated with a value from Σ, the static dictionary problem asks to preprocess these (key, value) pairs into a data structure, supporting value-retrieval queries: for any given x∈ [U], valRet(...
A Las Vegas algorithm for linear programming when the dimension is small
SFCS '88: Proceedings of the 29th Annual Symposium on Foundations of Computer ScienceAn algorithm for solving linear programming problems is given. The expected number of arithmetic operations required by the algorithm is given. The expectation is with respect to the random choices made by the algorithm, and the bound holds for any ...
Chasing First Queens by Integer Programming
Integration of Constraint Programming, Artificial Intelligence, and Operations ResearchAbstractThe n-queens puzzle is a well-known combinatorial problem that requires to place n queens on an chessboard so that no two queens can attack each other. Since the 19th century, this problem was studied by many mathematicians and computer ...
Comments