Diagonal/Non-diagonal Grid Filling

hv at crypt.org hv at crypt.org
Wed Mar 8 21:09:08 CET 2006


Earlier I wrote:
:Leroy Quet <qq-quet at mindspring.com> wrote:
::Here is a simple example showing that it is possible to fill a 
::(4n)-by-(4n) grid, starting at one of the 4 center squares, and moving 
::diagonally first then non-diagonally (and crossings are allowed).
::
::  45 44 37 36 29 28 21 20
::  43 46 35 38 27 30 19 22
::  42 47 34 39 26 31 18 23
::  48 41 40 33 32 25 24 17
::  49 56 57 64  1  8  9 16
::  55 50 63 58  7  2 15 10
::  54 51 62 59  6  3 14 11
::  52 53 60 61  4  5 12 13
::
::But is it possible to fill the (4n+2)-by-(4n+2) grid or the odd-by-odd 
::grid by starting in the (almost) center (crossings allowed, start with 
::either a diagonal or a non-diagonal move)?
[...]
:My code finds no solution for 5 x 5 starting either diagonally or
:orthogonally; trying 7 x 7 now.

Odd squares cannot be filled, wherever you start.

Colour the 2n+1 x 2n+1 square like a chessboard, with white squares
in the corners. Then there are 4n white squares around the outside
edge, each of which must either be a start/end point or connect to
one of the 4(n-1) white squares on the ring just inside the edge.

Since only 2 squares can be start/end points, there are never enough
squares available for the outside edge to connect to.

Hugo





More information about the SeqFan mailing list