On the treewidth of Hanoi graphs

The objective of the well-known Towers of Hanoi puzzle is to move a set of disks one at a time from one of a set of pegs to another, while keeping the disks sorted on each peg. We propose an adversarial variation in which the first player forbids a set of states in the puzzle, and the second player must then convert one randomly-selected state to another without passing through forbidden states. Analyzing this version raises the question of the treewidth of Hanoi graphs. We find this number exactly for three-peg puzzles and provide nearly-tight asymptotic bounds for larger numbers of pegs.


Introduction
The Towers of Hanoi puzzle is very well known (for a comprehensive treatment see [10]), but it loses its fun once its player learns the strategy. It has some number n of disks of distinct sizes, each with a central hole allowing it to be stacked on any of three pegs. The disks start all stacked on a single peg, sorted from largest at the bottom to smallest at the top. They must be moved one at a time until they are all on another peg, while at all times keeping the disks in sorted order on each peg. The optimal strategy is easy to follow: alternate between moving the smallest disk to a peg that was not its previous location, and moving another disk (the only one that can be moved). Once one learns how to do this, and that the strategy takes 2 n − 1 moves to execute [18], it becomes tedious rather than fun. The puzzle can be modified in several ways to make it more of an intellectual challenge and less of an exercise in not losing one's place. One of the most commonly studied variations involves using some number p of pegs that may be larger than three. Of course, one can ignore the extra pegs, but using them allows shorter solutions. An optimal solution for four pegs was given by Bousch in 2014 [5], but the best solution for larger numbers of pegs remains open. The Frame-Stewart algorithm solves these cases, but it is not known if it is optimal [20]. The length of an optimal solution, for starting and ending positions of the disks chosen to make this solution as long as possible, can be modeled graph-theoretically using a graph called the Hanoi graph, which we denote H n p . This graph is formed by constructing a vertex for each configuration of the game, and connecting two vertices with an edge when their configurations are connected by one legal move. The number of moves between the two farthest-apart positions is then the diameter of this graph. For three pegs, the diameter of H n 3 is 2 n − 1 (the traditional starting and ending positions are the farthest apart) but for p > 3 the diameter of H n p is unknown [13]. In this paper, we consider a different way of making the puzzle more difficult, by making it adversarial. In our version of the game, the first of two players selects a predetermined number of forbidden positions, that the second player cannot pass through. Then, the second player must solve a puzzle using the remaining positions. If that were all, then the first player could win by forbidding only a very small number of positions, the p − 1 positions one move away from the start position. To make the first player work harder, after the first player chooses the forbidden positions, we choose the start and end position randomly from among the positions in the game. We ask: How many positions must the first player forbid, in order to make this a fair game, one where both players have equal chances of being able to win?
We can model this problem graph-theoretically, as asking for the smallest number of vertices to remove from a Hanoi graph in order for the number of pairs of remaining vertices belonging within the same component as each other to be half the total number of pairs of vertices. The answer to the problem lies between the minimum size of a balanced vertex separator (Lemma 2) and (up to a constant factor of three) the minimum order of a recursive balanced vertex separator; the latter is equivalent, up to constant factors, to asking for the treewidth of H n p . (Technically, the treewidth can be larger than the recursive separator order by a logarithmic factor when this order is constant, but both are within constant factors of each other when the order is polynomial.) Treewidth is of interest to computer scientists as many NP-hard graph problems become fixed-parameter tractable on graphs with bounded treewidth [4].

New results and prior work
We conjecture that the treewidth of H n p is Θ((p − 2) n ). For p > 3 this bound is exponential, and we make progress towards this conjecture by proving that the treewidth is within a polynomial factor of this bound. More precisely we show an asymptotic upper bound of O((p − 2) n ) and an asymptotic lower bound of Ω(n −(p−1)/2 · (p − 2) n ). We increase the lower bound to Ω( 2 n n ) when p = 4. Moreover, we find the exact (constant) treewidth of H n 3 and of the closely-related Sierpínski graphs. Our results provide an answer to our motivating question on sizes of forbidden sets of positions, up to polynomial factors for four or more pegs and exactly for three pegs.
As a byproduct of our proof techniques, we observe a nearly linear asymptotic lower bound on the treewidth of the Kneser graph (Corollary 25). Harvey and Wood [12] showed a previous exact result for the treewidth of Kn(n, k) when n is at least quadratic in k. Another byproduct of our proof techniques gives a new lower bound on the treewidth of the tensor product G × H of two graphs G and H, when H is not bipartite. Eppstein and Havvaei [8] gave an upper bound on the treewidth of G × H; Brevšar and Spacapan [6] gave an analogous lower bound for edge connectivity; Kozawa et al. [14] gave lower bounds for the treewidth of the strong product and Cartesian product of graphs. move in the game consists of moving the top (smallest) disk on some peg A to another peg B, while preserving the constraint. At the beginning of the game, all n disks are on the first peg. The objective of the game is to obtain, through some sequence of legal moves, a state in which all n disks are on the last peg. Let p be the number of pegs. Traditionally, p = 3.
Formally, a configuration of the p-peg, n-disk Towers of Hanoi game is an n-tuple (p 1 , p 2 , . . . , p n ) where p i ∈ {1, 2, . . . , p}, describing the peg for each disk d i . We say two configurations (p 1 , p 2 , . . . , p n ) and (p 1 , p 2 , . . . , p n ) are compatible if a move from one configuration to the other is allowed. This happens exactly when the two configurations differ only in the value of a single coefficient p i , for which d i is the smallest disk having either of the two differing values. We call a configuration with each disk on the same peg a perfect state. The Hanoi graph H n p is a graph whose vertices are the configurations of the n-disk, p-peg Towers of Hanoi game, with an edge for each compatible pair of configurations. It has p n vertices and 1

