Hanoi graph

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
File:Hanoi-Graph-7.svg
The Hanoi graph H37

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

[edit | edit source]
File:Sierpinski Pascal triangle.svg
The Hanoi graph H35 (black discs) derived from the odd values in Pascal's triangle

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 n disks on k towers is denoted Hkn.[1][2] Each state of the puzzle is determined by the choice of one tower for each disk, so the graph has kn vertices.[2]

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 u unoccupied towers, the number of allowable moves is

(k2)(u2),

which ranges from a maximum of (k2) (when u is zero or one and (u2) is zero) to k1 (when all disks are on one tower and u is k1). Therefore, the degrees of the vertices in the Hanoi graph range from a maximum of (k2) to a minimum of k1. The total number of edges is[3]

12(k2)(kn(k2)n).

For k=0 (no disks) there is only one state of the puzzle and one vertex of the graph. For k>0, the Hanoi graph Hkn can be decomposed into k copies of the smaller Hanoi graph Hkn1, 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.[4]

General properties

[edit | edit source]
File:Tower of hanoi graph.svg
H33 with 12 edges deleted to yield a Hamiltonian cycle

Every Hanoi graph contains a Hamiltonian cycle.[5]

The Hanoi graph Hk1 is a complete graph on k vertices. Because they contain complete graphs, all larger Hanoi graphs Hkn require at least k colors in any graph coloring. They may be colored with exactly k colors by summing the indexes of the towers containing each disk, and using the sum modulo k as the color.[3]

Three towers

[edit | edit source]

A particular case of the Hanoi graphs that has been well studied since the work of Scorer, Grundy & Smith (1944)[1][6] is the case of the three-tower Hanoi graphs, H3n. These graphs have 3n vertices ((sequence A000244 in the OEIS)) and 3(3n − 1)/2 edges ((sequence A029858 in the OEIS)).[7] 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 2n1.[2]

More than three towers

[edit | edit source]
Unsolved problem in mathematics
What is the diameter of the graphs Hkn for k>3?

For k>3, the structure of the Hanoi graphs is not as well understood, and the diameter of these graphs is unknown.[2] When k>4 and n>0 or when k=4 and n>2, these graphs are nonplanar.[5]

See also

[edit | edit source]

References

[edit | edit source]
  1. ^ a b Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  2. ^ a b c d Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  3. ^ a b Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  4. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  5. ^ a b Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  6. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  7. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).