TOPICS
Search

Trapped Knight


The trapped knight is a deterministic walk through lattice points (x,y) in Z^2 using a chess knight's moves without revisiting a lattice point. The allowed displacements are (+/-1,+/-2) and (+/-2,+/-1), with all four sign choices allowed in each pair.

Number the lattice points starting with 1 at the origin and continuing outward in a spiral. One convention uses the directions right, up, left, and down repeatedly, with successive run lengths 1, 1, 2, 2, 3, 3, .... Starting on 1, a greedy algorithm always chooses the unvisited lattice point with the smallest label among the legal moves. The labels visited begin 1, 10, 3, 6, 9, 4, 7, 2, 5, 8, ... (OEIS A316667).

The walk visits 2016 distinct lattice points, including the initial one. After 2015 moves it reaches label 2084, where all eight possible destinations have already been visited, so the walk ends.


See also

Greedy Algorithm, Knight Graph, Prime Spiral, Square Grid

Explore with Wolfram|Alpha

References

Numberphile. "The Trapped Knight." Jan. 24, 2019. https://www.youtube.com/watch?v=RGQe8waGJ4w.Sloane, N. J. A. Sequence A316667 in "The On-Line Encyclopedia of Integer Sequences."

Cite this as:

Weisstein, Eric W. "Trapped Knight." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/TrappedKnight.html

Subject classifications