---
title: 'Knight Graphs: Structure, Tours, and Complexity'
url: https://www.emergentmind.com/topics/knight-graphs
type: topic
---

# Knight Graphs: Structure, Tours, and Complexity

A knight graph is the graph obtained by taking chessboard cells as vertices and legal knight moves as edges. In its most common form, the graph is defined on an \(m\times n\) rectangular board, but the same construction applies to any finite set of cells \(S\subset \mathbb{Z}^2\), to boards with holes, and to higher-dimensional rectangular boards. Across these settings, knight graphs serve as the standard graph-theoretic model for knight’s tours, magic tours, induced-path extremal problems, generalized leaper graphs, and computational hardness questions [2109.09326], [1202.5291], [2606.29153].

## 1. Definition and basic structure

On a rectangular board, a cell is indexed by coordinates, and two cells are adjacent precisely when a knight can move between them in one move:
\[
\{|x'-x''|,\;|y'-y''|\}=\{1,2\}.
\]
In the notation of Awani Kumar, the knight graph on an \(m\times n\) board is \(K_{m,n}\), with vertex set
\[
V(K_{m,n})=\{(i,j):1\le i\le m,\;1\le j\le n\},
\]
and edge set consisting of unordered pairs of squares related by a single knight move [1802.09340]. In the notation used for arbitrary finite cell sets, the knight graph on \(S\subset \mathbb{Z}^2\) is \(G\{S\}\), a simple graph with vertex set \(S\) and the same adjacency rule [2301.01152]. For boards with holes, a chessboard is modeled by a Boolean matrix \(B\in\{0,1\}^{n\times n}\), the present cells form \(S(B)\), and the knight graph is the simple undirected bipartite graph on \(S(B)\) induced by knight moves [2606.29153].

Knight graphs are bipartite. On ordinary boards this is the familiar checkerboard coloring: a knight move always switches the parity of \(x+y\), so every edge goes between opposite color classes [2109.09326], [2301.01152]. On finite rectangular boards they are sparse, with degree at most \(8\); internal vertices typically have degree \(4\), \(6\), or \(8\) depending on proximity to the boundary [1802.09340].

Several minimal-board thresholds are known exactly. For the knight \(L=(1,2)\), the complete leaper graph is nontrivially connected if and only if the board contains a \(3\times 4\) rectangle or its transpose \(4\times 3\). A distinct threshold governs edge connectedness: all knight edges lie in one connected component if and only if the board contains a \(3\times 3\) region [2109.09326]. These criteria separate vertex-level connectivity from the weaker requirement that all non-isolated vertices belong to a single component.

A common misconception is that knight graphs are primarily about full rectangular chessboards. The literature treats those boards as a foundational case, but the same graph model extends directly to irregular shapes, holes, arbitrary finite cell sets, and higher-dimensional products. This broader viewpoint is essential for both the structural and the complexity-theoretic results.

## 2. Tours, Hamiltonicity, and arithmetic labelings

In graph-theoretic terms, a knight’s tour is a Hamiltonian traversal of the knight graph. An open tour is a Hamiltonian path, and a closed or re-entrant tour is a Hamiltonian cycle [1802.09340], [2606.29153]. This translation makes standard graph-theoretic distinctions central: existence of a tour becomes Hamiltonicity, and additional arithmetic constraints become constraints on vertex labelings induced by Hamiltonian paths or cycles.

Awani Kumar studies \(K_{4,n}\) and \(K_{6,n}\) with magic, semi-magic, quasi-magic, and near-magic constraints. On a \(4\times n\) board, a knight tour labels squares by \(1,\dots,4n\), and a magic knight tour requires all four long rows to sum to
\[
M_{\mathrm{long}}=\frac{n(4n+1)}{2},
\]
while all \(n\) short rows sum to
\[
M_{\mathrm{short}}=2(4n+1).
\]
On a \(6\times n\) board, the corresponding constants are
\[
M_{\mathrm{long}}=\frac{n(6n+1)}{2},\qquad
M_{\mathrm{short}}=3(6n+1).
\]
The parity obstruction is explicit: for \(4\times n\) and \(6\times n\), magic tours are impossible if \(n\) is odd, and on \(6\times n\) they are also impossible when both sides are singly even, such as \(6\times 6\), \(6\times 10\), and \(6\times 14\) [1802.09340].

