Hanoi graph

From HandWiki
Short description: Pattern of states and moves in the Tower of Hanoi puzzle
The Hanoi graph [math]\displaystyle{ H^7_3 }[/math]

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 Hanoi graph [math]\displaystyle{ H^5_3 }[/math] (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 [math]\displaystyle{ n }[/math] disks on [math]\displaystyle{ k }[/math] towers is denoted [math]\displaystyle{ H^n_k }[/math].[1][2] Each state of the puzzle is determined by the choice of one tower for each disk, so the graph has [math]\displaystyle{ k^n }[/math] 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 [math]\displaystyle{ u }[/math] unoccupied towers, the number of allowable moves is

[math]\displaystyle{ \binom{k}{2}-\binom{u}{2}, }[/math]

which ranges from a maximum of [math]\displaystyle{ \tbinom{k}{2} }[/math] (when [math]\displaystyle{ u }[/math] is zero or one and [math]\displaystyle{ \tbinom{u}{2} }[/math] is zero) to [math]\displaystyle{ k-1 }[/math] (when all disks are on one tower and [math]\displaystyle{ u }[/math] is [math]\displaystyle{ k-1 }[/math]). Therefore, the degrees of the vertices in the Hanoi graph range from a maximum of [math]\displaystyle{ \tbinom{k}{2} }[/math] to a minimum of [math]\displaystyle{ k-1 }[/math]. The total number of edges is[3]

[math]\displaystyle{ \frac{1}{2}\binom{k}{2}\bigl(k^n-(k-2)^n\bigr). }[/math]

For [math]\displaystyle{ k=0 }[/math] (no disks) there is only one state of the puzzle and one vertex of the graph. For [math]\displaystyle{ k \gt 0 }[/math], the Hanoi graph [math]\displaystyle{ H^n_k }[/math] can be decomposed into [math]\displaystyle{ k }[/math] copies of the smaller Hanoi graph [math]\displaystyle{ H^{n-1}_k }[/math], 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

lang=cy|thumb|300px|[math]\displaystyle{ H^3 3 }[/math] with 12 edges deleted to yield a Hamiltonian cycle Every Hanoi graph contains a Hamiltonian cycle.[5]

The Hanoi graph [math]\displaystyle{ H^1_k }[/math] is a complete graph on [math]\displaystyle{ k }[/math] vertices. Because they contain complete graphs, all larger Hanoi graphs [math]\displaystyle{ H^n_k }[/math] require at least [math]\displaystyle{ k }[/math] colors in any graph coloring. They may be colored with exactly [math]\displaystyle{ k }[/math] colors by summing the indexes of the towers containing each disk, and using the sum modulo [math]\displaystyle{ k }[/math] as the color.[3]

Three towers

A particular case of the Hanoi graphs that has been well studied since the work of (Scorer Grundy)[1][6] is the case of the three-tower Hanoi graphs, [math]\displaystyle{ H^n_3 }[/math]. These graphs have 3n vertices (OEISA000244) and 3(3n − 1)/2 edges (OEISA029858).[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 [math]\displaystyle{ 2^{n}-1 }[/math].[2]

More than three towers

Question, Web Fundamentals.svg Unsolved problem in mathematics:
What is the diameter of the graphs [math]\displaystyle{ H^n_k }[/math] for [math]\displaystyle{ k \gt 3 }[/math]?
(more unsolved problems in mathematics)

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

See also

References

  1. 1.0 1.1 Hinz, Andreas M. (2018), "2.3 Hanoi Graphs", The tower of Hanoi—myths and maths (2nd ed.), Cham: Birkhäuser, p. 120, doi:10.1007/978-3-319-73779-9, ISBN 978-3-319-73778-2 
  2. 2.0 2.1 2.2 2.3 "2.2 Hanoi Graphs", Topics in Graph Theory: Graphs and their Cartesian Product, Wellesley, MA: A K Peters, 2008, pp. 13–15, ISBN 978-1-56881-429-2 
  3. 3.0 3.1 Arett, Danielle (2010), "Coloring and counting on the Tower of Hanoi graphs", Mathematics Magazine 83 (3): 200–209, doi:10.4169/002557010X494841 
  4. "Chapter 1: The Lion, the Llama, and the Lettuce", Another Fine Math You've Got Me Into, Mineola, NY: Dover Publications, 2003, ISBN 0-486-43181-9 
  5. 5.0 5.1 Hinz, Andreas M.; Parisse, Daniele (2002), "On the planarity of Hanoi graphs", Expositiones Mathematicae 20 (3): 263–268, doi:10.1016/S0723-0869(02)80023-8 
  6. Scorer, R. S. (July 1944), "Some binary games", The Mathematical Gazette 28 (280): 96, doi:10.2307/3606393 
  7. "Hanoi Graph". http://mathworld.wolfram.com/HanoiGraph.html.