Knight's Tour

The Knight's Tour is a mathematical puzzle where the player must move a chess knight across a chessboard, visiting every square exactly once.

About Knight's Tour

The Knight's Tour is a mathematical puzzle where the player must move a chess knight across a chessboard, visiting every square exactly once. The knight moves in its standard L-shaped pattern: two squares in one direction and one square perpendicular (or vice versa). The challenge is to find a sequence of 64 moves (on a standard 8x8 board) that covers every square without revisiting any. A "closed tour" returns the knight to its starting square on the final move; an "open tour" ends on any square.

How to play Knight's Tour

Rules

  1. Place a knight on any square of the chessboard.
  2. Move the knight using standard chess knight moves: two squares in one direction (horizontal or vertical) and one square perpendicular, forming an "L" shape.
  3. Each square may be visited only once.
  4. The goal is to visit all 64 squares on a standard 8x8 board.
  5. A closed tour (also called a re-entrant tour) additionally requires that the final position is a knight's move away from the starting position, forming a complete loop.
  6. An open tour ends anywhere — the only requirement is that all squares are visited.

Strategies

  • Warnsdorff's Rule: Always move the knight to the square from which it will have the fewest onward moves (i.e., the square with the fewest unvisited neighbors). This greedy heuristic is remarkably effective and finds a valid tour on most board sizes without backtracking.
  • Start from a Corner: Corners have the fewest accessible squares (only 2 knight moves), making them difficult to reach later. Starting from or near a corner ensures you visit these constrained squares early.
  • Avoid the Center Early: Central squares have 8 possible knight moves, making them easy to visit later. Save them as "bridge" squares to connect different regions of the board.
  • Think in Quadrants: Mentally divide the board into four quadrants. Try to complete one quadrant before moving heavily into another, while maintaining connections between quadrants.
  • Backtracking: If you reach a dead end (no unvisited squares reachable), backtrack to the most recent decision point and try a different move. Systematic backtracking guarantees finding a solution if one exists.
  • Symmetry: For closed tours, solutions often exhibit rotational or reflective symmetry. Looking for symmetric patterns can guide your search.

Knight Move Reference

From any interior square, a knight can reach up to 8 squares. From edges, the number decreases:

  • Corner: 2 moves
  • Edge (non-corner): 3-4 moves
  • Interior adjacent to edge: 4-6 moves
  • Central: 8 moves
History of Knight's Tour

The Knight's Tour is one of the oldest and most studied problems in recreational mathematics, with roots stretching back over a thousand years. The earliest known reference appears in a Sanskrit work by the Kashmiri poet Rudrata around 840 CE, who described a knight's tour on a half-board (4x8) as a poetic form called "turagapadabandha" (verse of the knight's path), where syllables of a poem were arranged in the tour order.

The problem attracted the attention of major European mathematicians beginning in the 18th century. Leonhard Euler presented a detailed analysis to the Berlin Academy in 1759, describing systematic methods for constructing tours and proving various properties. Euler's work established the Knight's Tour as a legitimate mathematical problem rather than mere recreation. He showed how to construct closed tours and demonstrated a "divide and conquer" approach for large boards.

In the 19th century, H.C. von Warnsdorff published his famous heuristic rule in 1823: always move to the square with the fewest available onward moves. This rule is remarkably effective — it produces a valid tour on the first attempt for most starting positions on boards up to 76x76 and beyond. The mathematical analysis of why Warnsdorff's rule works so well remains an area of active research.

The Knight's Tour has deep connections to graph theory (it is equivalent to finding a Hamiltonian path on the knight's graph), computer science (used to teach backtracking algorithms and heuristic search), and even art (knight's tour patterns have been used in visual art and music composition). The number of distinct closed tours on an 8x8 board is approximately 26.5 trillion (26,534,728,821,064), computed by McKay in 1997. The problem continues to fascinate mathematicians, and new results about tours on non-standard boards (rectangular, toroidal, three-dimensional) are published regularly.