Papers
Topics
Authors
Recent
Search
2000 character limit reached

Queens: Combinatorics and Algorithmics

Updated 4 July 2026
  • Queens are a family of chessboard placement problems defined by the non-attacking queen relation across rows, columns, and diagonals.
  • They encompass classical and toroidal variants, utilizing permutation encodings and hypergraph formulations to analyze feasibility and count solutions.
  • Applications extend to asymptotic enumeration, optimization algorithms, and spectral graph theory, providing insights into combinatorial and probabilistic methods.

Queens, in combinatorics and algorithmics, denotes a family of chessboard placement problems defined by the queen attack relation—common row, common column, or common diagonal. The central object is the nn-queens problem: place nn mutually non-attacking queens on an n×nn\times n board, or count how many such placements exist. The same attack primitive also underlies toroidal, reflecting, Toeplitz, infinite-board, higher-dimensional, completion, coverage, and peaceability variants, together with graph-theoretic, probabilistic, spectral, and optimization formulations (Bowtell et al., 2021, Clinch et al., 2024, Dai et al., 2024).

1. Classical and toroidal formulations

On the classical n×nn\times n board, a queen at (x,y)(x,y) attacks any square (x,y)(x',y') with x=xx'=x, y=yy'=y, x+y=x+yx'+y'=x+y, or xy=xyx'-y'=x-y. A partial configuration is a set nn0 with at most one queen in each row, column, and non-toroidal diagonal; an nn1-queens configuration is a partial configuration of size nn2 (Luria et al., 2021).

A standard encoding uses a permutation nn3, where row nn4 contains a queen in column nn5. The row and column constraints are then automatic, and the remaining obstruction is diagonal collision. Formally, a classical solution is a nn6 for which all values nn7 and nn8 are distinct. This permutation viewpoint is central both to asymptotic counting and to probabilistic algorithms (Bowtell et al., 2021).

The toroidal variant replaces the board by a torus: rows and columns are indexed modulo nn9, and both diagonal families wrap around modulo n×nn\times n0. There are exactly n×nn\times n1 toroidal diagonals of each type, all of size n×nn\times n2. A toroidal configuration is therefore a permutation n×nn\times n3 such that the residues n×nn\times n4 are all distinct and the residues n×nn\times n5 are all distinct (Luria et al., 2021).

This modular structure admits a hypergraph formulation. A toroidal configuration is exactly a perfect matching in a natural n×nn\times n6-partite, n×nn\times n7-uniform hypergraph n×nn\times n8 with parts n×nn\times n9, each of size n×nn\times n0, whose edges are quadruples n×nn\times n1. The classical problem similarly corresponds to matchings in a related non-regular hypergraph n×nn\times n2 with non-wrapping diagonal parts of size n×nn\times n3 (Bowtell et al., 2021).

2. Existence theorems and early milestones

The classical existence theory is elementary only at a coarse level. The values n×nn\times n4 are trivial, and classical solutions exist for all n×nn\times n5. Historically, n×nn\times n6 was found by Nauck in 1850 and proved by Glaisher and Pauls in 1874; values of n×nn\times n7 are tabulated up to n×nn\times n8 in OEIS A000170 (Bowtell et al., 2021).

The toroidal existence criterion is much sharper. Pólya proved in 1918 that

n×nn\times n9

Thus toroidal feasibility is governed by a complete congruence obstruction, unlike the classical board (Bowtell et al., 2021).

Several other queen models exhibit distinct arithmetic thresholds. On a symmetric (x,y)(x,y)0 Toeplitz matrix (x,y)(x,y)1, where queens attack by row, column, or equal Toeplitz value (x,y)(x,y)2, (x,y)(x,y)3 nonattacking queens can be placed if and only if (x,y)(x,y)4. In the same model, (x,y)(x,y)5 nonattacking queens can be placed for every (x,y)(x,y)6 (Szaniszlo et al., 2010).

Reflecting queens provide another existence theory. On an (x,y)(x,y)7 board with a (x,y)(x,y)8 reflecting strip attached along one side, diagonal paths may reflect via the strip. Klarner’s reflecting (x,y)(x,y)9-queens problem is equivalent to Slater’s number-theoretic pairing problem, and reflecting (x,y)(x',y')0-queens configurations exist for all sufficiently large (x,y)(x',y')1. Small nonexistence is known for (x,y)(x',y')2; existence was constructed for (x,y)(x',y')3, and computationally for (x,y)(x',y')4 (Dai et al., 2024).

