graeco latin leaper tours on the torus |
here we enumerate graeco-latin tours of a torus-leaper on the n*n board.
A torus-(r,s)-leaper's tour is an n*n matrix a(0..n-1,0..n-1) containing
the numbers 0 to n*n-1 exactly once and consecutive numbers are a
(r,s)-leaper's move apart in the matrix, but the edges of the board wrap around to the other side :
so a(u,v)=1+a(x,y) implies {abs(u-x),abs(v-y)} is element of {{r,s},{n-r,s},{n-r,n-s},{r,n-s}}
Torus-leapers are somehow nicer and more mathematical than usual chess-pieces,
since they can move to 8 squares (or 4, if r=s) , no matter where they are.
We have n*n-fold translational symmetry and each square can be made
the upper left "corner" by isomorphism.
However it seems that they are not very common and I'd like to
see a reference, if you know where they have been examined.
A leaper's tour a(,) is called magic, iff all rows sum to n*(n*n-1)/2 and
all columns sum also to n*(n*n-1)/2 , the magic constant of the tour.
A (r,s)-leaper is a piece, which moves r squares into one of the 4 directions
and then with the same move s squares into an ortogonal direction.
So, e.g. a knight is a (1,2)-leaper
Each such matrix a(,) with entries from {0,..,n*n-1} gives two other new
n*n matrices a1(,) and a2(,) which contain the 1st and 2nd digit
respectively, when the entries of a(,) are writen in base n ,
a(i,j)=n*a1(i,j)+a2(i,j) .
A leaper tour a(,) is called "graeco latin tour" , iff
a1(,) and a2(,) are both latin squares and then they are ortogonal by construction.
A latin square contains each number in each row and column exactly once.
A graeco-latin tour is also a magic tour, of course.
Example of a 8*8 graeco-latin-torus-knight tour ( numbers are in base 8 ):
8- | 00 | 57 | 14 | 75 | 32 | 61 | 26 | 43 |
7- | 27 | 74 | 01 | 60 | 15 | 42 | 33 | 56 |
6- | 44 | 21 | 50 | 03 | 76 | 17 | 62 | 35 |
5- | 63 | 02 | 45 | 16 | 51 | 34 | 77 | 20 |
4- | 36 | 65 | 22 | 47 | 04 | 53 | 10 | 71 |
3- | 11 | 46 | 37 | 52 | 23 | 70 | 05 | 64 |
2- | 72 | 13 | 66 | 31 | 40 | 25 | 54 | 07 |
1- | 55 | 30 | 73 | 24 | 67 | 06 | 41 | 12 |
a | b | c | d | e | f | g | h | |
you can download the program latleap.exe : (C-source is attached to the executable)
latleap version 0.8
and run it with command-line-parameters n,r,s :
"latleap n t p r s"
fill in the desired values for n,r,s e.g. :
latleap 12 t p l 1 2
computes and prints all (graeco-) latin torus-knight-tours on 12*12,
output copied to file SOLUTION.TXT
Type latleap without parameters to get a short usage- instruction
if you run new ranges , please send the solution.txt file to
mailto:magictour@free.fr