On the generalization of the Tower of Hanoi graph

  • Lia Martins UFAM / IFAM
  • Jonas Costa UFAM
  • Rosiane de Freitas UFAM

Abstract


The classic Tower of Hanoi (ToH) puzzle consists of a base with three pegs P = p0, p1, p2 and a set of n discs D = {d1, d2, ..., dn} of different sizes, where di < dj if i < j. In the initial state, all disks are stacked on p0 in descending order of size, a perfect regular state. The objective of the game is to transfer all the discs to p2, in this same arrangement, obeying the following rules: (1) only one disc can be moved at a time, and always the disc at the top of one of the pegs; (2) the disc di can only be placed on dj if i < j. Hn is denoted as the ToH graph with n disks. Hn characterizes all possible regular states and the moves that can be made from one state to another. In this work, a recursive algorithm is presented which, starting from the base case H1 and a cycle C6, generates the ToH graph for any number of disks (Hn).

References

Poole, D. G. (1994). The towers and triangles of professor claus (or, pascal knows hanoi). Mathematics Magazine, 67(5):323–344.

Zhang, Z., Wu, S., Li, M., and Comellas, F. (2016). The number and degree distribution of spanning trees in the tower of hanoi graph. Theoretical Computer Science, 609:443–455.
Published
2024-07-21
MARTINS, Lia; COSTA, Jonas; FREITAS, Rosiane de. On the generalization of the Tower of Hanoi graph. In: PROCEEDINGS OF THE THEORY OF COMPUTATION MEETING (ETC), 9. , 2024, Brasília/DF. Anais [...]. Porto Alegre: Sociedade Brasileira de Computação, 2024 . p. 110-113. ISSN 2595-6116. DOI: https://doi.org/10.5753/etc.2024.3006.