This solution
uses CLP(ℤ) constraints
to model the problem. In particular,
the circuit/1 constraint is used to describe a
Hamiltonian circuit of the following graph:
one node per board position
one edge between those nodes that can be reached via
knight's moves.
For example, in the case of a 6×6 board, the underlying
graph looks as follows:
Challenges: Find solutions for large boards. Find good labeling and
allocation strategies. ...
Exercise: Modify the code so that it describes knight's
tours that are not necessarily closed. Hint: Introduce a dummy
node from which a tour may start.