The knight's tour is a problem of a knight visiting every square of a chessboard without revisiting any square; following the same movement rules it has while in a game of chess. An open knight's tour does not start where it began, as a closed tour would. This problem can be dated as far back as the 9th Century
This code creates an N*N chessboard and the knight then attempts to travel the full board, starting from (1,1). This algorithm brute forces, but the StepCheck function ensures that previously visited squares aren't chosen.
Martin Thomas (2021). Knight's Tour (https://www.mathworks.com/matlabcentral/fileexchange/73700-knight-s-tour), MATLAB Central File Exchange. Retrieved .
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!