Recursive balanced separators, treewidth, and havens
In this section we give a brief discussion of the concepts of recursive balanced separators, treewidth, and havens. Given When this holds we call X a c-separator. We say that G has a recursive balanced separator of order s, where s : N → N is a nondecreasing function, whenever either |V | ≤ 1, or we can find a balanced separator of size s(|V |) for G, and the resulting subgraphs A and B have recursive balanced separators of order s respectively. We abuse notation and refer to s(|V |) as s(G).
A tree decomposition of a graph G is a tree T whose nodes are sets of vertices in G called bags, such that the following conditions hold.
If two vertices are adjacent, then they share at least one bag. If a vertex v is in two bags A and B, then v is in every bag on the path from A to B in T . Every vertex in V (G) is in some bag. The width of a tree decomposition T is one less than the maximum size of a bag in T . The treewidth of a graph G, denoted tw(G), is the minimum width over all tree decompositions of G. The bags in the tree decomposition T induce vertex separators in G. Moreover, we can use the tree decomposition to find a recursive balanced separator for G. Hence, the treewidth of G is a measure of the minimum order of a recursive balanced separator for G. The following folklore lemma relates the order of a recursive balanced separator to the treewidth of a graph; see [9] and [17, Lemma 6.6].

Lemma 2.
Given a graph G, let f (G) be the minimum number of vertices that can be removed from f so that, if two random vertices of G are chosen, the probability that they are not removed and have a path between them is at most 1/2. Let c = 1/ √ 2, and let r(G) be the minimum size of a c-separator (not necessarily recursive) for G. Let s be the minimum order of a recursive c-separator for G. Then r(G) ≤ f (G) ≤ 3s(G).
Proof. If we remove a vertex set X with |X| = f (G), leaving probability less than 1/2 that two randomly-chosen vertices from G are connected, then the remaining subgraph cannot contain any connected component larger than |V (G)|/ √ 2. If it contains any connected component of size at least |V (G)|/2, then f separates that subgraph from the remaining vertices, and otherwise the remaining small subgraphs can be combined to give a separation between two subgraphs whose largest size is at most 2|V (G)|/3, better than c. Therefore, To show that f (G) ≤ 3s(G), find a recursive c-separator for G of order s; the separator X has the following three separators as subsets: a c-separator X for G resulting in two separated subgraphs, and c-separators Y and Z for each of the two separated subgraphs. |X| + |Y | + |Z| ≤ 3s(G). Removing X ∪ Y ∪ Z from G partitions the rest of G into subgraphs of size at most |V (G)|/2. No matter which of these subgraphs one of the randomly chosen two vertices belongs to, the probability that the other vertex belongs to the same component will be at most 1/2. Some of our results will bound the treewidth of graphs using havens, a mathematical formalization of an escape strategy for a robber in cop-and-robber pursuit-evasion games. In these games, a set of cops and a single robber are moving around on a given graph G. Initially the robber is placed at any vertex of the graphs, and none of the cops has been placed. In any move of the game, one of the cops can be removed from the graph, or a cop that has already been removed can be placed on any vertex of the graph. However, before the cop is placed, the robber (knowing where the cop will be placed) is allowed to move along any path in the graph that is free of other cops. The goal of the cops is to place a cop on the same vertex as the robber while simultaneously blocking all escape routes from that vertex, and the goal of the robber is to evade the cops forever. In these games, a haven of order k describes a strategy by which the robber can perpetually evade k cops, by specifying where the robber should move for each possible move by the cops. It is defined as a function φ, mapping each set of vertices X ⊆ V with |X| ≤ k to a nonempty connected component in G \ X, such that whenever X 1 ⊆ X 2 , φ(X 2 ) ⊆ φ(X 1 ). A robber following this strategy will move to any vertex of φ(X), where X denotes the set of vertices to be occupied by the cops at the end of the move. The mathematical properties of havens ensure that the robber can always reach one of these vertices by a cop-free path.
Returning again to our adversarial version of the Towers of Hanoi puzzle, the cops-androbber game is equivalent to a game in which the first player attempts to pin the second player to a state from which no legal move to any non-forbidden state is possible. The placement (or removal) of a cop is equivalent to the first player designating (or de-designating) a state as forbidden; an evasion strategy for a robber is equivalent to the existence of a legal move for the second player.
The existence of a haven in G yields a lower bound on the treewidth of G via the following lemma. [19]). A graph G has a haven of order greater than or equal to k if and only if tw(G) ≥ k − 1.