The constructive existence results are specific. Magic tours exist on all boards of size \(4\times 2k\) for \(k>8\), so the smallest such board is \(4\times 18\). Kumar reports \(16\) magic tours on \(4\times 18\), \(88\) on \(4\times 20\), \(464\) on \(4\times 22\), \(2076\) on \(4\times 24\), \(9904\) on \(4\times 26\), and \(47456\) on \(4\times 28\). For \(6\times n\), magic tours exist on all boards of size \(6\times 4k\) for \(k>2\), so the smallest such board is \(6\times 12\); Kumar reports \(8\) magic tours on \(6\times 12\). The same paper records a quasi-magic tour on \(6\times 11\), \(660{,}282\) semi-magic tours with short rows magic on \(6\times 11\), and on \(6\times 12\) it records \(4{,}310{,}970\) semi-magic tours with short rows magic, \(484\) quasi-magic tours with short-row magic, and \(2056\) near-magic tours with short-row magic [1802.09340].

The taxonomy is precise. A semi-magic knight tour requires either all long rows or all short rows to share a common sum, but not necessarily both. A quasi-magic knight tour is a semi-magic tour in which the non-magic lines take only two different sum values. A near-magic knight tour is a semi-magic tour where the non-magic lines take three distinct values: the magic constant and two other values [1802.09340]. Graph-theoretically, these are Hamiltonian paths or cycles together with constrained labelings on the vertex set.

Closed-tour behavior is subtler than open-tour behavior. Kumar cites Sainte-Marie’s result that closed tours are impossible on \(4\times n\) boards, which is a statement that \(K_{4,n}\) admits Hamiltonian paths but not Hamiltonian cycles [1802.09340]. This sharp distinction between path-Hamiltonicity and cycle-Hamiltonicity recurs throughout the subject.

The enumerative results also delimit current knowledge. Kumar notes that total numbers of all tours on many boards remain unknown, records only partial or conjectural values for some sizes, and highlights open questions concerning counting complexity, the possible nonexistence of quasi-magic tours on \(4\times(2n+1)\), and the existence of closed magic tours on \(6\times 16\) and larger even boards [1802.09340]. This suggests that arithmetic constraints transform an already difficult Hamiltonian problem into a substantially narrower and more rigid labeling problem.

## 3. Knight graphs within leaper-graph theory

The knight is the \((1,2)\)-leaper. More generally, a \((p,q)\)-leaper moves between cells when
\[
\{|x'-x''|,\ |y'-y''|\}=\{p,q\}.
\]
Beluhov studies skew free leapers, meaning \(p>0\), \(q>0\), \(p\neq q\), and the complete leaper graph on \(\mathbb{Z}\times\mathbb{Z}\) is connected. Classically,
\[
L=(p,q)\text{ is free}\iff p+q\text{ is odd},\ \gcd(p,q)=1.
\]
The knight satisfies these conditions and is therefore the root of an infinite ternary tree \(\mathfrak{L}\) whose vertices are all skew free leapers [2109.09326].

The three child transformations are
\[
f(L)=(p,2p+q),\qquad
g(L)=(q,2q-p),\qquad
h(L)=(q,p+2q).
\]
Every skew free leaper appears exactly once in the rooted tree, and each leaper has a unique descent, a word over \(\{\mathtt f,\mathtt g,\mathtt h\}\) describing how it is reached from the knight. Beluhov’s “induction on descent” proves general theorems for all skew free leapers by starting from the knight and propagating properties along these transformations [2109.09326].

For knight graphs themselves, several consequences are explicit. The knight graph is nontrivially connected if and only if the board contains a \(3\times 4\) or \(4\times 3\) subboard. All edges of the knight graph lie in one connected component if and only if the board contains a \(3\times 3\) subboard. A knight wazir journey, meaning a knight walk whose endpoints are adjacent by a wazir move, exists if and only if the board contains a \(3\times 3\) rectangle [2109.09326]. These thresholds are minimal-board criteria rather than asymptotic statements.

Beluhov also introduces directional rigidity. Two leaper graphs are direction-isomorphic if there is an isomorphism preserving move directions. A knight graph is directionally flexible if it is direction-isomorphic to a graph of some non-proportional leaper, and directionally rigid otherwise. The criterion is the presence of an unbalanced closed walk. For the knight, Beluhov’s theorem implies that there are finitely many minimal boards \(A_i^{\mathcal R}\) such that any board containing one of them yields a directionally rigid knight graph; on smaller boards, directionally flexible coincidences with other leapers can occur [2109.09326]. The paper gives concrete descendants of the knight in \(\mathfrak L\), including the giraffe \((1,4)\), the zebra \((2,3)\), and \((2,5)\).

The resulting perspective treats the knight graph not as an isolated chess construction but as the foundational case in a larger hierarchy of leaper graphs. This suggests a methodological shift: many apparently knight-specific phenomena are better understood as instances of structural statements that can be lifted and lowered along \(\mathfrak L\).

