Knight's Tour
A chess knight must visit every square exactly once. Explore tours on 5x5 to 8x8 boards and the graph-theory ideas behind them.
In a Knight's Tour, the knight must visit every square exactly once. This puzzle is a perfect bridge between chess intuition and graph theory (Hamiltonian paths on the knight-move graph).
Animated 8x8 tour preview: move 1/64
Knight's Tour
The Knight's Tour asks for a sequence of legal knight moves that visits every square of a board exactly once.
On an board, each square is a vertex and each legal knight move is an edge. So the puzzle becomes a graph problem:
- an open tour is a Hamiltonian path;
- a closed tour is a Hamiltonian cycle.
Why this puzzle is important
Knight's Tour combines:
- mathematics in chess (movement constraints, board geometry),
- graph theory (Hamiltonian paths/cycles),
- algorithmic thinking (heuristics and backtracking).
Heuristic idea: Warnsdorff's rule
A strong strategy is to move the knight to a square that has the fewest onward moves left. This usually avoids getting trapped too early.
In this library page and its linked interactives, auto-solve uses:
- Warnsdorff ordering;
- backtracking when a branch fails.
Board sizes in this set
- 5x5: compact introduction to the move geometry.
- 6x6: larger search space, still manageable by hand.
- 7x7: much richer branching.
- 8x8: the classical board.
Tips for solving manually
- Start near a corner and pay attention to low-degree squares.
- Avoid isolating corner/edge squares until you can still reach them.
- If stuck, undo a few moves and try a different low-degree branch.
Use the linked problems below to practice each board size. You can play manually or let the solver complete from your current position.
Topics