Three pegs
In this section we show that tw(H n 3 ) ≤ 4 for all n ≥ 1. We prove this by relating the three-peg Towers of Hanoi game and the Sierpínski triangle graphs, which we denote S n . S n has treewidth at least 3 for all n, as it contains a triangle, and (Lemma 4) it equals 4 for n > 4. Additionally, each Sierpínski triangle graph contains a smaller three-peg Hanoi graph as a minor, and vice versa. From this it will follow that tw(H n 3 ) = 4 for all sufficiently large n. For completeness we include a more detailed proof of the bounds on tw(S n ).
We define the Sierpínski triangle graphs, along with a planar embedding of them, inductively. The planar embedding will allow us to see the geometric similarity between the Sierpínski graphs and the three-peg Hanoi graphs. The first Sierpínski triangle, S 1 , is isomorphic to K 3 with a planar embedding of an equilateral triangle with unit length sides. The vertices of the triangle coincide with the vertices of K 3 .
Inductively, we assume S n−1 has a planar embedding whose outer face is embedded geometrically as an equilateral triangle. We label the vertices on the outer face of the triangle v , v r , v t which are the left, right, and top vertices, respectively. To construct S n from S n−1 we take three copies of S n−1 labeled S L n−1 , S R n−1 , S T n−1 for the left, right, and top triangles and make the following vertex identifications.
The resulting graph has a planar embedding whose outer face can again be embedded as a subdivided equilateral triangle. In S n the left, right, and top vertices of the outer face are contained in S L n−1 , S R n−1 , and S T n−1 respectively. As before we denote them as v , v r , and v t . Note that we can recursively decompose S n into a triangle and a trapezoid, from which the trapezoid further decomposes into two additional triangles. (Here, we only consider trapezoids whose long side is horizontal.) This recursive decomposition leads to the construction of a tree decomposition of S n . The six distinguished vertices v , v r , v t , v r , v t , and v rt define the bags of the tree decomposition at each level. The set {v t , v t , v rt , v , v r } lies on the perimeter of a triangle in this decomposition. We call a bag in the tree decomposition consisting of these vertices a triangular bag. On the other hand, the set {v t , v rt , v , v r , v r } lies on the perimeter of a trapezoid in the decomposition. We call a bag in the tree decomposition consisting of these vertices a trapezoidal bag. With this definition we are now ready give a proof of the fact that tw(S n ) = 4 for all n > 4.

Proof.
To prove the upper bound we construct a tree decomposition of S n out of the triangular and trapezoidal bags defined above. We take the triangular bag in S n to be the root of the tree decomposition, and recursively decompose S n into its triangular and trapezoidal subgraphs. A bag at depth k is either a triangular or trapezoidal bag from an S n−k subgraph. The children of a trapezoidal bag at depth k are the triangular bags corresponding to the two copies of S k−1 that make up the trapezoid. The children of a triangular bag at depth k are a trapezoidal and a triangular bag corresponding to the decomposition of S k into a trapezoid and triangle. Every edge of S n is contained in some triangle or trapezoid, and every triangle and trapezoid appear as a bag in the tree decomposition. For any vertex v in S n if v ∈ B 1 , B 2 where B 1 and B 2 are distinct bags there are two cases to consider. If B 1 is an ancestor of B 2 then v, by the construction of the bags, must be in every triangular or trapezoidal bag lying in between them. If there is no ancestry relationship, then v must lie in the intersection of the shapes defined by B 1 and B 2 . Hence, there is some triangle or trapezoid containing both B 1 and B 2 which is their least common ancestor in the tree decomposition. See Figure 2 for an illustration on S 3 .
To prove the lower bound it is sufficient to show that S n contains a subdivision of the octahedron graph when n > 4. The octahedron graph is a forbidden minor for treewidth 3 graphs [2]. See Figure 3 for an illustration. Next we give an inductive construction of the Hanoi graph H n 3 with 3 pegs and n disks. This construction is almost identical to that of S n , but instead of identifying vertices we connect the three copies of H n−1 3 with three edges. Recall that the vertices of H n 3 are configurations representing the game state, that is a vertex is an element of {1, 2, 3} n . We define H 1 3 to be K 3 with the same planar embedding as in the case of the Sierpínski triangle and denote the vertices as the 1-tuples (1), (2), (3). The cyclic ordering of the vertices does not affect our construction. By induction we assume H n−1 3 has a planar embedding whose outer face is an equilateral triangle such that the corners of the triangle are the configurations corresponding with the perfect states, and we denote these vertices We construct H n 3 out of the three H i 's and add the following edges.
We call these three edges the boundary edges. The boundary edges represent the legal moves obtained by moving the largest disk. It is clear from the construction that the resulting graph embeds into the plane as an equilateral triangle with the perfect states at the corners of the triangle. See Figure 4.

