lpetrich
Contributor
I was recently given a cube-snake puzzle. It consists of 27 cubes that can rotate relative to each other. Some cubes have neighbors on opposite sides, while most of the others have neighbor at a 90-degree angle. Not surprisingly, two cubes have only one neighbor.
With the puzzle's arrangement of neighbors, there is only one solution to within rotations and reflections.
In the solution, the cubes form a 3*3*3 supercube, and their arrangement forms a "Hamiltonian path", named after 19th cy. mathematician William Rowan Hamilton, the discoverer of quaternions. He proposed an "icosian game", finding such a path among the vertices of a dodecahedron.
If a Hamiltonian path's ends are neighbors, then they can be connected to make a Hamiltonian cycle.
I decided to see how many different 3^3 cube snakes that one can construct. I wrote a brute-force searcher, and in about a minute of CPU time, I found 4960608 solutions, counting over all possible source and destination cubes. Splitting up by cube type, I found:
So there are a lot of possible 3^3 cube snakes.
With the puzzle's arrangement of neighbors, there is only one solution to within rotations and reflections.
In the solution, the cubes form a 3*3*3 supercube, and their arrangement forms a "Hamiltonian path", named after 19th cy. mathematician William Rowan Hamilton, the discoverer of quaternions. He proposed an "icosian game", finding such a path among the vertices of a dodecahedron.
If a Hamiltonian path's ends are neighbors, then they can be connected to make a Hamiltonian cycle.
I decided to see how many different 3^3 cube snakes that one can construct. I wrote a brute-force searcher, and in about a minute of CPU time, I found 4960608 solutions, counting over all possible source and destination cubes. Splitting up by cube type, I found:
- Vertex - neighboring vertex: 31164 - 12
- Vertex - across-face vertex: 36372 - 12
- Vertex - across-cube vertex: 38256 - 4
- Vertex - neighboring face: 21880 - 24
- Vertex - far face: 28708 - 24
- Face - neighboring face: 19668 - 12
- Face - opposite face: 22240 - 3
So there are a lot of possible 3^3 cube snakes.