3. Asymptotic enumeration

The modern counting theory separates the classical count (x,y)(x',y')5 from the toroidal count (x,y)(x',y')6. Rivin, Vardi, and Zimmerman conjectured that

(x,y)(x',y')7

on the Pólya residue classes for the toroidal problem. Luria proved the first general asymptotic upper bounds: (x,y)(x',y')8 with (x,y)(x',y')9, and conjectured that the toroidal upper bound is tight when x=xx'=x0 (Luria, 2017).

Bowtell and Keevash proved that conjecture. For the toroidal problem,

x=xx'=x1

and x=xx'=x2 otherwise. They also proved

x=xx'=x3

for all sufficiently large x=xx'=x4. Their proof combines a random greedy algorithm with randomized algebraic construction and iterative absorption, phrased in the language of hypergraph matchings (Bowtell et al., 2021).

For the classical problem, the constant x=xx'=x5 is not the final answer. Simkin proved that there exists a constant x=xx'=x6 with x=xx'=x7 and x=xx'=x8 such that

x=xx'=x9

The proof introduces limit objects called queenons, defines a strictly concave entropy functional y=yy'=y0 on the compact convex set of queenons, and identifies y=yy'=y1 by the variational principle y=yy'=y2 (Simkin, 2021).

The toroidal constant y=yy'=y3 admits a heuristic interpretation. Starting from y=yy'=y4 permutations, the two diagonal families are approximately collision-free with probability about y=yy'=y5 each, and a further joint constraint contributes a third y=yy'=y6 factor, suggesting y=yy'=y7. Bowtell–Keevash formalize the lower bound, while Luria’s entropy argument formalizes the matching upper bound (Bowtell et al., 2021).

4. Completion, construction, and computation

The y=yy'=y8-queens completion problem asks whether a given partial non-attacking configuration can be extended to a full y=yy'=y9-queens configuration. Let x+y=x+yx'+y'=x+y0 be the largest x+y=x+yx'+y'=x+y1 such that every placement of x+y=x+yx'+y'=x+y2 mutually non-attacking queens is completable. Glock, Munhá Correia, and Sudakov proved that, for all sufficiently large x+y=x+yx'+y'=x+y3,

x+y=x+yx'+y'=x+y4

The lower bound uses rainbow matchings in bipartite graphs, probabilistic sparsification, and a generalized rainbow matching lemma; the upper bound comes from explicit non-completable partial configurations and a linear-programming dual line-weighting certificate (Glock et al., 2021).

That upper bound was improved in 2026. For all sufficiently large x+y=x+yx'+y'=x+y5,

x+y=x+yx'+y'=x+y6

The improvement preserves the line-weighting method but refines the covering construction for the unattacked squares of a carefully chosen partial configuration (Nielsen, 23 Jun 2026).

For direct construction of full configurations, a simple two-stage randomized algorithm gives a strong lower bound for the classical counting problem. Stage 1 runs a toroidal random greedy process up to

x+y=x+yx'+y'=x+y7

and with high probability places x+y=x+yx'+y'=x+y8 queens while maintaining dynamic concentration

x+y=x+yx'+y'=x+y9

for xy=xyx'-y'=x-y0. Stage 2 uses absorbers to convert the partial toroidal configuration into a full classical one, yielding

xy=xyx'-y'=x-y1

(Luria et al., 2021).

Optimization-oriented computation has produced different objective variants. Integer programming models with row, column, and diagonal constraints were used to compute many new lexicographically optimal solutions for xy=xyx'-y'=x-y2, and a lexicographic bottleneck “most beautiful” variant was solved up to xy=xyx'-y'=x-y3 (Fischetti et al., 2019). A separate Monte Carlo line of work reformulates counting as a rare-event problem, uses quantile re-ordering based on the Lorenz curve, and combines vertical-likelihood Monte Carlo, importance sampling, simulated annealing, nested sampling, and a Swendsen–Wang style algorithm for sampling binary matrices (Polson et al., 2024).