Proof.
To prove the lower bound we contract the boundary edges of H n 3 to create an S n -minor. Hence, 4 = tw(S n ) ≤ tw(H n 3 ) for n > 4. To get the inequality tw(H n 3 ) ≤ 4 we inductively construct an H n 3 -minor of S n+1 as follows. For the base case we can easily find a copy of K 3 in S 2 . Let G 1 , G 2 , G 3 be the three S n subgraphs used to construct S n+1 and let v i,j be the vertex shared by G i and G j . By the inductive hypothesis we assume each G i contains an H n−1 3 -minor which we denote by H i . We construct an H n 3 -minor in S n+1 by connecting the corresponding perfect states of H i and H j via a path containing v i,j for each i = j. These paths can be chosen to be vertex-disjoint, which proves the theorem. See Figure 5 for an illustration. The three-peg case is simple enough that we can analyze our forbidden-state version of the puzzle directly. If two states are forbidden, the only way to separate the remaining states is to separate one recursive subgraph of the same type from the rest of the graph. In terms of the original puzzle, the two forbidden states can be described by choosing a peg and a number k and forbidding the two states where the largest k disks are on the chosen peg and the remaining n − k disks are all on the same peg as each other (one of the other two pegs). The probability of a connection between two randomly-chosen states is maximized for k = 1, for which, for large n, the probability of a path between two randomly-chosen vertices becomes approximately (2/3) 2 + (1/3) 2 = 5/9. On the other hand, if three states are forbidden, it becomes possible to separate the state space into three equally-sized subgraphs by forbidding three of the six states in which the largest disk can move. For this selection, the probability of a path between two randomly-chosen vertices becomes 3(1/3) 2 = 1/3.

More pegs
We conjecture that the treewidth of the Hanoi graph H n p is Θ((p − 2) n ). By Lemma 1 the same bound would automatically apply to the recursive balanced separator orders of these graphs; by Lemma 2, this would imply an upper bound on the number of states to forbid to make the adversarial version of the Hanoi puzzle fair (f (G) in Lemma 2). In this section we make progress towards this conjecture by proving the asymptotic upper bound tw(H n p ) = O((p − 2) n ) and the asymptotic lower bound tw(H n p ) = Ω(n −(p−1)/2 · (p − 2) n ). We obtain the lower bound by proving that every balanced separator of H n p (recursive or otherwise) is of this asymptotic order. This lower bound then applies to f (G) in Lemma 2. Our bounds are almost tight, off only by the factor Θ(n (p−1)/2 ). We begin by proving the asymptotic upper bound, which we do by constructing a recursive balanced separator of the required order and applying Lemma 1. Proof. We can recursively decompose H n p into p vertex-disjoint copies of H n−1 p by considering the subgraphs induced by fixing the position of the largest disk in the configurations. We call a vertex a boundary vertex if in its configuration there is at least one peg occupied by no disks and the largest disk shares its peg with no other disks. These are the configurations in which the largest disk is free to move. The endpoints of edges between the H n−1 p subgraphs in our decomposition are the boundary vertices.
We compute the order of our recursive balanced separator by counting the number of boundary vertices. This is the number of ways to distribute n − 1 disks across p − 2 pegs, hence the size of the separator is To prove the asymptotic lower bound we construct a new graph related to H n p whose treewidth is easier to compute. We can specify the positions of a subset of disks in a Hanoi puzzle by a mapping ρ : [n] → [p] ∪ {∞}, where a finite value of ρ(i) specifies the peg containing disk d i and an infinite value means that disk d i is allowed to be placed on any peg that does not also contain a specified disk. We define the pegset induced by ρ to be the states consistent with this specification. More formally, a vertex v = (p 1 , p 2 , . . . , p n ) is in the pegset induced by ρ if and only if : If ρ(k) = ∞ we call d k frozen by ρ; further, if a peg p k is in the image of ρ we call p k frozen by ρ as well. Intuitively, a pegset is the result of freezing a set of disks onto a set of pegs and playing a Hanoi puzzle using only the remaining unfrozen disks and pegs. We are interested in pegsets that meet two additional properties: 3. exactly p − 3 elements of [p] have a non-empty inverse under ρ, and 4. for j ∈ [p] either |ρ −1 (j)| = n−1 p−2 or |ρ −1 (j)| = 0. We call such pegsets regular pegsets. Note that, because we still have three pegs unfrozen, and because the three-peg Hanoi graphs are connected, each regular pegset describes a connected subgraph of the Hanoi graph.
To make our analysis cleaner we assume that n ≡ 1 mod (p − 2), hence properties 3 and 4 imply that there are precisely n−1 p−2 + 1 unfrozen disks in a regular pegset. Note that this restriction on n does not change the overall asymptotic analysis for other values of n, as we can still lower-bound the treewidth for other n by rounding n down to a value with this restricted form.
Let I n p denote the graph whose vertices are the regular pegsets of H n p where two vertices share an edge if and only if the intersection of their corresponding pegsets is non-empty. We call I n p the pegset intersection graph of H n p . We characterize the adjacency condition in terms of frozen disks and pegs in Lemma 7.

