The Hanoi graphs and Sierpiński graphs both look like the Sierpiński triangle, and have a very similar recursive construction from triples of smaller graphs of the same type, but they are not quite the same graphs as each other. The Sierpiński graphs (left, below) are the graphs of the vertices and boundary edges of partially-constructed Sierpiński triangles; they can also be formed from three smaller Sierpiński graphs by identifying pairs of extreme vertices (the vertices of degree two at the three corners of the triangular layout). The Hanoi graphs (right, below) are the state spaces of the tower of Hanoi puzzle, in which rings of different size are moved one at a time between three pegs, only allowing moves that keep the rings sorted on each peg. They also have a construction from three smaller Hanoi graphs, but where the pairs of extreme vertices are connected by an edge rather than identified.

Hanoi graphs and Sierpiński graphs

The difference between them comes out much more strongly when you generalize them to higher dimensions. The Sierpiński triangle generalizes to tetrahedra (a popular shape for kites) and higher-dimensional simplices; the photo below shows Mabel Bell and Alexander Graham Bell, seemingly about to kiss, in a three-dimensional Sierpiński graph, the framework for a kite.

Mabel Bell and Alexander Graham Bell kissing in a Sierpiński tetrahedron kite frame, from https://commons.wikimedia.org/wiki/File:Alexander_Graham_Bell_facing_his_wife,_Mabel_Hubbard_Gardiner_Bell,_who_is_standing_in_a_tetrahedral_kite,_Baddeck,_Nova_Scotia.tif

Again, the -dimensional Sierpiński graph has a recursive construction from smaller graphs of the same type, identified at extreme vertices (the vertices of degree at the corners of the layout). Because the number of vertices separating the subgraphs at each level of the recursion is so small, these graphs have bounded treewidth, and a few years ago on the TCS stackexchange I calculated the treewidth of the Sierpiński triangle graphs explicitly as being four. The same bound transfers easily enough to the three-peg Hanoi graphs.

The analogue of higher dimensions for the Hanoi graphs is to use more pegs. The Hanoi graph with pegs and rings has states, more or less the same as the Sierpiński graph for -dimensional Sierpiński fractals with levels of recursion. Here’s the one with two rings; each state is described by a pair of letters, using a capital letter for the peg holding the larger ring and a lowercase letter for the peg holding the smaller ring.

Hanoi graph for two rings on four pegs

The recursive construction for these graphs combines copies of a smaller graph of the same type: one copy for each position where the largest ring can be placed, and a smaller graph describing the placements of the smaller rings once the largest ring has been placed. These copies of the smaller graph are connected together by edges describing the movements of the largest ring. But I’ve only drawn an example for two rings because these graphs get messy and hard to draw very quickly. The reason is not the exponential number of total vertices, but the large number of connections from one recursive subgraph to another. Two recursive subgraphs are connected whenever the largest ring can move from its peg in one subgraph to its peg in the other, and this is allowed whenever these two pegs have no smaller rings on them. So in a Hanoi graph with pegs, rings, and vertices, each pair of recursive subgraphs has edges between them, one for each placement of the smaller rings on the remaining pegs.

The recursive subdivision with edges between subgraphs leads to a tree-decomposition with treewidth , and this naturally raises the question of whether this is tight or whether some other less-intuitive recursive decomposition has smaller cuts between its recursive subgraphs. This is the question studied in my newest preprint, “On the treewidth of Hanoi graphs” (arXiv:2005.00179), with UCI student Daniel Frishberg and Oregon State student Will Maxwell, to appear at FUN 2020 (supposedly to be held in person in September in Italy after being rescheduled from June, but I’m not holding my breath). We don’t get a precise answer, but we succeed in proving bounds on the treewidth of the form . This is nearly tight for fixed and variable : we get the same exponential function of as the upper bound, and are smaller than the upper bound by only a much lower-order polynomial factor. But the exact treewidth remains elusive.

To put it in a possibly more familiar form, when one of these graphs (for a fixed number of pegs and variable number of rings) has vertices, it has separators of size , where . For the four-peg Hanoi graphs, this means separators of size , more or less the same as for planar graphs (although these graphs seem far from planar). But that nice exponent is just a coincidence caused by the fact that is a power of . For other choices of , that doesn’t happen and we get a transcendental exponent . So these graphs don’t even act like -dimensional graphs, for which a reasonable separator exponent might be the rational number . And they certainly don’t act like the Sierpiński graphs, for which the exponent is zero.

(Discuss on Mastodon)