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.

Practice
JuniorMathematics
Combinatorics · Graph TheoryMathematics in Chess · Knight's TourAlgebra · Mathematics in Chess
Knight's Tour at a Glance

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).

1

Animated 8x8 tour preview: move 1/64

Graph modelHamiltonian path/cycleWarnsdorff heuristic
Guide

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 N×NN \times N 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:

  1. Warnsdorff ordering;
  2. 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

  1. Start near a corner and pay attention to low-degree squares.
  2. Avoid isolating corner/edge squares until you can still reach them.
  3. 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.