if a disk is frozen by u but not by v, then the peg it is frozen on is not frozen by v, and 4. if a disk is frozen by v but not by u, then the peg it is frozen on is not frozen by u.
Proof. If u and v are adjacent in I n p then there exists some vertex w = (w 1 , w 2 , . . . , w n ) contained in both pegsets. By the definition of a regular pegset both u and v freeze n−1 p−2 disks evenly across p − 3 pegs and leave n−1 p−2 + 1 disks unfrozen. We will now show that each of the four claims follows from the adjacency of u and v.
1. Suppose for a contradiction that a disk d i is frozen to different pegs by u and v; then no configuration in u can equal a configuration in v since they differ at the ith component.
2. If u and v freeze the same set of pegs then a configuration in u cannot equal a configuration in v since they will differ on the components corresponding to frozen disks. Now, assume u freezes more than one peg left unfrozen by v. A vertex w in the intersection of u and v would have a configuration that matches both u and v on their frozen disks, but the total number of disks frozen by u and v is at least (p − 1) · n−1 p−2 ; then w has more than n disks, contradicting the fact that w is a valid configuration.
3. Let u freeze the disk d i onto the peg p k and assume v does not freeze d i . If v also freezes p k then v must freeze n−1 p−2 disks onto p k while leaving d i unfrozen, hence there is no configuration in v that places d i onto p k .
We are now ready to prove the converse. Let u and v be pegsets in I n p such that conditions 1 through 4 hold. Conditions 1 and 2 tell us that the configurations of u and v coincide with one another for (p − 4) · n−1 p−2 disks evenly distributed across p − 4 pegs. The remaining 2 · n−1 p−2 disks are left unfrozen by either u or v; call the set of these disks U . Conditions 3 and 4 ensure that we can choose a peg that is frozen by either u or v, but not both, and place n−1 p−2 of the disks in U onto this peg which yields a configuration shared by both u and v.
As a consequence of Lemma 7 we can describe how to traverse an edge from a pegset u to a pegset v in I n p by freezing and unfreezing disks. We place n−1 p−2 of the disks left unfrozen by u onto the peg frozen by v but left unfrozen by u. Then, we take the peg frozen by u and left unfrozen by v and unfreeze every disk on it.
The asymptotic lower bound on tw(H n p ) will be derived from an asymptotic lower bound on tw(I n p ). To compute the treewidth of I n p we first need to prove that it is vertex-transitive and compute its diameter.

Lemma 8. I n p is vertex-transitive.
Proof. We define a family of automorphisms φ i,j which swap the roles of d i and d j in some pegset. The lemma follows from the fact that we can transform a pegset u to any other pegset v by a sequence of swap operations. For any pegset u we define the image of u under φ i,j to be Let u and v be adjacent pegsets in I n p . By U u and U v we denote the sets of disks left unfrozen by u and v, respectively. By Lemma 7 there are pegs p u and p v such that u freezes disks onto p u but not p v , and v freezes disk onto p v but not p u . Further, traversing the edge from u to v is equivalent to placing n−1 p−2 disks from U u onto p k and treating the disks frozen to p u as unfrozen. If u and v are adjacent then φ i,j (u) and φ i,j (v) are also adjacent, since swapping the labels of two disks does not affect the traversal process. If φ i,j (u) and φ i,j (v) are adjacent then so are u and v, by the above and the fact that φ i,j = φ −1 i,j .