## 4. Induced paths, cycles, and pseudosnake density

A snake path in a graph is a path that is also an induced subgraph; equivalently, it is a chordless path. A snake cycle is an induced cycle. Beluhov studies the longest snake paths and cycles in knight graphs \(G\{m\times n\}\) and proves the asymptotic theorem
\[
L_{\mathrm{snake\ path}}(m,n)=\frac{mn}{2}+\mathcal O(m+n),\qquad
L_{\mathrm{snake\ cycle}}(m,n)=\frac{mn}{2}+\mathcal O(m+n),
\]
for all positive integers \(m,n\) [2301.01152]. Thus the longest induced path or cycle uses about half the board, with a deficit linear in the perimeter.

The upper bound is obtained through weighted pseudosnake density. A pseudosnake is an induced subgraph of maximum degree \(2\), hence a disjoint union of paths and cycles. Beluhov constructs a finite weighted knight graph on \(68\) cells with total weight \(192\) and, using a constraint-satisfaction solver (Copris, OR-Tools), verifies that the maximum total weight of any pseudosnake is exactly \(96\). The resulting weighted pseudosnake density is therefore
\[
\frac{96}{192}=\frac12.
\]
A transfer lemma then yields the global upper bound \(\frac{mn}{2}+\mathcal O(m+n)\) for all rectangular knight graphs [2301.01152].

The local obstruction underlying this construction is a \(16\)-cell set \(S_{\mathrm{Tess}}\) whose knight graph is isomorphic to the \(4\)-dimensional hypercube \(Q_4\). The pseudosnake density of this tesseract graph is \(9/16\approx 0.5625\), which is too large for the desired bound, so Beluhov superposes overlapping copies and obtains a weighted “pancake” graph of density \(1/2\) [2301.01152]. This is an instance where the decisive obstruction is weighted rather than purely unweighted.

The lower bound comes from explicit induced-cycle constructions built from twines, ties, splices, and skeins. A twine is a board of height \(2\); its knight graph decomposes into four paths. By tying off twines on the left or right and splicing successive twines, Beluhov constructs sets \(U(k,I)\) whose knight graph is a cycle whenever \(|I|\) is odd. Assemblies of four large skeins, followed by local deletion and addition operations, produce a single snake cycle occupying
\[
\frac{mn}{2}+\mathcal O(m+n)
\]
vertices [2301.01152].

The asymptotic theorem sharply separates ordinary Hamiltonian behavior from induced Hamiltonian behavior. Knight graphs on many large rectangles admit Hamiltonian paths or cycles, yet induced Hamiltonian paths or cycles do not exist for large knight graphs. On the \(8\times 8\) board, the exact extremal values cited by Beluhov are a snake path of maximum length \(33\) and a snake cycle of maximum length \(32\); Dawson found a snake path of length \(31\) and a snake cycle of length \(32\), while Knuth determined the finer equivalence-class counts [2301.01152]. This shows that local nonadjacency constraints fundamentally limit induced traversals even when global tours exist.

## 5. Higher-dimensional knight graphs

The higher-dimensional knight graph is defined on the rectangular board
\[
B_{\underline n}=\llbracket 1,n_1\rrbracket\times\cdots\times\llbracket 1,n_k\rrbracket,
\]
where \(\underline n=(n_1,\dots,n_k)\). The move set is
\[
C_k=\big\{(a_1,\ldots,a_k)\in\mathbb Z^k:\ |\{i:a_i=0\}|=k-2,\ |\{i:a_i\in\{\pm1\}\}|=1,\ |\{i:a_i\in\{\pm2\}\}|=1\big\},
\]
so exactly two coordinates change, by \(\pm1\) and \(\pm2\), and the others stay fixed. The knight graph is \(G_{\underline n}=(B_{\underline n},E_{\underline n})\), where \(E_{\underline n}(a,b)=1\) iff \(a-b\in C_k\) [1202.5291].

A closed knight tour is exactly a Hamiltonian cycle in \(G_{\underline n}\). For \(k=2\), the relevant background theorem is Schwenk’s classification of rectangular boards with no closed tour: \(m\) and \(n\) both odd, \(m\in\{1,2,4\}\), or \(m=3\) with \(n\in\{4,6,8\}\). For \(k=3\), DeMaio and Mathew showed that no closed tour exists exactly when \(m,n,p\) are all odd, or \(m=n=2\), or \(m=2\) and \(n=p=3\) [1202.5291].

