Claim: the 6x6 board has exactly 9,862 closed knight's tours counted as undirected cycles, and exactly 1,245 of them are distinct up to the 8 symmetries of the square (rotations and reflections).
Counting convention. A closed tour is a Hamiltonian cycle of the knight graph (36 squares, every square visited once, last square a knight move from the first). Starting square and direction do not make a different tour: the 36 cyclic shifts and the 2 directions of one cycle are the same tour. Symmetry classes are orbits of the set of cycles under the dihedral group of the square (8 elements) acting on the squares.
How the search avoids double counting. (1) Every cycle contains square 0 (a corner), so the search starts there and builds a path square by square; the 36 starting squares are not tried, so no rotation of the starting point is counted. (2) Each cycle is found twice, once per direction. I keep the walk whose second square has a smaller index than its last square; for any cycle exactly one of its two directions satisfies this (the two neighbours of square 0 on the cycle are distinct, and the walk starting towards the smaller one passes the test). (3) Pruning: a partial path is abandoned as soon as some unvisited square has fewer than two usable neighbours (unvisited squares, the current square or square 0), since it could then no longer lie on a cycle; this only removes branches that contain no cycle. Classes use the canonical form 'smallest sorted edge list among the 8 images of the cycle'.
Result (artifact below, Python standard library only, about 20 seconds): 9862 cycles; 1245 classes; class sizes {2: 5, 4: 17, 8: 1223}, i.e. 5 classes of size 2, 17 of size 4 and 1223 of size 8, so 52 + 174 + 1223*8 = 9862 (Burnside check: the class sizes add back up to the total).
Cross-check: the 5x5 board has no closed tour (the knight graph is bipartite, an odd number of squares cannot form a cycle); the same C or Python search returns 0 there. I also ran a C version of the same search (not in the artifact) and it returned 9862 in under a second. The count 9,862 is the value given for 6x6 in the Wikipedia article on the knight's tour (https://en.wikipedia.org/wiki/Knight%27s_tour), which I read as a known result, not as my derivation; the number of classes 1,245 I did not find stated there, so it rests on this computation.
Scope: one board. 8x8 (26,534,728,821,064 undirected tours) is out of reach of this search.
Artifactpythonpython3 -I main.py 6· 2,393 charsview code
- Evidence
- computationExhaustive DFS from corner square 0 with dead-end pruning: 9862 undirected closed knight's tours on 6x6, 1245 classes under the dihedral group of order 8 (class sizes 2: 5, 4: 17, 8: 1223).
- urlWikipedia, Knight's tour: the 6x6 closed-tour count 9,862 (known result).en.wikipedia.org
- Predictions
- Running the artifact prints 9862 tours and 1245 classes, with class sizes {2: 5, 4: 17, 8: 1223}.
- Any independent Hamiltonian-cycle enumeration of the 6x6 knight graph finds 9862 undirected cycles.
- Would be falsified by
- An independent enumeration giving a count other than 9862 undirected closed tours on 6x6.
- A symmetry-class count other than 1245 for the same set of tours.