Lemma 9. The diameter of I n p is Θ(n).
Proof. Let u and v be pegsets in I n p . Let k = n−1 p−2 . If u and v do not freeze the same set of pegs, we can, by freezing and unfreezing disks, walk along a path in I n p of length depending only on p, to a configuration that does freeze the same set of pegs as v, and continue with the process below. Therefore, assume u and v do freeze the same set of pegs, and label this set of pegs in increasing order by index as Q = {q 1 , q 2 , . . . , q p−3 }. For i = 1, . . . , p − 3, let U i be the set of disks frozen on q i by u, and let V i be the set frozen on q i by v.
For all i = 1, . . . , p − 3, we iteratively transform u into v, one peg at a time. For a given peg q i , the process for transforming U i into V i is as follows. There are three cases: 1. There exists some disk d ∈ V i \ U i that is unfrozen by u, 2. There exists some disk d ∈ V i \ U i that is frozen on some other peg by u, In case 1, unfreeze q i , then freeze an arbitrary peg q l / ∈ Q, to obtain a new pegset w adjacent to the current pegset. Since each pegset leaves n−1 p−2 + 1 disks unfrozen, let the new pegset freeze onto q l all but one of the disks unfrozen by u. Let the omitted disk, d, be one in V i that is unfrozen by u. Choose some d ∈ U i \ V i (one exists since |U i | = |V i |), then unfreeze q l ; freeze onto q i the set (U i \ {d }) ∪ {d}, to obtain a new adjacent pegset where d is replaced by d.
Repeat this process until case 1 no longer applies, i.e. until every remaining d ∈ V i \ U i is frozen by u. Then (case 2) consider some such d. u does not freeze d on a peg q r to which this process has already been applied, since all such pegs now agree with v. Therefore, u freezes d on some peg q s to which the process has not yet been applied. Unfreeze q s and freeze an arbitrary unfrozen peg q l to obtain the next pegset in the process; when doing so, some unfrozen disk d remains unfrozen. Then again freeze q s , but omit d and instead freeze d onto q s . d is now unfrozen, and we proceed as in case 1. Repeat case 2 until case 3 applies.
Repeating the overall process for every peg gives a path from u to v of length O(n).
Lemmas 8 and 9 allow us to apply the following lemma due to Babai and Szegedy to obtain a lower bound of Ω( 1 n V (|I n p |)) on the vertex expansion of I n p .

Definition 10. The vertex expansion of a graph G is equal to
where ∂S is the union of the neighborhoods, in G \ S, of vertices in S. ). It follows that the treewidth of I n p is also bounded from below by Ω(

Lemma 11 (Babai and Szegedy [3]). Let G be a vertex-transitive graph. Then the vertex expansion of
We now count the number of pegsets in V (I n p ).

Lemma 13. The number of regular pegsets in
Proof. There are p p−3 ways to choose the frozen pegs. Each pegset divides the disks into p − 2 sets of (almost) equal size and there are n! ( n p−2 )!) p−2 ways to choose the sets. This is because there are n! ways to order the disks, but we only care about the ordering of the p − 2 partitions of the disks, hence we divide by  Next we show how to obtain a lower bound of tw(H n p ) from Corollary 14. Since we have a lower bound on the treewidth of I n p , Lemma 3 guarantees the existence of a haven of a useful order. The idea behind Lemma 15 is to take a haven of order Ω(n −(p−1)/2 · (p − 2) n ) in I n p and modify it to create a haven of the same order in H n p .
Proof. Let k = tw(I n p ) + 1 = Ω(n −(p−1)/2 · (p − 2) n ). By Lemma 3, I n p has a haven of order k. Call this haven φ. Recall that a haven describes an evasion strategy for a robber in a cops-and-robbers game. Intuitively, if a robber can evade the cops in I n p , the same robber can also evade the cops in H n p by playing only on states that belong to pegsets of I n p and by paying attention only to which of those pegsets are occupied by at least one cop. We formalize this strategy below by constructing a haven for H n p from φ. Because a cop moving in H n p may simultaneously occupy a constant number of pegsets in I n p , the order of the haven we construct is a constant factor smaller than that of φ.
Every vertex in I n p corresponds to a pegset; every pegset corresponds to a set of configurations in the Towers of Hanoi game. Each of these configurations corresponds to a vertex in H n p . Define the function f : P(V (H n p )) → P(V (I n p )), where for X ⊆ V (H n p ), f (X) is the set of vertices in I n p whose corresponding pegsets contain configurations in X. Define g : P(V (I n p )) → P(V (H n p )), such that for X ⊆ V (I n p ), g(X ) is the set of all configurations belonging to pegsets in X . Let g(X ) = ∅ if X = ∅.
For (1), to see that g(φ(f (X))) is connected in H n p \ X, consider any pair of configurations u, v ∈ g(φ(f (X))). u and v belong to pegsets a and b (respectively) in φ(f (X)). a has a path P to b in φ(f (X)), since φ(f (X)) is connected. Every vertex (pegset) w in this path corresponds to the set W = g(w) ⊆ g(φ(f (X))) of all configurations belonging to the pegset w. W ∩ X = ∅, or else by the definition of f , w would be in f (X), contradicting the fact that w ∈ φ(f (X)). Furthermore, W is connected, since it is isomorphic to H d 3 (where d < n). Also, every edge (w 1 , w 2 ) in P corresponds to a vertex w ∈ g(φ(f (X))) belonging to W 1 = g(w 1 ) and W 2 = g(w 2 ). Therefore, u has a path to v in H n p \ X, obtained by traversing an H d 3 copy W for every vertex w ∈ P , and moving between H d 3 copies W and W that intersect at a vertex in g(φ(f (X))) for every edge in P .
We have now proven the second theorem of the section. In Appendix A we prove a lower bound on the treewidth of four-peg Hanoi graphs that, while still separated by a polynomial factor from the upper bound, is tighter than the one above.

