English

Counting Solutions for the N-queens and Latin Square Problems by Efficient Monte Carlo Simulations

Statistical Mechanics 2009-11-13 v1

Abstract

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 10410^4 degrees of freedom with more than 101000010^10000 solutions. We also observe a distinct finite size effect of the Latin square system: its heat capacity gradually develops a second maximum as the size increases.

Keywords

Cite

@article{arxiv.0808.4003,
  title  = {Counting Solutions for the N-queens and Latin Square Problems by Efficient Monte Carlo Simulations},
  author = {Cheng Zhang and Jianpeng Ma},
  journal= {arXiv preprint arXiv:0808.4003},
  year   = {2009}
}

Comments

10 pages, 4 figures

R2 v1 2026-06-21T11:14:53.818Z