Statistical mechanics of the $N$-queens problem
Abstract
We investigate the -queens problem as a lattice gas -- a model in which queens are placed on an chessboard with pairwise repulsive interactions along shared rows, columns, and diagonals -- from the perspective of statistical mechanics. The ground states are exactly the solutions of the classical -queens problem, with entropy per queen (). This entropy reflects a characteristic constraint hierarchy: each successive geometric constraint -- columns, then diagonals -- reduces the entropy from the free-placement value by a definite constant. We derive the exact high-temperature energy as . Extensive Monte Carlo simulations with sweeps per temperature point for -- reveal that the specific heat per queen converges to a universal function of as . The converged curve features a non-divergent peak at , establishing the absence of a thermodynamic phase transition. Combined with the trivially exact high-temperature entropy , the convergence of enables a thermodynamic integration of from to that recovers the ground-state entropy -- and hence the Simkin constant -- purely from Monte Carlo data. This provides an independent thermodynamic route to a fundamental combinatorial constant. Thermodynamic integration yields at , within of the precise combinatorial value . 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