Knight's tour using Warnsdorff's rule
Warnsdorff's rule is a heuristic for finding a single knight's tour. The knight is moved so that it always proceeds to the square from which the knight will have the fewest onward moves. When calculating the number of onward moves for each candidate square, we do not count moves that revisit any square already visited.
A knight's tour is not possible on a board smaller than 5 by 5. The code for this page allows you to increase the grid up to 80 by 80.
|You can put in a rectangular hole, and see if the heuristic will still work.
The hole must be at least 2 squares from any edge.
Rectangular hole, top left: (2 , 2)
width 0 , height 0