Article

A survey of known results and research areas for -queens

Authors:
To read the full-text of this research, you can request a copy directly from the authors.

Abstract

In this paper we survey known results for the n-queens problem of placing n nonattacking queens on an n×n chessboard and consider extensions of the problem, e.g. other board topologies and dimensions. For all solution constructions, we either give the construction, an outline of it, or a reference. In our analysis of the modular board, we give a simple result for finding the intersections of diagonals. We then investigate a number of open research areas for the problem, stating several existing and new conjectures. Along with the known results for n-queens that we discuss, we also give a history of the problem. In particular, we note that the first proof that n nonattacking queens can always be placed on an n×n board for n>3 is by E. Pauls, rather than by W. Ahrens who is typically cited. We have attempted in this paper to discuss all the mathematical literature in all languages on the n-queens problem. However, we look only briefly at computational approaches.

No full-text available

Request Full-text Paper PDF

To read the full-text of this research,
you can request a copy directly from the authors.

... Their history goes as far back as ancient China c. 200 BC, and one appears in Albrecht Dürer's famous painting Melencolia I (1514). They have attracted the attention of mathematicians since Leonhard Euler's 1776 article linked them to Latin squares [3]. Magic squares that additionally have the same magic sum over all 'broken' diagonals and anti-diagonals were once called "diabolic" [15], but now are commonly known as pandiagonally magic or panmagic for short [1,2]. ...
... Although quite natural, the term "panmagic permutations" is rarely used (it is used in [1]), but they are classically known under a different name. A problem from the mid-19th century, often misattributed to Carl Friedrich Gauss [3], asked to place 8 non-attacking queens on the 8 × 8 chessboard, and it was generalized to n × n chessboards by François Lionnet in 1869. In 1900, George Carpenter proposed to fold the board into a cylinder by identifying two opposite sides of it [5], and in 1918 George Polya folded it further into a torus. ...
... In 1900, George Carpenter proposed to fold the board into a cylinder by identifying two opposite sides of it [5], and in 1918 George Polya folded it further into a torus. Both modifications have the same effect of letting the queens attack along the entire broken diagonals, and came to be known as the modular n-queens problem [3]. Given its solution, replace the board with a matrix and place 1-s into the positions of the queens and 0-s elsewhere as on Figure 1. ...
Article
Full-text available
Panmagic permutations are permutations whose matrices are panmagic squares. Positions of 1-s in the latter describe maximal configurations of non-attacking queens on a toroidal chessboard. Some of them, affine panmagic permutations, can be conveniently described by linear formulas of modular arithmetic, and we show that their sets have remarkable algebraic properties when one multiplies three or more of them rather than just two. In group-theoretic terms, they are special cosets of the dihedral group in the group of all affine permutations. We also investigate decomposition of panmagic permutations into disjoint cycles and find many connections with classical topics of number theory: multiplicative orders, 4k+1 primes, primitive roots and quadratic residues.
... The N-Queens problem, a cornerstone of combinatorial mathematics since its inception in the 19th century, challenges us to place N queens on an N × N chessboard such that no two queens attack each other along rows, columns, or diagonals [2]. This problem has served as a benchmark for algorithmic efficiency, constraint satisfaction, and combinatorial enumeration [2,15]. ...
... The N-Queens problem, a cornerstone of combinatorial mathematics since its inception in the 19th century, challenges us to place N queens on an N × N chessboard such that no two queens attack each other along rows, columns, or diagonals [2]. This problem has served as a benchmark for algorithmic efficiency, constraint satisfaction, and combinatorial enumeration [2,15]. However, the classical formulation, while rich, overlooks the structural richness introduced by periodic boundary conditions, as in the toroidal N-Queens problem. ...
... The N-Queens problem, a classic challenge in combinatorial mathematics, seeks to place N queens on an N × N chessboard without mutual attacks along rows, columns, or diagonals [2]. The toroidal variant, where the board is modeled as a torus (Z/NZ) 2 , introduces modular diagonal constraints, revealing connections to number theory, topology, and algebraic geometry [13]. ...
... The N-Queens problem, a classic challenge in combinatorial optimization, involves placing N queens on an N × N chessboard such that no two queens threaten each other. Beyond its recreational appeal, the problem serves as a benchmark for evaluating algorithmic efficiency and theoretical frameworks in discrete mathematics and computer science [1,2]. Recent studies have extended its scope to dynamical systems, viewing the configuration space as a Markov chain to explore stability and ergodic properties [3,4]. ...
... From its inception, the N-Queens problem has served as a fertile ground for exploring permutation-based constraints and symmetry reduction techniques. Classical studies have established the enumeration of solutions and highlighted inherent symmetries [1,5]. Sloane's OEIS entry [6] remains a key reference for validating new solution methods. ...
... Appendix D. 1 ...
Article
Full-text available
The N-Queens problem, a classical benchmark in permutation-based combinatorial optimization, has recently attracted renewed attention through the lens of stochastic dynamics and ergodic theory. In this paper, we model the configuration space of N-Queens as a discrete-time Markov chain, unveiling dynamic transitions between feasible and infeasible states. We introduce formal definitions of stability and p-stability to characterize the structural robustness of configurations and propose novel ergodic invariants to describe long-term behavior in the state space. These invariants serve as analytical tools to classify stability landscapes and quantify metastable phenomena. Algorithmic simulations support our theoretical framework, offering insights into convergence patterns, invariant measures, and the topological complexity of the solution space. Our findings bridge combinatorics, statistical physics, and theoretical computer science, offering a unified approach to stability analysis in constraint satisfaction problems.
... Notation follows [GJN17] and [JB09] in large parts. There are several cases of varying names or notation for the same problem, property, or result in different sources. ...
... Further variants of the problem identify opposite faces of the board, creating different topologies such as n-queens on a Moebius strip or a torus. For an overview see [BS08] and [JB09]. In particular, the n-queens problem on the modular n d board [Nud95] proves useful for the n-queens problem in higher dimensions and will be expanded on in the following section. ...
... Definition 3 (regular solution [JB09]). A regular (or sometimes called linear) solution is a certificate for the (n, d)-queens problem, that can be constructed by a starting square (s 1 , s 2 , ...) and a fixed movement (m 1 , m 2 , ...) that places the k-th queen at (s 1 + (k · m 1 ) mod n, s 2 + (k · m 2 ) mod n, ...). ...
Preprint
Full-text available
How many mutually non-attacking queens can be placed on a d-dimensional chessboard of size n? The n-queens problem in higher dimensions is a generalization of the well-known n-queens problem. We provide a comprehensive overview of theoretical results, bounds, solution methods, and the interconnectivity of the problem within topics of discrete optimization and combinatorics. We present an integer programming formulation of the n-queens problem in higher dimensions and several strengthenings through additional valid inequalities. Compared to recent benchmarks, we achieve a speedup in computational time between 15-70x over all instances of the integer programs. Our computational results prove optimality of certificates for several large instances. Breaking additional, previously unsolved instances with the proposed methods is likely possible. On the primal side, we further discuss heuristic approaches to constructing solutions that turn out to be optimal when compared to the IP. We conclude with preliminary results on the number and density of the solutions.
... Several extensions of the n-queens problem, that is considering other board topologies and dimensions [4-7, 12, 14], have also been explored. As stated in [1], Polya [15] is the first to consider the n-queens problem on an n × n modular chessboard − a torus formed from an n × n chessboard with opposite sides identified. He proved that a solution to the n-queens problem exists on an n × n modular board if and only if gcd(n, 6) = 1. ...
... Monsky [13] determined the maximum number of non-attacking queens for other values of n. A very comprehensive survey of past results on n-queens problem was done by Bell and Stevens [1]. ...
... It is called a "semi-queen" in [12]. A queen has all our rook's moves and three more: (1, −1), (2, 1) and (1,2). However, the squareboard model obscures the symmetries we will investigate. ...
Article
Full-text available
We show the existence of solutions to the n-rooks problem and n-queens problem on chessboards with hexagonal cells, problems equivalent to certain three and six direction riders on ordinary chessboards. Translating the problems into graph theory problems, we determine the independence number (maximum size of independent set) of rooks graph and queens graph. We consider the n×nn \times n planar diamond-shaped H_n with hexagonal cells, and the board HnH_n as a flat torus TnT_n. Here, a rook can execute moves on lines perpendicular to the six sides of the cell it is placed, and a queen can execute moves on those lines together with lines through the six corners of the cell it is placed.
... Therefore, a solution can be achieved in case that no two queens possess at the same time the same column, row, or diagonal. The eight queens problem was first posed in the mid-19th century and nowadays, it is used in many cases for numerous computer programming techniques such as secure data hiding [1,3,[7][8][9]. There are proved to be 92 solutions in this problem, but many of them are equivalent because each solution can come from the other solution according to the basic symmetry or doing 90-degree rotations [4,5]. ...
... Next, we placed queen q1 in the first acceptable position (1,1). A possible next position to place q2 is position (2,3), but in that case there is no position left for placing queen q3. Therefore, we backtrack one step and place the queen q2 to position (2,4), the next best option. ...
... Therefore, we backtrack one step and place the queen q2 to position (2,4), the next best option. Next, the position to place the queen q3 is (3,2). However, by continuing we understand that this strategy leads to a deadlock, and no position is left to place securely queen q4. ...
Chapter
The eight queens problem was a topic for concern of many great mathematicians such as Gauss, Nauck, Guenther and Glaisher among others. It is a problem that explores how to set eight chess queens on an 8 × 8 chessboard by having in mind to implement the constraint that no two queens can attack one another. Therefore, a solution can be achieved in that problem in case that no two queens possess at the same time the same column, row, or diagonal. The eight queens problem was first posed in the mid-19th century and nowadays, it is used in many cases for numerous computer programming techniques such as secure data hiding. This study tries to contribute to a better understanding of the 8-Queens problem by describing and implementing various algorithmic approaches implemented in PASCAL Programming Language, with main purpose to find optimal solutions to the problem. In the last section, a useful discussion is conducted for further investigation of the A* algorithm to offer better solution to Queens problem in different dimensions (n × n).
... , s p are the corresponding multiplicities. Usually, when s j = 1 for some j, we write μ j instead of μ [1] j . If μ is an eigenvalue of a graph G, the eigenspace associated with μ is denoted by E G (μ). ...
... The German mathematician and physicist Gauss had the knowledge of this problem and found 72 solutions. However, according to [1], the first to solve the problem by finding all 92 solutions was F. Nauck in 1850 [11]. As later claimed by Gauss, this number is indeed the total number of solutions. ...
... Clearly, [n − 3] × ([n − 2]\{1}) ⊆ S. Since x (1,1) = x (n,1) = 0, it follows that (1,2) +x (2,2) + x (1,3) . . . ...
Article
Full-text available
Sharp bounds on the least eigenvalue of an arbitrary graph are presented. Necessary and sufficient (just sufficient) conditions for the lower (upper) bound to be attained are deduced using edge clique partitions. As an application, we prove that the least eigenvalue of the n-Queens graph Q(n)Q(n){\mathcal {Q}}(n) is equal to -44-4 for every n≥4n4n \ge 4 and it is also proven that the multiplicity of this eigenvalue is (n-3)2(n3)2(n-3)^2. Finally, edge clique partitions of additional infinite families of connected graphs and their relations with the least eigenvalues are presented.
... can move horizontally, vertically, and diagonally. So, the attacking positions with respect to a queen are the positions with same rows, same columns and same diagonal [1][2][3]. Additionally, there are some values of N for which no solution is possible, for example N=2. So, that is needed to keep track as well. ...
... Consider the following example of a 4x4 chess board that is a 4-queen's problem. If a queen is placed in (1,1) cell then no other queens can be placed in the same row that is (1,2), (1,3), (1,4) cells, in the same column that is (2,1), (3,1), (4,1) cells and in the same diagonal that is (2,2), (3,3), (4,4) cells as shown in table 1. ...
... Consider the following example of a 4x4 chess board that is a 4-queen's problem. If a queen is placed in (1,1) cell then no other queens can be placed in the same row that is (1,2), (1,3), (1,4) cells, in the same column that is (2,1), (3,1), (4,1) cells and in the same diagonal that is (2,2), (3,3), (4,4) cells as shown in table 1. ...
Chapter
Full-text available
N-Queen’s problem is the problem of placing N number of chess queens on an NxN chessboard such that none of them attack each other. A chess queen can move horizontally, vertically, and diagonally. So, the neighbors of a queen have to be placed in such a way so that there is no clash in these three directions. Scientists accept the fact that the branching factor increases in a nearly linear fashion. With the use of artificial intelligence search patterns like Breadth First Search (BFS), Depth First Search (DFS), and backtracking algorithms, many academics have identified the problem and found a number of techniques to compute possible solutions to n-queen’s problem. The solutions using a blind approach, that is, uninformed searches like BFS and DFS, use recursion. Also, backtracking uses recursion for the solution to this problem. All these recursive algorithms use a system stack which is limited. So, for a small value of N, it exhausts the memory quickly though it depends on the machine. This paper deals with the above problem and proposes a non-recursive DFS search-based approach to solve the problem to save system memory. In this work, Depth First Search (DFS) is used as a blind approach or uninformed search. This experimental study yields a noteworthy result in terms of time and space.KeywordsN-Queen’s problemNon-Recursive algorithmIterative algorithmDFSArtificial intelligence
... Max Sync Set Input: An automaton A; Output: A synchronizing set of states of maximum size in A. Türker and Yenigün [TY15] study a variation of this problem, which is to find a set of states of maximum size that can be mapped by some word to a subset of a given set of states in a given monotonic automaton. They reduce the N-Queens Puzzle problem [BS09] to this problem to prove its NP-hardness. However, their proof is unclear, since the input has size O(log N ), and the output size is polynomial in N . ...
... However, their proof is unclear, since the input has size O(log N ), and the output size is polynomial in N . Also, the N-Queens Puzzle problem is solvable in polynomial time [BS09]. ...
Preprint
We study the computational complexity of various problems related to synchronization of weakly acyclic automata, a subclass of widely studied aperiodic automata. We provide upper and lower bounds on the length of a shortest word synchronizing a weakly acyclic automaton or, more generally, a subset of its states, and show that the problem of approximating this length is hard. We investigate the complexity of finding a synchronizing set of states of maximum size. We also show inapproximability of the problem of computing the rank of a subset of states in a binary weakly acyclic automaton and prove that several problems related to recognizing a synchronizing subset of states in such automata are NP-complete.
... The 8-queens puzzle can be easily posed for any size of the chessboard. The problem has been generalized in many different directions, see [10] for a recent survey. One of these generalizations is the n-queens 2 puzzle, where one must cover an entire chessboard n × n with n 2 queens, so that two queens of the same color do not attach each other. ...
... In our following experiment, whose results are shown in Figure 17, we compare the performance of the Douglas-Rachford algorithm with and without maximal clique information when it is applied for finding a solution of the windmill graph Wd (10,5). Observe that, even having increased the number of variables in the feasibility problem, both the rate of success and the rate of convergence (in terms of iterations, but also computing time) are improved. ...
Preprint
We present the Douglas-Rachford algorithm as a successful heuristic for solving graph coloring problems. Given a set of colors, these type of problems consist in assigning a color to each node of a graph, in such a way that every pair of adjacent nodes are assigned with different colors. We formulate the graph coloring problem as an appropriate feasibility problem that can be effectively solved by the Douglas-Rachford algorithm, despite the nonconvexity arising from the combinatorial nature of the problem. Different modifications of the graph coloring problem and applications are also presented. The good performance of the method is shown in various computational experiments.
... The n-queens problem has been widely studied since then, attracting the attention of Pólya and Lucas. It is now best known as a toy problem in algorithm design [1]. ...
... Communicated by A. Editor * We would like to correct a misunderstanding in [1]. The authors state that there exists no closed-form expression for Q(n) because it was shown to be beyond the #P complexity class. ...
Preprint
In this paper, we derive simple closed-form expressions for the n-queens problem and three related problems in terms of permanents of (0,1) matrices. These formulas are the first of their kind. Moreover, they provide the first method for solving these problems with polynomial space that has a nontrivial time complexity bound. We then show how a closed-form for the number of Latin squares of order n follows from our method. Finally, we prove lower bounds. In particular, we show that the permanent of Schur's complex valued matrix is a lower bound for the toroidal semi-queens problem, or equivalently, the number of transversals in a cyclic Latin square.
... For given n, d, the corresponding optimization problem asks to find the maximal k, for which a solution to the partial (n, d)-queens problem exists. We call such a solution a maximal partial solution [3] and denote it as Q max (n, d). ...
... The generalization of the n-queens problem to the third dimension is first proposed by [8]. An overview on variants of the n-queens problem, including the problem in higher dimensions, is given by [3]. Recently [6] succeeded in proving maximality for several new instances. ...
Preprint
Full-text available
How many mutually non-attacking queens can be placed on a d-dimensional chessboard of size n? The n-queens problem in higher dimensions is a generalization of the well-known n-queens problem. We present an integer programming formulation of the n-queens problem in higher dimensions and several strengthenings through additional valid inequalities. Compared to recent benchmarks, we achieve a speedup in computational time between 15-70x over all instances of the integer programs. Our computational results prove optimality of certificates for several large instances. Breaking additional, previously unsolved instances with the proposed methods is likely possible. On the primal side, we further discuss heuristic approaches to constructing solutions that turn out to be optimal when compared to the IP.
... The problem was first proposed in 1848 by German chess composer Max Bezzel and elicited the interest of several prominent mathematicians, including Gauss and Pólya. Detailed accounts of the historical development of the n-queens problem can be found in the survey by Bell and Stevens [1] and the work by Bowtell and Keevash [2]. ...
... Moreover, we could ask the question about how many possible reflecting n-queens configurations there are for any integer n. Further variations of the n-queens problem can be found in the survey on the n-queens problems by Bell and Stevens [1]. ...
Preprint
In 1967, Klarner proposed a problem concerning the existence of reflecting n-queens configurations. The problem considers the feasibility of placing n mutually non-attacking queens on the reflecting chessboard, an n×nn\times n chessboard with a 1×n1\times n "reflecting strip" of squares added along one side of the board. A queen placed on the reflecting chessboard can attack the squares in the same row, column, and diagonal, with the additional feature that its diagonal path can be reflected via the reflecting strip. Klarner noted the equivalence of this problem to a number theory problem proposed by Slater, which asks: for which n is it possible to pair up the integers 1 through n with the integers n+1 through 2n such that no two of the sums or differences of the n pairs of integers are the same. We prove the existence of reflecting n-queens configurations for all sufficiently large n, thereby resolving both Slater's and Klarner's questions for all but a finite number of integers.
... (3) N-Queen Problem: N-queens (NQ) are an enumeration problem. Given a chessboard of size N × N, find a way to place N queens on the board such that no two queens can attack each other [24]. It is implemented as an enumeration problem. ...
... If the execution is still in the ES-Phase, twice the number of alive workers (aliveWorkers) is provisioned (Lines 10-14). After the ES-Phase is over, Linear-Phase starts (Lines [15][16][17][18][19][20][21][22][23][24][25][26]. When E elastic surpasses the up efficiency threshold (uEff) consecutively for 3 iterations, a new worker is provisioned (Lines 21-23). ...
Article
Full-text available
Exact combinatorial search algorithms have applications in several areas of computational algebra, AI, discrete optimization, etc. These problems are compute-intensive and have a highly irregular search tree. Most of the earlier efforts to parallelize these algorithms used a fixed degree of parallelism during runtime. We show that such an approach leads to poor resource utilization as the parallel run-time efficiency of an irregular search application varies over time. We propose DiGTreeS, a distributed resilient framework for generalized tree search that supports elastic scaling. It features an easy-to-use API for expressing combinatorial search and hides away the system concerns such as load balancing, fault tolerance, and elastic scaling. We evaluate the DiGTreeS framework for different scaling strategies and show its effectiveness on four representative problem instances: Traveling Salesman Problem, 0–1 Knapsack, N-queens, and Generic State Space Search Application.
... Our algorithm is readily adapted to compute these values as discussed later. 8 Puzzles and games have long motivated studies on the number of solutions to constraint satisfaction problems, such as n-queens [2], Sudoku [3], checkers [4], chess [5], and Go [6]. Spahn [7] presents a method for counting the number of solutions to grid-based puzzles and demonstrates how the method may be used to compute the number of solutions to a variant of Star-Battle obtained by dropping the row constraints in the constraint satisfaction problem shown in Fig. 1. ...
... The set of all paths is partitioned into the equivalence classes G d comprising all d-gap paths where 2 ≤d≤ n 2 . 1 In turn, we partition each G d into the classes G d (i) comprising the set of d-gap paths whose first row contains stars in positions i and (i+d) mod n. For example, where n= 8, the paths in G 3 (i) start with the rows (0,3), (1,4), (2,5), (3,6), (4,7), (0,5), (1,6), and (2,7) for i= 0, 1, . . . , 7 respectively. ...
Article
Full-text available
Given an n×nn×nn\mathrm {\times }n grid of cells, a valid configuration for the Star-Battle problem is a subset of 2n2n\textrm{2}n cells—those containing ‘stars’—such that each row and each column contains exactly two stars, and no two stars are orthogonally or diagonally adjacent. The standard Star-Battle game assumes a plane topology in which stars bordering opposite edges of the board are nonadjacent. We present an algorithm for counting the number of distinct valid configurations as a function of n, for plane, cylindrical, and toroidal board topologies. We have run our algorithm up to n=15n=15, for which the number of valid configurations is equal to 106,280,659,533,411,296 for the plane topology, and somewhat less for the cylindrical and toroidal topologies.
... This has led to their study to learn more about them and possible solving strategies. They are also useful for testing new ideas [11,12], technologies [13][14][15][16] and optimization algorithms [17,18]. Combinatorial games can be defined as those games in which there is only one player who knows all the information about the system, they are deterministic and the goal is to determine a combination x that solves the problem and wins the game. ...
Preprint
Full-text available
In this paper, we present a brief review and introduction to Quadratic Unconstrained D-ary Optimization (QUDO), Tensor Quadratic Unconstrained D-ary Optimization (T-QUDO) and Higher-Order Unconstrained Binary Optimization (HOBO) formulations for combinatorial optimization problems. We also show their equivalences. To help their understanding, we make some examples for the knapsack problem, traveling salesman problem and different combinatorial games. The games chosen to exemplify are: Hashiwokakero, N-Queens, Kakuro, Inshi no heya, and Peg Solitaire. Although some of these games have already been formulated in a QUBO formulation, we are going to approach them with more general formulations, allowing their execution in new quantum or quantum-inspired optimization algorithms. This can be an easier way to introduce these more complicated formulations for harder problems.
... One of the most ancient and famous enumeration problems involving a chessboard and chess pieces is the 8-queens problem that was first stated by Max Bezzel in 1848see [3,10,27] for accounts of its history. This problem asks to find the number of different ways of placing 8 queens on a chessboard so that none of them can attack the others (queens can attack vertically, horizontally, and diagonally). ...
Article
Full-text available
We study different domination problems of attacking and non-attacking rooks and queens on polyominoes and polycubes of all dimensions. Our main result proves that maximum independent domination is NP-complete for non-attacking queens and for non-attacking rooks on polycubes of dimension three and higher. We also analyze these problems for polyominoes and convex polyominoes, conjecture the complexity classes, and provide a computer tool for investigation. We have also computed new values for classical queen domination problems on chessboards (square polyominoes). For our computations, we have translated the problem into an integer linear programming instance. Finally, using this computational implementation and the game engine Godot, we have developed a video game of minimum domination of queens and rooks on randomly generated polyominoes.
... The goal of N Queens Problem is to suitably place N number of Queens on an N x N chessboard in a way that there is no conflict between them due to the arrangement, that is, there is no intersection between them vertically or horizontally or diagonally. Eight Queens Problem is a just a special case of N Queens Problem, where N is equal to 8. Jordan B. and Brett S. [12] considered extensions of the N Queens Problem including various board topologies and dimensions at the same time surveying already known solutions for the N Queens Problem of placing N Queens on an N x N chessboard. They simultaneously provided a simple solution for finding the intersections of diagonals. ...
Preprint
In this paper a Metaheuristic approach for solving the N-Queens Problem is introduced to find the best possible solution in a reasonable amount of time. Genetic Algorithm is used with a novel fitness function as the Metaheuristic. The aim of N-Queens Problem is to place N queens on an N x N chessboard, in a way so that no queen is in conflict with the others. Chromosome representation and genetic operations like Mutation and Crossover are described in detail. Results show that this approach yields promising and satisfactory results in less time compared to that obtained from the previous approaches for several large values of N.
... Türker and Yenigün [TY15] study a variation of this problem, which is to find a set of states of maximum size that can be mapped by some word to a subset of a given set of states in a given monotonic automaton. They reduce the N-Queens Puzzle problem [BS09] to this problem to prove its NP-hardness. However, their proof is unclear, since in the presented reduction the input has size O(log N ), and the output size is polynomial in N . ...
Preprint
We study extremal and algorithmic questions of subset and careful synchronization in monotonic automata. We show that several synchronization problems that are hard in general automata can be solved in polynomial time in monotonic automata, even without knowing a linear order of the states preserved by the transitions. We provide asymptotically tight bounds on the maximum length of a shortest word synchronizing a subset of states in a monotonic automaton and a shortest word carefully synchronizing a partial monotonic automaton. We provide a complexity framework for dealing with problems for monotonic weakly acyclic automata over a three-letter alphabet, and use it to prove NP-completeness and inapproximability of problems such as {\sc Finite Automata Intersection} and the problem of computing the rank of a subset of states in this class. We also show that checking whether a monotonic partial automaton over a four-letter alphabet is carefully synchronizing is NP-hard. Finally, we give a simple necessary and sufficient condition when a strongly connected digraph with a selected subset of vertices can be transformed into a deterministic automaton where the corresponding subset of states is synchronizing.
... Recently, another model that relates the caged diffusion to the Edwards-Wilkinson equation was studied by Centres and Bustingorry [82]. Their model consists of diffusing particles on a 2D lattice, with a constraint reminiscent of the eight-queens problem [83][84][85]. Since the cages never break in this model, the normal diffusion disappears. ...
Preprint
As an indicator of cooperative motion in a system of Brownian particles that models two-dimensional colloidal liquids, displacement correlation tensor is calculated analytically and compared with numerical results. The key idea for the analytical calculation is to relate the displacement correlation tensor, which is a kind of four-point space-time correlation, to the Lagrangian two-time correlation of the deformation gradient tensor. Tensorial treatment of the statistical quantities, including the displacement correlation itself, allows capturing the vortical structure of the cooperative motion. The calculated displacement correlation also implies a negative longtime tail in the velocity autocorrelation, which is a manifestation of the cage effect. Both the longitudinal and transverse components of the displacement correlation are found to be expressible in terms of a similarity variable, suggesting that the cages are nested to form a self-similar structure in the space-time.
... Here we present a scheme that aims at solving the N -queens problem, and variations of it, using atoms with cavity-mediated long-range in-teractions [24][25][26][27][28]. We note that the N -queens problem is not just of mathematical interest but also has some applications in computer science [29]. In this work, variations of the problem are used as a testbed [30] to study a possible quantum advantage in solving classical combinatorial problems in near term quantum experiments. ...
Preprint
Full-text available
The N-queens problem is to find the position of N queens on an N by N chess board such that no queens attack each other. The excluded diagonals N-queens problem is a variation where queens cannot be placed on some predefined fields along diagonals. This variation is proven NP-complete and the parameter regime to generate hard instances that are intractable with current classical algorithms is known. We propose a special purpose quantum simulator that implements the excluded diagonals N-queens completion problem using atoms in an optical lattice and cavity-mediated long-range interactions. Our implementation has no overhead from the embedding allowing to directly probe for a possible quantum advantage in near term devices for optimization problems.
... A famous problem is the n queens problem, originally proposed by Bezzel under the pen-name "Schadenfreude" in [Bez48], which considers the maximum number of safe squares on an n × n chess board when placing n queens. This problem has attracted substantial interest, described in [BS09], but the solution is only known for small n, as shown in [LV11]. A similar problem is the dominating queens problem, which looks at the minimum number of queens required to cover an n × n chess board. ...
Preprint
Full-text available
The n queens problem considers the maximum number of safe squares on an n×nn \times n chess board when placing n queens; the answer is only known for small n. Miller, Sheng and Turek considered instead n randomly placed rooks, proving the proportion of safe squares converges to 1/e21/e^2. We generalize and solve when randomly placing n hyper-rooks and nk1n^{k-1} line-rooks on a k-dimensional board, using combinatorial and probabilistic methods, with the proportion of safe squares converging to 1/ek1/e^k. We prove that the proportion of safe squares on an n×nn \times n board with bishops in 2 dimensions converges to 2/e22/e^2. This problem is significantly more interesting and difficult; while a rook attacks the same number of squares wherever it's placed, this is not so for bishops. We expand to the k-dimensional chessboard, defining line-bishops to attack along 2-dimensional diagonals and hyper-bishops to attack in the k1k-1 dimensional subspace defined by its diagonals in the k2k-2 dimensional subspace. We then combine the movement of rooks and bishops to consider the movement of queens in 2 dimensions, as well as line-queens and hyper-queens in k dimensions.
... This problem has always solution for n ≥ 4 [5] and its solution is a maximum independent set of the n-Queens graph. Some historical notes about this problem are available in [1] and [2]. ...
... Generic search is a modular search procedure that takes as input a predicate P on some multi-dimensional search space and finds all points of the space satisfying P. Generic search is agnostic to the specific instantiation of P, and as a result is applicable across a wide spectrum of domains. Classic examples such as Sudoku solving (Bird, 2006), the n-queens problem (Bell & Stevens, 2009) and graph colouring can be cast as instances of generic search, and similar ideas have been explored in connection with exact real integration (Simpson, 1998;Daniels, 2016). ...
Article
Full-text available
We study a fundamental efficiency benefit afforded by delimited control, showing that for certain higher-order functions, a language with advanced control features offers an asymptotic improvement in runtime over a language without them. Specifically, we consider the generic count problem in the context of a pure functional base language λb{\lambda_{\textrm{b}}} and an extension λh{\lambda_{\textrm{h}}} with general effect handlers . We prove that λh{\lambda_{\textrm{h}}} admits an asymptotically more efficient implementation of generic count than any implementation in λb{\lambda_{\textrm{b}}} . We also show that this gap remains even when λb{\lambda_{\textrm{b}}} is extended to a language λa{{{{{{\lambda_{\textrm{a}}}}}}}} with affine effect handlers , which is strong enough to encode exceptions, local state, coroutines and single-shot continuations. This locates the efficiency difference in the gap between ‘single-shot’ and ‘multi-shot’ versions of delimited control. To our knowledge, these results are the first of their kind for control operators.
... 12 works for all corresponding cylinder boards.3. The problem of nding a maximal arrangement of non-attacking pieces of a single type is often interpreted as a graph theory problem[BS09,Joh18,Wat04]: each ...
Article
Full-text available
We present placements of mutually non-attacking chess pieces of mixed type that occupy more than half of the squares of an m × n board. If both white and black pawns are allowed as separate types, there are arrangements, which we also present, that occupy at least two-thirds of the board squares.
... In 1972, Edsger Dijkstra used this problem to illustrate a method which he called structured programming. He published a highly detailed description of a depth-first backtracking algorithm [1][2][3]. It has attracted the attention of several mathematicians including Gauss, Polya and Lucas [4,5]. ...
Article
Full-text available
The N-queens problem plays an important role in academic research and has many practical applications ranging from physics to biology and cryptography to protein folding. The complexity increases with increasing values of n. Solving for the location of queens arranged as knighted chains can reduce the time complexity and resource requirements, providing at least one fundamental solution for all n (n ≥ 4). An exhaustive memoir on the development of a heuristic algorithm to propose a plausible solution for the N-queens problem is presented. Every n is mapped into an instance of its even analogue, assigned to groups, and a solution is designed with knighted chain patterns. In case of odd n, the solution is extended to complete the composition. Furthermore, a generalised solution for all n (n ≥ 4) is presented. Composing the queen’s exile by knighted chains results in a symmetric solution that could both be solvable and verifiable.
... Another case study is a distributed backtracking that enumerates all valid complete solutions of the n-queens, the problem of placing N non-attacking queens on a chess board [2]. This distributed implementation is a proof-of-concept that motivates further improvements in solving related combinatorial optimization problems. ...
Conference Paper
Multilevel parallelism hierarchy is a key feature of modern parallel computing platforms. It adds a vertical dimension of heterogeneity, which, together with the horizontal heterogeneity resulting from the use of different types of processors and accelerators at the same level, hampers the efforts of programming language designers due to the different programming requirements at each level and of devices at the same level of parallelism. This paper introduces μHash, a multilevel parallel component model to address modularity issues related to vertical heterogeneity. It is implemented in a Julia package called Hash.jl with three parallelism levels (multicluster, cluster, and multicore), whose performance is evaluated using two multilevel programs: μGEMM and NQueens.
... The n-queens problem is a generalisation of the above problem: placing n non-attacking queens on n × n chessboard Figure 1. If we consider the complement of queen graph (Bell and Stevens, 2009), the problem can be solved by enumerating all maximal cliques with n cells or vertices, i.e., MCE of an n-clique problem, an NP-complete problem even in the approximate case (Khot, 2001). ...
... This problem has always solution for n ≥ 4 [4] and its solution is a maximum independent set of the n-Queens graph. Some historical notes about this problem are available in [1] and [2]. ...
Preprint
The n-Queens' graph, Q(n)\mathcal{Q}(n), is the graph obtained from a n×nn\times n chessboard where each of its n2n^2 squares is a vertex and two vertices are adjacent if and only if they are in the same row, column or diagonal. In a previous work the authors have shown that, for n4n\ge4, the least eigenvalue of Q(n)\mathcal{Q}(n) is 4-4 and its multiplicity is (n3)2(n-3)^2. In this paper we prove that n4n-4 is also an eigenvalue of Q(n)\mathcal{Q}(n) and and its multiplicity is at least n+12\frac{n+1}{2} or n22\frac{n-2}{2} when n is odd or even, respectively. Furthermore, when n is odd, it is proved that 3,2,n112-3,-2\ldots,\frac{n-11}{2} and n52,,n5\frac{n-5}{2},\ldots,n-5 are additional integer eigenvalues of Q(n)\mathcal{Q}(n) and a family of eigenvectors associated with them is presented. Finally, conjectures about the the multiplicity of the aforementioned eigenvalues and about the non-existence of any other integer eigenvalue are stated.
... Beside permutation itself, some problems require additional constraints to be satisfied. For example, the N-queen puzzle (Bell and Stevens 2009) requires every (sub-)diagonal line of the solution to sum to no more than 1. The traveling salesman problem (Larranaga et al. 1999) expects every city to be visited only once. ...
Article
Full-text available
This paper studies a shuffled linear regression problem. As a variant of ordinary linear regression, it requires estimating not only the regression variable, but also permutational correspondences between the covariates and responses. While existing formulations require the underlying ground-truth correspondences to be an ideal bijection such that all pieces of data should match, such a requirement barely holds in real-world applications due to either missing data or outliers. In this work, we generalize the formulation of shuffled linear regression to a broader range of conditions where only a part of the data should correspond. To this end, the effective recovery condition and NP-hardness of the proposed formulation are also studied. Moreover, we present a simple yet effective algorithm for deriving the solution. Its global convergence property and convergence rate are also analyzed in detail. Distinct tasks validate the effectiveness of our proposed formulation and the solution method.
... One of the most ancient and famous enumeration problems involving a chessboard and chess pieces is the 8-queens problem that was first stated by Max Bezzel in 1848-see [3,6,15] for accounts of the history. This problem asks to find the number of different ways of placing 8 queens on a chessboard without attacking each other (queens can attack vertically, horizontally, and in diagonals). ...
Preprint
Full-text available
We study different domination problems of attacking and non-attacking rooks and queens on polyominoes and polycubes of all dimensions. Our main result proves that the problem is NP-complete for non-attacking queens on polyominoes and for non-attacking rooks on three-dimensional polycubes. We also analyze these problems on the set of convex polyominoes, for which we conjecture and give some evidence that these domination problems restricted to this subset of polyominoes might be NP-complete for both, queens and rooks. We have also computed new values for classical queen domination problems on chessboards (square polyominoes). For our computations, we have translated the problem into an integer linear programming instance. Finally, using this computational implementation and the game engine Godot, we have developed a video game of minimal domination of queens and rooks on randomly generated polyominoes.
... Recent work by Simkin [1] has shown that where is a constant, that we refer to as the n-queens constant, characterized as the optimal value of an infinite dimensional convex optimization problem. For background on the problem and previously derived bounds on Q(n), see [2]. ...
Article
Full-text available
In recent work Simkin shows that bounds on an exponent occurring in the famous n-queens problem can be evaluated by solving convex optimization problems, allowing him to find bounds far tighter than previously known. In this note we use Simkin’s formulation, a sharper bound developed by Knuth, and a Newton method that scales to large problem instances, to find even sharper bounds.
Article
An Ising model is a mathematical model defined by an objective function comprising a quadratic formula of multiple spin variables, each taking values of either or . The task of determining a spin value assignment to these variables that minimizes the resulting value of an Ising model is a challenging optimization problem. Recently, quantum annealers, consisting of qubit cells interconnected according to principles of quantum mechanics, have emerged as a solution for tackling such problems. Ising models characterized by fewer quadratic terms are preferable as they reduce the resource requirements of quantum annealers. Additionally, it is advantageous for the absolute values of coefficients associated with linear and quadratic terms to be small to facilitate the discovery of good solutions, given the inherent limitations in the resolution of quantum annealers. The primary contribution of this article lies in presenting Ising models tailored for solving the ‐Queens puzzle. The conventional Ising model for this puzzle involves quadratic terms, with the maximum absolute value of coefficients being . Our novel Ising model significantly reduces the number of quadratic terms to only , with a maximum absolute coefficient of 6. Furthermore, we provide embedding results for a quantum annealer D‐Wave Advantage utilizing a Pegasus graph . We succeeded in embedding our novel Ising model for up to the 21‐Queens puzzle, while the conventional Ising model can be embedded only for up to the 14‐Queens puzzle.
Chapter
This chapter delves into the inherent role of energy within the proposed theoretical framework, communication dynamics, which draws inspiration from Shannon’s communication theory. Beginning with the foundational understanding of atoms as quintessential carriers of energy, especially evident in electron orbital structures, we explore the centrality of energy in varying computational models, from classical mechanics to quantum mechanics. A pivotal observation reveals the confluence of information and energy, suggesting that in many systems, particularly in quantum realms, information transfer necessitates energy interactions. Further, we probe the energy implications within particle-wave duality, indicating dual energy manifestations for entities. By emphasizing energy’s universality, we argue for its role as a bridge in the multi-scale model integration of communication dynamics with diverse scientific fields. We posit that for the holistic success of this new framework, a coherent understanding and representation of energy across multiple scales and domains is imperative.
Conference Paper
The Top500 list features supercomputers powered by accelerators from different vendors. This variety brings, along with the heterogeneity challenge, both the code and performance portability challenges. In this context, Chapel’s native GPU support comes as a solution for code portability between different vendors. In this paper, we investigate the viability of using the Chapel high-productivity language as a tool to achieve both code and performance portability in large-scale tree-based search. As a case study, we implemented a distributed backtracking for solving permutation combinatorial problems. Extensive experiments conducted on big N-Queens problem instances, using up to 512 NVIDIA GPUs and 1024 AMD GPUs on Top500 supercomputers, reveal that it is possible to scale on the two different systems using the same tree-based search written in Chapel. This trade-off results in a performance decrease of less than 10% for the biggest problem instances.
Article
Continuous evolution and improvement of GPGPUs has significantly broadened areas of application. The massively parallel platform they offer, paired with the high efficiency of performing certain operations, opens many questions on the development of suitable techniques and algorithms. In this work, we present a novel algorithm and create a massively parallel, GPGPU‐based solver for enumerating solutions of the N‐Queens problem. We discuss two implementations of our algorithm for GPGPUs and provide insights on the optimizations we applied. We also evaluate the performance of our approach and compare our work to existing literature, showing a clear reduction in computational time.
Article
This paper shows that computing the n-queen solution of the chessboard n-by-n from the chessboard (n-1)-by-(n-1) can be used in polynomial time O(n2) using symbolic computation on the complement of the n queen Graph. Nevertheless, continuing further in an incremental approach, besides the n-1 solution, which represents the maximum cliques of size n-1 on the complement of the graph corresponding to the chessboard n-1, we need the maximum cliques of size n-2,and below. By doing so, we need to eliminate the anti-chain problem, which increases the algorithm’s complexity.
Chapter
The N-Queens problem is relevant in Artificial Intelligence (AI); the solution methodology has been used in different computational intelligent approaches. Max Bezzel proposed the problem in 1848 for eight queens in 8 ×\times 8 chessboard. After that, the formulation was modified to an N-Queens problem in a chessboard. There are several ways of posing the problem and algorithms to solve it. We describe two commonly used mathematical models that handle the position of queens and restrictions. The first and easiest way is to find one combination that satisfies the solution. The second model uses a more compact notation to represent the queen’s potions. This generic problem has been solved with many different algorithms. However, there is no comparison of the performance among the methods. In this work, a comparison of performance for different problem sizes is presented. We tested the Backtracking, Branch and Bound, and Linear Programming algorithms for a different number of queens, reaching 17. In addition, we present statistical comparative experimental results of the different methods.
Conference Paper
The N queens’ problem is one of the most popular combinational topics to determine number of states that non-attacking N queens should be placed on the N×N chessboard. In this paper we presented an algorithm by combination of using backtracking algorithm and stack data structure. Then the algorithm was programmed by Microsoft Visual Studio 2008. In closing, the outputs of our algorithm include number of states and locations of queens in chessboard were described.
Article
Full-text available
We all recognize 0, 1, 1, 2, 3, 5, 8, 13,... but what about 1, 2, 4, 6, 3, 9, 12, 8, 10, 5, 15,...? If you come across a number sequence and want to know if it has been studied before, there is only one place to look, the On-Line Encyclopedia of Integer Sequences (or OEIS). Now in its 49th year, the OEIS contains over 220,000 sequences and 20,000 new entries are added each year. This article will briefly describe the OEIS and its history. It will also discuss some sequences generated by recurrences that are less familiar than Fibonacci's, due to Greg Back and Mihai Caragiu, Reed Kelly, Jonathan Ayres, Dion Gijswijt, and Jan Ritsema van Eck.
Book
Full-text available
Computational Commutative Algebra 2 is the natural continuation of Computational Commutative Algebra 1 with some twists, starting with the differently coloured cover graphics. The first volume had 3 chapters, 20 sections, 44 tutorials, and some amusing quotes. Since bigger is better, this book contains 3 chapters filling almost twice as many pages, 23 sections (some as big as a whole chapter), and 55 tutorials (some as big as a whole section). The number of jokes and quotes has increased exponentially due to the little-known fact that a good mathematical joke is better than a dozen mediocre papers. The main part of this book is a breathtaking passeggiata through the computational domains of graded rings and modules and their Hilbert functions. Besides Gröbner bases, we encounter Hilbert bases, border bases, SAGBI bases, and even SuperG bases. The tutorials traverse areas ranging from algebraic geometry and combinatorics to photogrammetry, magic squares, coding theory, statistics, and automatic theorem proving. Whereas in the first volume gardening and chess playing were not treated, in this volume they are. This is a book for learning, teaching, reading, and most of all, enjoying the topic at hand. The theories it describes can be applied to anything from children's toys to oil production. If you buy it, probably one spot on your desk will be lost forever!
Article
Full-text available
The modular n-queen problem in higher dimensions was introduced by Nudelman [6]. He showed that for a complete solution to exist in the d-dimensional modular n-chessboard, it is necessary that gcd(n, (2d − 1)!) = 1, and that it is sufficient that gcd(n, (2 d − 1)!) = 1. He con-jectured that the last condition is also necessary and showed that this is indeed the case for the class of linear solutions. In this notes, we observe that the conjecture is true for the larger class of polynomial solutions, which are solutions we present as a natural generalization of the bidimensional solutions developed by Klöve [3]. We also generalize constructions of bidimensional solutions developed also by Klöve [4].
Article
An elementary treatment of a class of solutions to the n-queens problem leads to a proof of Fermat's theorem on primes which are sums of two squares.
Article
For more than 250 years combinatorial problems on chessboards have been studied and published in numerous books on recreational mathematics. Two problems of this type include the problem of finding a placement of n non-attacking queens on an n×n chessboard and the problem of determining the minimum number of queens which are necessary to cover every square of an n×n chesboard. Within the past five years a surge of interest in chessboard problems has occurred among a group of a dozen or so graph theorists and computer scientists. This paper surveys recent developments and mentions a large number of open problems.
Article
A complete mapping on a set G with binary operation is a bijection : G ! G such that the mapping : G ! G defined by (x) = x (x) is again a bijection. We give an asymptotic upper bound of exp{ 0.08854n} for the proportion of per- mutations in Sn which form complete mappings under addition modulo n.