The knight's perfect tour, challenge chess with linear optimization

Image by servet photograph retrieved from Unsplash

The Knight’s Tour is a classic mathematical and chess problem that consists of moving a knight on an $n \times n$ chessboard so that it visits each and every square exactly once.

There are two main variants of this problem:

  • Closed tour: The knight ends on a square that is one move away from the starting square, forming a complete cycle that could repeat indefinitely.
  • Open tour: The knight visits all squares, but the final square does not allow returning to the starting square in a single move.

This problem has fascinated mathematicians for centuries, from the celebrated Leonhard Euler in the 18th century to modern research in graph theory and Operations Research.

Do you dare to find a complete closed path before checking the solution and its mathematical modeling?


The Knight’s Tour can be formulated as a Traveling Salesperson Problem on a directed graph, do you dare to try it?


Want to keep exploring the world of Operations Research? Discover more posts on the topic here.




If you found this useful, please cite this as:

Martín-Campo, F. Javier (Jul 2026). The knight’s perfect tour, challenge chess with linear optimization. https://www.fjmartincampo.com/blog/2026/knightstour/.

or as a BibTeX entry:

@misc{martín-campo2026the-knight-s-perfect-tour-challenge-chess-with-linear-optimization,
  title   = {The knight's perfect tour, challenge chess with linear optimization},
  author  = {Martín-Campo, F. Javier},
  year    = {2026},
  month   = {Jul},
  url     = {https://www.fjmartincampo.com/blog/2026/knightstour/}
}

References

  1. JACM
    Integer Programming Formulation of Traveling Salesman Problems
    C. E. Miller, A. W. Tucker, and R. A. Zemlin
    Journal of the ACM, Oct 1960



Enjoy Reading This Article?

Here are some more articles you might like to read next:

  • A crime has been committed... in a sudoku!
  • The harmony of digits in solving Kakuro
  • Killer Sudoku, the empty board challenge that math can solve
  • Solving the Number Sums board using mathematical optimization
  • Building bridges with linear optimization, the Hashi puzzle