5. Structural abstractions

Several structural formalisms organize the queens literature beyond direct board combinatorics. For fixed xy=xyx'-y'=x-y4 identical queens on a dilated rational convex polygon xy=xyx'-y'=x-y5, inside-out Ehrhart theory implies that the number xy=xyx'-y'=x-y6 of nonattacking placements is a quasipolynomial in xy=xyx'-y'=x-y7 of degree xy=xyx'-y'=x-y8. Its leading coefficient is xy=xyx'-y'=x-y9, and reciprocity identifies nn00 with the number of unlabelled combinatorial configuration types. The exact formula is indexed by the intersection semilattice of attack hyperplanes and a slope matroid of weighted graphs (Chaiken et al., 2013).

The asymptotic theory of the classical problem introduces queenons, which are probability measures on nn01 with uniform marginals and sub-uniform diagonal marginals. They extend permutons by encoding diagonal sparsity. The count of configurations approximating a fixed queenon is controlled by an entropy functional involving Kullback–Leibler divergence of the measure itself and of its diagonal pushforwards, and a large deviations principle shows that typical large nn02-queens configurations concentrate near the unique entropy maximizer (Simkin, 2021).

A distinct structural notation appears in graph theory: the nn03-Queens’ graph nn04 has the nn05 board’s squares as vertices, with two vertices adjacent when the corresponding squares share a row, a column, or a diagonal. This graph decomposes as the sum of block-structured matrices coming from two triangular queen graphs nn06 and nn07, a disjoint union of cliques along anti-diagonals, and two disjoint unions of complete bipartite graphs nn08. The triangular graphs are regular and integral, with explicitly determined spectra, and Weyl’s inequalities then give eigenvalue bounds for the full attack graph (Cardoso et al., 1 Aug 2025).

These abstractions are complementary. Hypergraphs encode feasibility and counting on toroidal and classical boards; inside-out polytopes control exact quasipolynomiality for fixed nn09; queenons govern the classical asymptotic constant; and attack graphs expose spectral structure on the square-board geometry.

6. Variants, extensions, and asymptotic regimes

The peaceable queens problem replaces mutual non-attack by bipartite non-attack: maximize nn10 such that one can place nn11 white queens and nn12 black queens on an nn13 board with no opposite-color capture. For the regular board, nn14 for all sufficiently large nn15, improving the previous nn16 bound. On the torus, parity causes a sharp odd–even split: nn17 with asymptotic lower bounds nn18 for even nn19 and nn20 for odd nn21 (Clinch et al., 2024).

Higher-dimensional random-placement models replace exact non-attack by the expected proportion of safe squares. For nn22 random queens on an nn23 board, that proportion converges to

nn24

The same framework defines line-queens and hyper-queens on nn25-dimensional boards, with rook-like contributions nn26 and additional bishop-like factors; in dimension nn27, the line-queen safe-square proportion converges to

nn28

(Cashman et al., 2024).

Infinite-board greedy placement leads to another asymptotic geometry. On the doubly infinite board nn29 numbered along a square spiral, the greedy non-attacking queens are described by the Tribonacci word; the placements lie on four lines of slopes nn30 and nn31, where nn32 is the Tribonacci constant. On the single-quadrant board nn33 numbered along antidiagonals, rows and columns of the associated Sprague–Grundy table are permutations of nn34, and the queen positions are conjectured to lie on two lines of slopes nn35 and nn36 (Dekking et al., 2019).

A fixed-nn37 coverage variant asks, not for non-attack, but for the maximum number of covered squares. For each fixed nn38, there is a non-attacking threshold beyond which all optimal configurations are pairwise non-attacking, and a stabilizing threshold beyond which the set of optimal configurations becomes constant. Using the resulting loss-function analysis, all optimal large-board configurations were determined for nn39 (Adhikari et al., 4 Aug 2025).

Taken together, these variants show that queens problems are not a single counting puzzle but a broad research domain. Their shared attack geometry supports arithmetic existence theorems, entropy maximization, quasipolynomial counting, rainbow matching methods, spectral decomposition, probabilistic asymptotics, and a growing catalogue of board-dependent threshold phenomena.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to QUEENS.