Closed knight's tour (minimum board size)

2.5k Views Asked by At

I'm writing a small java program which calculates all possible knight's tours with the knight starting on a random field on a 5x5 board.

It works well, however, the program doesn't calculate any closed knight's tours which makes me wonder. Is there an error in the code, or are there simply no closed knight's tours on a 5x5 board?

If so, what is the minimum required board size for the existence of at least one closed knight's tour?

2

There are 2 best solutions below

4
On BEST ANSWER

No closed knight's tour is possible on a board with an odd number of squares, because each move changes the colour of the knight's square. So after an odd number of moves, you can't be back at the starting square, because it's the wrong colour.

3
On

The definition of a 'closed' knights tour on a $m \times n$board, is a sequence of steps from a starting square $a_1$ to another square $a_{mn}$ , such that every square is visited exactly once, and the last sqaure is only one knight step away from $a_1$. Having said that, it is obvious, that for $mn $(mod2) $= 1$, there exists no closed tour.

Short proof:

Suppose $a_1$ is black. Clearly then for any $i; i\le mn , i$(mod 2)$=1, a_i$ must be black. Since $mn$ is odd, $a_{mn}$ must be black, which implies that it cannot be a square one knight step away from $a_1$. Thus there exists no closed tour for odd $mn$.