English

Statistical mechanics of the $N$-queens problem

Statistical Mechanics 2026-05-13 v2 Computational Physics

Abstract

We investigate the NN-queens problem as a lattice gas -- a model in which NN queens are placed on an N×NN \times N chessboard with pairwise repulsive interactions along shared rows, columns, and diagonals -- from the perspective of statistical mechanics. The ground states are exactly the Q(N)Q(N) solutions of the classical NN-queens problem, with entropy per queen s0lnNγs_0 \approx \ln N - \gamma (γ1.944\gamma \approx 1.944). This entropy reflects a characteristic constraint hierarchy: each successive geometric constraint -- columns, then diagonals -- reduces the entropy from the free-placement value lnN\ln N by a definite constant. We derive the exact high-temperature energy E/N5/3E/N \to 5/3 as NN \to \infty. Extensive Monte Carlo simulations with 10810^8 sweeps per temperature point for N=8N = 8--10241024 reveal that the specific heat per queen Cv/NC_v/N converges to a universal function of TT as NN \to \infty. The converged curve features a non-divergent peak Cvmax/N1.63C_v^{\max}/N \approx 1.63 at T0.235JT^* \approx 0.235\,J, establishing the absence of a thermodynamic phase transition. Combined with the trivially exact high-temperature entropy S()/N=(1/N)ln(N2N)S(\infty)/N = (1/N) \ln \binom{N^2}{N}, the convergence of Cv/NC_v/N enables a thermodynamic integration of Cv/TC_v/T from T=T = \infty to T=0T = 0 that recovers the ground-state entropy -- and hence the Simkin constant γ\gamma -- purely from Monte Carlo data. This provides an independent thermodynamic route to a fundamental combinatorial constant. Thermodynamic integration yields γMC=1.946±0.003\gamma_{\rm MC} = 1.946 \pm 0.003 at N=1024N = 1024, within 0.1%0.1\% of the precise combinatorial value γ=1.94400(1)\gamma = 1.94400(1). We further present a transfer-matrix-based tensor network formulation that encodes the non-attacking constraints into a rank-9 site tensor with 17 nonzero elements, providing a complementary exact-enumeration route.

Keywords

Cite

@article{arxiv.2605.10326,
  title  = {Statistical mechanics of the $N$-queens problem},
  author = {Zong-Yue Liu and Hai-Jun Liao and Lei Wang},
  journal= {arXiv preprint arXiv:2605.10326},
  year   = {2026}
}

Comments

9 pages, 6 figures, 2 tables. Code and data: https://github.com/LiuZY613/nqueen-lattice-gas

R2 v1 2026-07-22T07:04:02.592Z