corner
corner

Phys. Rev. E 79, 016703 (2009) [4 pages]

Counting solutions for the N-queens and Latin-square problems by Monte Carlo simulations

Download: PDF (123 kB) Buy this article Export: BibTeX or EndNote (RIS)

Cheng Zhang1 and Jianpeng Ma1,2,*
1Department of Bioengineering, Rice University, Houston, Texas 77005, USA
2Verna and Marrs McLean Department of Biochemistry and Molecular Biology, Baylor College of Medicine, One Baylor Plaza, BCM-125, Houston, Texas 77030, USA

Received 17 November 2008; published 8 January 2009

We apply Monte Carlo simulations to count the numbers of solutions of two well-known combinatorial problems: the N-queens problem and Latin-square problem. The original system is first converted to a general thermodynamic system, from which the number of solutions of the original system is obtained by using the method of computing the partition function. Collective moves are used to further accelerate sampling: swap moves are used in the N-queens problem and a cluster algorithm is developed for the Latin squares. The method can handle systems of 104 degrees of freedom with more than 1010 000 solutions.

© 2009 The American Physical Society

URL:
http://link.aps.org/doi/10.1103/PhysRevE.79.016703
DOI:
10.1103/PhysRevE.79.016703
PACS:
05.10.Ln, 02.10.Ox, 75.40.Mg

*jpma@bcm.tmc.edu