Erde, Golénia, and Golénia extend this to all \(k\ge 3\). If \(2\le n_1\le\cdots\le n_k\), then the \(n_1\times\cdots\times n_k\) board has no closed knight tour if and only if one of the following holds: all \(n_i\) are odd, \(n_{k-1}=2\), or \(n_k=3\). In all other cases, the higher-dimensional knight graph has a Hamiltonian cycle [1202.5291]. They also prove that when some \(n_i\) is even, a closed tour exists if and only if the knight graph is connected.

The proof is constructive and inductive. The graph is first shown to be bipartite by a coloring \(\phi(a_1,\dots,a_k)=(-1)^{a_1\cdots a_k}\). Nonexistence in the forbidden cases follows from parity or disconnection. Existence is proved using sites and bi-sited Hamiltonian cycles: local patterns inside a Hamiltonian cycle of a lower-dimensional knight graph allow one to glue together multiple layers and gain a new dimension while preserving Hamiltonicity [1202.5291]. This dimension-raising mechanism is the higher-dimensional analogue of building larger tours from smaller templates.

The same paper also defines generalized knight graphs \(G_{\underline n}^{\alpha,\beta}\), where the move is \((\pm\alpha,\pm\beta)\) in exactly two coordinates, and proves a dimension-raising theorem for these generalized leapers: if an \((\alpha,\beta)\)-tour exists on a sufficiently large \(2\)-dimensional board, then tours exist on higher-dimensional boards with dimensions at least \(\alpha+\beta-1\) in the added coordinates [1202.5291]. This suggests that the higher-dimensional knight graph is one point in a broader family of leaper graphs whose Hamiltonicity can be propagated across dimension.

## 6. Complexity and algorithmic regimes

For boards with holes, the computational picture changes abruptly. A chessboard with holes is given by a Boolean matrix \(B\in\{0,1\}^{n\times n}\), and it is connected when the rook-adjacency graph on its present squares is connected. In this setting, the knight graph remains bipartite, but its shape can encode much more complicated structures than rectangular boards permit [2606.29153].

The open Knight’s Tour problem is Hamiltonian path on the knight graph, and the closed Knight’s Tour problem is Hamiltonian cycle on the knight graph. On connected chessboards with holes, both open and closed Knight’s Tour are NP-hard. The reductions start from Hamiltonian path or cycle in grid graphs and replace each grid-graph vertex by a local \(9\times 9\) board-with-holes gadget \(M_v\). The gadgets have transition squares, the number and placement of which encode the vertex degree, and the global placement ensures that neighboring gadgets are connected by exactly one knight edge while non-neighboring gadgets are not connected by knight moves [2606.29153].

The reverse direction of the reduction depends on parity inside the gadgets. In each \(M_v\), the total number of squares of the majority color exceeds the other by exactly \(1\), and all transition squares have the same color. Since a knight alternates color on every move, a global tour can enter and leave each gadget at most once. The contiguous gadget blocks extracted from a knight tour therefore recover a Hamiltonian cycle or path in the source grid graph [2606.29153]. This makes the hardness argument genuinely graph-theoretic rather than merely geometric.

The same paper places Knight Exchange in the language of pebble motion. A configuration on a graph \(G=(V,E)\) is a function
\[
C:V\to\{-1,0,1\},
\]
with \(-1\) and \(1\) representing black and white pebbles and \(0\) a hole. A move \(u\to v\) slides a pebble along an edge into a hole. The optimal Knight Exchange problem is the corresponding Pebble Swap problem restricted to knight graphs of connected boards, with symmetric initial and final configurations. The paper proves that Pebble Swap on bipartite graphs is NP-hard and then transfers the reduction to knight graphs, concluding that the optimal Knight Exchange problem on connected chessboards is NP-hard [2606.29153].

This hardness result coexists with a markedly easier rectangular regime. For standard rectangular boards, the decision problem for an open knight’s tour is effectively constant-time decidable from arithmetic conditions on the dimensions, and a linear-time construction is known when a tour exists [2606.29153]. A plausible implication is that knight graphs exhibit two sharply separated algorithmic behaviors: highly regular rectangles admit explicit structure theorems, while connected boards with holes are expressive enough to simulate NP-hard Hamiltonian and reconfiguration problems.

The complexity results also correct a common oversimplification. Connectivity of the underlying board does not make the problem easy: even under rook-connectivity, knight-graph Hamiltonicity remains NP-hard on boards with holes [2606.29153]. The decisive structural variable is not connectivity alone, but the extent to which the board geometry constrains the knight graph from encoding arbitrary gadgetry.

Source: https://www.emergentmind.com/topics/knight-graphs