All Chess Positions
EN
Open the map

Chess by the numbers

The knight’s tour: how many are there?

A knight can visit every square of the board exactly once, and in many ways: there are 26,534,728,821,064 closed tours, which end a knight’s jump from where they began, or 13,267,364,410,532 if a tour and the same tour run backwards count as one (Brendan McKay, 1997).

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364

A closed tour found by this site: the knight starts on b2 (square 1), visits all 64 squares, and from square 64 one more jump takes it home.

It was found with Warnsdorff’s rule, and checked by the builder: 64 different squares, every step a knight’s jump.

Open and closed tours

A tour is closed when the last square is a knight’s jump from the first, so the knight could go round again; otherwise it is open. Counting every tour, open or closed, from every starting square and in both directions, there are 19,591,828,170,979,904 on a chessboard (Alex Chernov, 2014).

The closed tours were counted in 1997 by Brendan McKay: 13,267,364,410,532 of them, or 1,658,420,855,433 if tours that are rotations or reflections of each other count as one. An earlier count by Martin Löbbing and Ingo Wegener had given a different number, which was later found to be wrong.

Smaller boards

On a 5 × 5 board there are 1,728 tours counted the same way (from every start, both directions) and on 6 × 6, 6,637,920. Boards of 2 × 2, 3 × 3 and 4 × 4 have none. A closed tour needs more: by Schwenk’s theorem, an m × n board with m ≤ n has one unless m and n are both odd, m is 1, 2 or 4, or m is 3 and n is 4, 6 or 8. So the 8 × 8 board has closed tours and the 5 × 5 board has only open ones.

Warnsdorff’s rule

H. C. von Warnsdorff described in 1823 a simple way to find a tour: always jump to the square from which the knight would have the fewest onward jumps. Ties need a rule of their own; here they went to the first square in a fixed order of the eight jumps. Tried from all 64 squares and with the order turned eight ways, 512 attempts in all, the rule completed a tour 504 times, and 44 of those tours were closed. The tour above is the first closed one.

History

The earliest known reference to the knight’s tour is from the 9th century, in the Indian poet Rudrata’s Kavyalankara. Leonhard Euler was one of the first mathematicians to study it.

Questions people ask

Is a knight’s tour possible from any square?

Yes. A closed tour passes through every square, so it can be started from any of them; the one above can begin anywhere along its loop.

How do you find a knight’s tour by hand?

Use Warnsdorff’s rule: look ahead one jump and go where the knight would have the fewest ways on, saving the squares that are easy to reach for later.

What other puzzles use a chessboard?

The eight queens puzzle asks for eight queens that do not attack each other: there are 92 ways.

Sources