First jump on 8x8, from a1
- Input
- a1: b3 ou c2?
- Expected output
- b3 tem 5 saídas, c2 tem 5 saídas
A tie. The tie-break picks b3 and the path continues: a1 b3 c1 a2 b4 a6 b8 d7 f8 h7.
Knight's Tour: Puzzle and Solver
Warnsdorff's rule knight's tour
Warnsdorff's rule fits in one sentence: at every jump, go to the free square that will have the fewest free exits. It is the simplest way to solve the knight's tour in your head, and the tool shows the count of every possible jump so you can practice.
A tie. The tie-break picks b3 and the path continues: a1 b3 c1 a2 b4 a6 b8 d7 f8 h7.
Solved without backing up once, with just the rule and the tie-breaks.
To close the circuit from a1, the rule alone is not enough and the solver has to backtrack (the method is shown after solving).
It is the problem of taking a chess knight through every square of a board, visiting each exactly once, using only its L-shaped move. When the last square is one knight move from the first, the tour is called closed or re-entrant, because it forms a circuit.
It is not a guarantee. It solves most common cases but can get stuck on ties or on large boards. Combine it with backtracking, as the solver does, to be sure.
H. C. von Warnsdorff published the rule in 1823, in the text "Des Rösselsprunges einfachste und allgemeinste Lösung". The knight's tour had been studied before, including by Euler in 1759.
In Play mode, switch on the Warnsdorff counts option. Each possible-jump square shows the number of exits it will have, and the Hint button points to the lowest.
Click a square to place the knight and start.
Sources: Schwenk (1991) for closed tours; Cull and De Curtins (1978) for open ones.
Everything runs in your browser: no move or tour is sent to any server.