Hanoi graph explained
In graph theory and recreational mathematics, the Hanoi graphs are undirected graphs whose vertices represent the possible states of the Tower of Hanoi puzzle, and whose edges represent allowable moves between pairs of states.
Construction
The puzzle consists of a set of disks of different sizes, placed in increasing order of size on a fixed set of towers.The Hanoi graph for a puzzle with
disks on
towers is denoted
. Each state of the puzzle is determined by the choice of one tower for each disk, so the graph has
vertices.
In the moves of the puzzle, the smallest disk on one tower is moved either to an unoccupied tower or to a tower whose smallest disk is larger. If there are
unoccupied towers, the number of allowable moves is
\binom{k}{2}-\binom{u}{2},
which ranges from a maximum of
(when
is zero or one and
is zero)to
(when all disks are on one tower and
is
). Therefore, the
degrees of the vertices in the Hanoi graph range from a maximum of
to a minimum of
.The total number of edges is
\binom{k}{2}l(kn-(k-2)nr).
For
(no disks) there is only one state of the puzzle and one vertex of the graph.For
, the Hanoi graph
can be decomposed into
copies of the smaller Hanoi graph
, one for each placement of the largest disk. These copies are connected to each other only at states where the largest disk is free to move: it is the only disk in its tower, and some other tower is unoccupied.
General properties
lang=cy|thumb|300px|
with 12 edges deleted to yield a Hamiltonian cycleEvery Hanoi graph contains a
Hamiltonian cycle.
The Hanoi graph
is a
complete graph on
vertices. Because they contain complete graphs, all larger Hanoi graphs
require at least
colors in any
graph coloring. They may be colored with exactly
colors by summing the indexes of the towers containing each disk, and using the sum modulo
as the color.
Three towers
A particular case of the Hanoi graphs that has been well studied since the work of is the case of the three-tower Hanoi graphs,
. These graphs have
vertices and edges .
[1] They are
penny graphs (the
contact graphs of non-overlapping unit disks in the plane), with an arrangement of disks that resembles the
Sierpinski triangle. One way of constructing this arrangement is to arrange the numbers of
Pascal's triangle on the points of a
hexagonal lattice, with unit spacing, and place a unit disk on each point whose number is odd.The
diameter of these graphs, and the length of the solution to the standard form of the Tower of Hanoi puzzle (in which the disks all start on one tower and must all move to one other tower) is
.
More than three towers
For
, the structure of the Hanoi graphs is not as well understood, and the diameter of these graphs is unknown.When
and
or when
and
, these graphs are nonplanar.
See also
Notes and References
- Web site: Hanoi Graph.