tell me about the Knight's Tour
that is what I did every time I was bored when I was about 7
(for who don't know what this is check this)
I calculated how many patterns of this closed circuit could have (which I failed because I soon realised there are a LOT of patterns and brute force attack won't be really effective)
Upon further research, I found out:
There are actually over 26 trillion closed Knight’s Tours on the standard 8×8 board.
26,534,728,821,064 closed tours 13,267,364,410,532 unique ones (since each closed tour can be rotated or reflected)
The rule that is used to calculate this is Warnsdorff's rule.
You’re on a square. The knight has a few options. Warnsdorff says "Look ahead. Count how many valid moves each option has. Pick the one with the least future freedom."
Why?
Because if you don’t, you’ll trap yourself later. It’s basically the knight saying “Let me first visit the squares that are hardest to reach later.”
Does it always work?
Nope.
But on an 8×8 board, starting from most squares, Warnsdorff’s Rule tends to find a complete tour. With a good tie-breaker strategy, it works almost every time.
Why does it seem to work so well?
Because the knight’s mobility varies across the board:
Corners have only 2 possible moves
Edges have 3–4
Centre can have up to 8
Warnsdorff’s Rule pushes the knight away from the highly-connected centre and into the periphery early, clearing the hard-to-reach squares while it’s still possible to get out.
Is there a formal proof of its correctness? Nope.
Warnsdorff proposed the rule in 1823, but:
There’s no general proof that it always yields a knight’s tour
It’s a heuristic, not a theorem
It just works a lot, not always
Mathematicians have studied why it often works, but they’ve also shown counterexamples where it fails. And I was able to find one too.
Let’s consider the 8×8 board, starting at sq(0, 0), the top-left corner.
If you apply Warnsdorff’s Rule naively with no tie-breaking, it fails. It gets stuck before completing the tour. The knight ends up in a dead-end after only 60-ish moves, unable to legally finish the tour.
Why does it fail? Because when multiple candidate squares have equal minimal onward moves, the rule just picks one arbitrarily.
If your tie-breaking is dumb (say, you always pick the first one in the list), you might:
Burn the escape routes early
Leave an isolated square that’s now unreachable
So even though each step looks optimal locally, the knight unknowingly walks into a trap.
If this makes sense....?


