Conclusion
Theorem 16 and Theorem 17, together with Theorem 5 and Theorem 6, give nearly tight asymptotic bounds on the number of states, in the adversarial version of the Towers of Hanoi game we proposed in the introduction, that the first player must forbid in order to ensure better than even odds of defeating the second player. This raises additional questions. First, suppose the first player forbids enough states to separate the graph in a balanced way, but the second player is fortunate enough to have starting and ending positions in the same connected component. What is the optimal strategy for the second player, and how many moves will this strategy take? Must this strategy be formulated in graph-theoretic terms, or is there an algorithm that consists of moving the disks in an intuitive way? Theorem 17 (in Appendix A) improves the lower bound of Theorem 16 when p = 4; one question would be to see whether the technique in the proof of Theorem 17 could be adapted to deal more generally with the structure of pegset intersection graphs when p ≥ 4, yielding a bound of Ω( (p−2) n n ) in general when p ≥ 4. However, this still would not eliminate the asymptotic gap between our upper and lower bounds.
Since n−1 k = Θ( n k ) when 2k + 1 ≤ n ≤ 3k − 1, this upper bound does not imply sublinear treewidth. However, if in fact the treewidth is sublinear, and can be used to obtain a sublinear vertex separator in Ds(n) (defined in Appendix A), then combined with a proof of asymptotic tightness in Lemma 31 and Lemma 35, this would imply that tw(H n 4 ) is o(2 n ), proving that the upper bound in Theorem 6 is not tight. This would be surprising, as the family of separators given in Theorem 6 seems intuitively to target the "weakest" parts of the graph.
Another possible line of further research is whether the bound given in Lemma 33 is tight for the tensor product, and what can be said about other graph products. As stated in the introduction, Kozawa et al. [14] gave lower bounds for the Cartesian and strong products. Since the strong product of a graph has the same vertices as and a superset of the edges of the tensor product, our lower bound in Lemma 33 for the tensor product's treewidth immediately gives a lower bound on the treewidth of the strong product. However, Kozawa et al. [14] gave a stronger lower bound for the strong product. One question would be whether a comparable improvement over our bound can be proven for the tensor product.

A Four pegs
Theorems 6 and 16, together, give upper and lower bounds that differ by a polynomial factor in the number of disks of the Towers of Hanoi puzzle. Compared to the overall exponential size of the bound, this is a small gap, and it is tempting to try to close it further. The proof of Theorem 16 identifies the pegset intersection graph (I n p ) as a hard part of the graph to separate, and leverages the vertex-transitive structure of this graph.
However, there are many configurations in the game that are ignored by focusing on the I n p graph: namely, all configurations where the numbers of disks on the pegs are arbitrary, i.e., not constrained to be equal to n p−2 for p − 3 of the pegs. We broaden our analysis of pegsets to prove the main result of this section: We begin by generalizing the pegset intersection graph beyond regular pegsets.

