Skip to main content
4 of 10
added 127 characters in body
Jukka Kohonen
  • 4.2k
  • 2
  • 21
  • 49

Partial answer: It is possible for $C_n$ if $n$ is a power of two.

$C_2$ and $C_4$ are shown in the question. For larger $n$ the idea is to take a three-dimensional Moore curve (a recursive construction of a Hamiltonian circuit), and fix any straight-edge trouble locally.

By "recursive" I mean the construction breaks the cube into 8 subcubes, recursively, until the smallest cubest are $C_2$.

The key part is the "local fixing". Take a 3D Moore curve on $C_n$ (with $n=2^k$). Look at each of its $C_2$ subcubes. Each such subcube is entered at one corner, and exited at another corner, in some direction. If the path in the subcube turns properly (both immediately after entering, and also immediately before exiting), we are happy with that subcube. Otherwise, we rotate the path in the subcube so that it turns properly. This is a local fix that does not affect any other parts of the Hamiltonian circuit, and fixes any straight-edge trouble associated with that subcube. Do it for all offending subcubes and you are done.

The only remaining question is whether such rotation can always be done. In fact it can (will fill details here soon).

Examples

First, a Hamiltonian circuit on $C_8$ before and after fixing. On the left, red edges are defects (consecutive straight edges).

Hamiltonian circuits on C8

Then the same on $C_{16}$. Of course it is impossible to verify its correctness from the picture, but you get the idea, and the red edges again show the defects, which are fixed on the right.

Hamiltonian circuits on C16

Details: Recursive construction

First we need a 3D Moore curve (allowing straight-edge defects for the moment). From Wikipedia we learn that you just take eight smaller 3-dimensional Hilbert curves, "rotate them and connect them by line segments". Let's do that carefully. One way to actual do it is with 3-dimensional turtle graphics. We use the following primitives:

  • F = forward move one step
  • L = left turn
  • R = right turn
  • U = upward turn ("pitch" if you think of airplane movement)
  • D = downward turn
  • C = clockwise roll (again, think of an airplane rolling to the right, with nose direction not changing)
  • A = anticlockwise roll

Then define some auxiliary terms.

$R(2)$ is a "right-handed" Hamiltonian path on $C_2$. If you place the cube in front of you, you enter the front lower left corner, with your head up. You visit the 8 vertices, and when you exit, you are facing the opposite direction. This can be done with moves UFDFDFRFRFDFDFU.

$L(2)$ is the mirror image of the previous: You enter the cube at its front lower right corner. The moves are UFDFDFLFLFDFDFU.

$R(n)$ is a generic version where you enter a big cube ($n=2^k$ with $n\ge 4$) from the front lower left corner, facing forwards, and exit at front lower right corner, facing back. It is defined as 'C2RF 1LF L1F C2RF R2F A1LF L1F R2A', spaces are just filler for easier reading. If you plug in $R(2)$ for all occurrences of "1", and $L(2)$ for all occurrences of "2", you get a "right-handed" Hamiltonian path on $C_4$. Note that it is not a Hamiltonian circuit since entrance (left corner) and exit (right corner) are far apart.

$L(n)$ is the corresponding generic left-handed Hamiltonian path. The moves are 'A1LF 2RF R2F A1LF L1F C2RF R2F L1C'.

One more: $C(n)$ is a Hamiltonian circuit on a big cube ($C_n$). Its moves are '1LF A1LF L1F 1CRF RA1F 1LF L1F CL1 F'.

Now, for example, you get a circuit on $C_{16}$ by taking the string of $C(n)$, and plugging in $R(8)$ for each occurrence of "1", and $L(8)$ for each occurence of "2".

That gives you a Hamiltonian circuit, but it may have defects.

Fixing the defects

Actually, this is the easier part, but there are a few cases to consider. (Filling in the details soon...)

Jukka Kohonen
  • 4.2k
  • 2
  • 21
  • 49