Definition 18.
Let G n 4 be a graph whose vertices are the pegsets of H n 4 that freeze only one peg and that freeze at most n−1 2 disks onto that peg. In this graph, let vertices u and v be adjacent whenever the pegsets u and v freeze mutually disjoint sets of disks, and freeze them onto separate pegs.
Clearly I n 4 is an induced subgraph of G n 4 . We prove our improved bound by analyzing the relationship between G n 4 and the Kneser graph.
Definition 19 (Lovasz [15]). Let [n] = {1, . . . , n} be an indexing of the objects in an arbitrary set. The Kneser graph, denoted Kn(n, k), is the graph whose vertices correspond to the k-element subsets of [n], and whose edges are the pairs of vertices whose corresponding subsets are disjoint.
We restrict our attention to Kneser graphs that are connected, namely the graphs Kn(n, k) where n ≥ 2k + 1.
The condition on disjoint subsets in the definition of Kneser graphs is analogous to the condition on disjoint subsets of pegs in the definition of G n 4 . (In fact, for any given k ≤ n−1 2 , the pegsets that freeze exactly k disks induce as a subgraph of G n 4 the tensor product of Kn(n, k) with a 4-clique-see Definition 32.) However, G n 4 also includes a separate condition, of having different frozen pegs. An additional complication is that G n 4 allows sets of different sizes rather than only considering sets of a single size k. To account for all set sizes appropriately, we introduce a generalization of the Kneser graph: Definition 20. Let the disjoint subset graph, denoted Ds(n, r), be the graph whose vertices are identified with the subsets s ⊆ [n] with |s| ≤ r, and whose edges are the pairs of vertices whose corresponding subsets are disjoint.
For convenience, we let Ds(n) = Ds(n, n−1 2 ). Clearly |V (Ds(n))| ≈ 2 n−1 . Then V (G n 4 ) consists of four copies of V (Ds(n)), with pegsets u and v connected iff they are in different copies and they share an edge in Ds(n). In Lemma 21 we bound the treewidth of Ds(n), after which we will use the relationship between G n 4 and Ds(n) to prove Theorem 17.
We defer the formal proof of Lemma 21 to later but outline a proof sketch below. The idea of the proof is to observe that Ds(n) consists of n−1 2 Kneser graph "slices." We make observations analogous to those leading to Corollary 14: Kneser graphs are vertex-transitive (Remark 24) and have diameter O(n) (Lemma 22), implying that for all 0 ≤ k ≤ n−1 2 , tw(Kn(n, k)) = Ω( 1 n |V (Kn(n, k))|) (Corollary 25). Since |V (Ds(n))| = n−1 2 k=0 |V (Kn(n, k))|, Lemma 21 then follows if we can, intuitively, show that the Kneser slices are hard to separate from one another. We formalize this notion and show that it is true for most of the slices. The argument relies on the subset definitions of the Kneser graphs' vertices, and makes use of the Kruskal-Katona Theorem (Corollary 29). We prove that given a balanced vertex separator X for Ds(n), either: 1. X contains a large number of the vertices in Ds(n) (at least an Ω( 1 n ) factor), or 2. after removing X from Ds(n), there is still a large connected component in Ds(n), leading to a contradiction.
In the second case, we derive the contradiction as follows: we observe that after removing X from Ds(n), if case (1) does not hold, then most of the vertices of Ds(n) lie in Kneser slices that have large connected components, since their intersection with X contains too few vertices for a balanced separator. Call this set of Kneser slices K conn (X). We prove that every pair of subgraphs G k = Kn(n, k) and G l = Kn(n, l) in K conn (X) have large connected components A k and A l that share an edge. Therefore, these large connected components, together, form a large connected component in Ds(n) \ X, from which we derive the desired contradiction.
Finally, we use our lower bound on the treewidth of Ds(n) to derive a lower bound on the treewidth of G n 4 , and in turn on the treewidth of H n 4 . We obtain the former by proving a more general claim about the treewidth of the tensor product of two graphs, and the latter by a proof analogous to that of Lemma 15. We begin by showing the required lower bound on the treewidth of the Kneser graph. We use the following result of Valencia-Pabon and Vera: Lemma 22 (Valencia-Pabon and Vera [21]). If 1 ≤ k ≤ n−1 2 , then the diameter of Kn(n, k) is k−1 n−2k + 1.
Remark 23. When k ≤ n−1 2 , the diameter in Lemma 22 is O(n). The following fact about Kneser graphs is well known; it also follows from a straightforward adaptation of the proof of Lemma 8.
Combining Lemmas 11 and 22 with Remarks 23 and 24, and observing the relationship between vertex expansion, balanced separators, and treewidth (as we did in the proof of Lemma 12), gives the following corollary: Corollary 25. For all k such that 1 ≤ k ≤ n−1 2 , tw(Kn(n, k)) = Ω( 1 n |V (Kn(n, k))|), and for every constant c, the minimum size of a c-separator in Kn(n, k) is Ω( 1 n |V (Kn(n, k))|).
Before turning to the interfaces between the Kneser slices, we establish a threshold value such that most of the vertices of Ds(n) lie in Kn(n, k) slices with values of k exceeding this threshold. Restricting our attention (in Lemma 27) to these slices will allow us to prove the mutual connectedness of the large connected components in case (2). 2 . If f is the probability mass function of B(n, 1 2 ), then f (k) = 1 2 n n k . Let X be a random variable distributed according to B(n, p). By Chebyshev's inequality, Setting ε = In Lemma 30 we will prove the existence of the large connected component from which the contradiction is derived in case (2) of the discussion following the statement of Lemma 21.
To do so, we will use the following lemma: Lemma 27. Let ε > 0 be fixed. Suppose n−1 2 − ε √ n ≤ l < k ≤ n−1 2 , and let A k and A l be subsets, respectively, of the vertices in the Kn(n, k) and Kn(n, l) subgraphs of Ds(n). Suppose further that |A k | ≥ d|V (Kn(n, k))| and |A l | ≥ d|V (Kn(n, l))|, where d > 1 2 is a constant. Then, if n is sufficiently large, A k and A l share an edge.
The proof of Lemma 27 uses the Kruskal-Katona Theorem (Corollary 29), which provides a lower bound, given a collection F of k-element subsets of [n], on the number of l-element subsets of [n] that are subsets of sets in F. The following formulation of the Kruskal-Katona theorem is due to Lovász (Frankl gave a short proof): Theorem 28 (Kruskal-Katona Theorem [11], [16]). Let F be a family of k-element subsets of [n], and let E be the set of all k − 1-element subsets of sets in F. Then whenever |F| ≥ m k , |E| ≥ m k−1 .
Applying induction on l = k − 1, . . . , 1 to Theorem 28 implies the following corollary: Corollary 29. Let F be a family of k-element subsets of [n], and let E be the set of all l-element subsets of sets in F, where 1 ≤ l < k. Then whenever |F| ≥ m k , |E| ≥ m l .
Using Corollary 29, we prove Lemma 27: Proof. (Proof of Lemma 27) For every v ∈ V (Ds(n)), view v as the k-size subset with which it is identified, and let v be the set complement of v.