On the Diameter of Tree Associahedra

We consider a natural notion of search trees on graphs, which we show is ubiquitous in various areas of discrete mathematics and computer science. Search trees on graphs can be modified by local operations called rotations, which generalize rotations in binary search trees. The rotation graph of search trees on a graph $G$ is the skeleton of a polytope called the graph associahedron of $G$. We consider the case where the graph $G$ is a tree. We construct a family of trees $G$ on $n$ vertices and pairs of search trees on $G$ such that the minimum number of rotations required to transform one search tree into the other is $\Omega (n\log n)$. This implies that the worst-case diameter of tree associahedra is $\Theta (n\log n)$, which answers a question from Thibault Manneville and Vincent Pilaud. The proof relies on a notion of projection of a search tree which may be of independent interest.


INTRODUCTION
Rotations in binary trees are simple local operations that exchange the levels of two nodes of the tree, and allow the transformation of any tree into any other tree. Using the classical bijection between binary trees and triangulations of a convex polygon, we can map rotations to flips in such triangulations, which consist of replacing an edge shared by two triangles by the other diagonal of the quadrilateral that they form. These operations give rise to rotation graphs on binary trees, or flip graphs on triangulations. In those graphs, the set of vertices is the set of trees (respectively, triangulations), and two of them are This work has received funding from the European Union's Horizon 2020 research and innovation programme under the Marie Skłodowska-Curie grant agreement No 734922. adjacent if and only if they differ by a single rotation (flip). These graphs are known to be skeletons of associahedra, or Stasheff polytopes, which appear in many contexts in discrete geometry and algebraic topology [30,29,17,7]. An illustration is given in Figure 1.
A well-known challenging question, to which a final answer has only been given recently, is that of the diameter of associahedra: the largest number of rotations needed to transform a binary tree into another [28,8,25]. In 1986, Sleator, Tarjan, and Thurston [28] established a tight bound of 2n´4 on the diameter of the n-dimensional associahedron, for large enough values of n, using notions from hyperbolic geometry. In 2014, Pournin [25] completely settled the question of the exact value of the diameter with a purely combinatorial method, proving that it was equal to 2n´4 for all n ě 9.
Carr and Devadoss [5,11] introduced graph associahedra, polytopes associated with graphs, that generalize associahedra, with a rich combinatorics related to Coxeter complexes and moduli spaces of curves. The usual associahedra are graph associahedra of paths, permutohedra are graph associahedra of complete graphs, and cyclohedra are graph associahedra of cycles. The diameter of cylohedra was recently studied by Pournin [26]. Graph properties of the skeletons of graph associahedra were investigated by Manneville and Pilaud [19]. They proved in particular that the diameter of the graph associahedron of a graph G is at least the number of edges of G, and at most quadratic in the number of vertices. They asked the following question: Does there exist a family of trees on n vertices such that the diameter of their associahedra is Ωpn log nq?
Our contribution is an affirmative answer to this question.
In Section 2, we give the definition of a search tree on a given graph G, which we show to be essentially equivalent to several other structures studied in various contexts. We also define the rotation operations in those trees, yielding a rotation graph that is the skeleton    of a graph associahedron. We then restrict our attention to the case where G is a tree and state the main result in Section 3. The proof of our lower bound on the diameter of tree associahedra is given in Section 4.

Search trees.
In what follows, all graphs are simple and undirected. We consider search trees on graphs, defined recursively as follows. Definition 1. Let G " pV, Eq be a connected graph. A search tree on G is a rooted tree T with vertex set V and root r P V . If |V | " 1, then T is the single vertex r. Otherwise, G´r is composed of some k ě 1 connected components. Then T is composed of the root r, connected to the roots of k search trees, one for each of the components.
An illustration of this definition is given in Figure 2. We also make use of the standard terminology on rooted trees. For each vertex v P V , the first neighbor of v on the path from v to r in T is called the parent of v. The other neighbors of v are called the children of v. The subtree rooted at v is the tree formed by v together with the subtrees of its children.
If G is a path on n vertices, then the search trees on G are exactly the binary search trees on n elements. If G is a complete graph on n vertices, then search trees on G are in one-to-one correspondence with permutations of the vertices of V .

Related structures.
Search trees on graphs as defined above are found in many disguises in the literature.
In polyhedral combinatorics, search trees are essentially equivalent to inclusionwise maximal tubings, as introduced by Carr and Devadoss [5]. In short, tubings on a graph G are collections of connected subgraphs of G, called tubes, such that every pair of tubes is either (i) nested or (ii) nonadjacent, that is, disjoint and such that their union is not connected. We obtain a one-to-one correspondence between search trees and inclusionwise maximal tubings by letting the tubes be induced by the set of vertices contained in the subtrees of a search tree. An example is given in Figure 2(c). Search trees are referred to as  spines by Manneville and Pilaud [19]. Tubings on G are faces of the graph associahedron of G. The vertices of the graph associahedron of G are inclusionwise maximal tubings. The edges of the graph associahedron connect pairs of maximal tubings that differ by exactly two tubes, or equivalently pairs of search trees that differ by a single rotation, as we describe below. An independent description of graph associahedra based on a related notion of graphical building sets was given by Postnikov [23]. Geometric realizations of graph associahedra have been described by Devadoss [11].
In combinatorial optimization, search trees can be identified under the terminology of vertex rankings [3]. Vertex rankings are colorings c : V Ñ rks such that for any pair of vertices u, v P V such that cpuq " cpvq, and for every path between u and v, there exists a vertex w on this path such that cpwq ą cpuq. The vertex ranking chromatic number of G is the smallest k such that G admits a k-ranking. We observe that every k-ranking of a connected graph G directly yields a search tree T of height k on G. Indeed, since G is connected, there cannot be more than one vertex r of color k. Pick r as the root of T , and recurse on the connected components of G´r. Conversely, every search tree can be interpreted as a vertex ranking. Computing optimal vertex rankings of arbitrary graphs is NP-hard [24]. However, they can be computed in linear time for trees [27], and in polynomial time for a number of other graph classes [10,1]. For arbitrary graphs, only an polynomial-time Oplog 2 nq-approximation algorithm is known [4]. An elegant connection between the performance ratio of online hitting set algorithms and vertex rankings has been established by Even and Smorodinsky [13].
In graph theory, the vertex ranking chromatic number is also known as the tree-depth. Connections with other classical structural parameters of graphs such as treewidth, pathwidth, and degeneracy, as well as the behavior of tree-depth with respect to minors and induced subgraphs have been studied extensively. We refer the reader to Nešetřil and Ossona de Mendez [21] for a comprehensive survey.
In algorithms, search trees have been studied from the data structure point of view. They provide a model of decision tree for search problems in which we wish to identify a hidden target vertex in a graph [18,22,12]. In this model, an oracle answers vertex queries: given a vertex v, it indicates the connected component of G´v containing the target vertex. The height of the search tree is the worst-case query complexity of the search. A linear-time algorithm for constructing worst-case optimal search trees on trees has been rediscovered by Mozes, Onak, and Weimann [20].

Rotations.
Consider two vertices u, v of a search tree T in a connected graph G such that v is a child of u. Let p be the parent of u in T , and letV be the set of vertices of the subtree of T rooted at u. We can obtain another tree T 1 from T by a rotation on u and v as follows: ‚ Make u a child of v, and make v a child of p. ‚ Every remaining subtree S of u in T remains a subtree of u in T 1 . ‚ For every subtree S of v in T , if u is adjacent to a vertex of S in G, then make S a subtree of u in T 1 ; otherwise, S remains a subtree of v in T 1 .
An example is given on Figure 3. Rotations in search trees are equivalent to flips in maximal tubings [19]. Two maximal tubings are connected by a flip if and only if they differ by exactly two tubes, see Figure 4. The rotation graph RpGq of G has the set of search trees on G as vertex set, and is such that two search trees are adjacent if and only if they differ by a single rotation. The rotation graph of G is the skeleton of the graph associahedron of G. The distance between two search trees in RpGq is referred to as the rotation distance. The diameter δpRpGqq of RpGq is the largest rotation distance between two search trees on G.

DIAMETER OF TREE ASSOCIAHEDRA
Manneville and Pilaud [19] showed that δpRpGqq is at least the number of edges of G. They also mention the following upper bound, for which we give a short proof.

Lemma 1.
Let G be a tree on n vertices. Then δpRpGqq " Opn log nq.
Proof. A classical result due to Camille Jordan [14] states that every tree has a vertex whose removal partitions the tree into connected components of size at most n{2 each. Iteratively picking such a vertex as the root of the search tree yields the so-called centroid decomposition of the tree, which has height Oplog nq. Every tree can be turned into the search tree implementing the centroid decomposition by first rotating the root up using at most n´1 rotations, then recursing on the subtrees. This yields an overall number of Manneville and Pilaud [19] posed the question of whether there exists a family of trees on n vertices such that the diameter of their rotation graph is Ωpn log nq. The question also appears in Ceballos et al. [6]. We answer this question in the affirmative. We also confirm their conjecture that this lower bound is attained when G is a complete binary tree. Together with Lemma 1, it yields the following result.  In order for this to be possible, we need to be able to project search trees, and rotation sequences on these search trees, on a subgraph of G. We show that there is a natural way to achieve this whenever G is a tree and the subgraph is connected.
As a preliminary step, let x be a leaf (a degree-one vertex) of a tree G " pV, Eq with |V | ą 1, and consider a search tree T on G. Let us show how to construct a search tree on G´x from T that can be interpreted as the projection of T on V ztxu. In the search tree T , the vertex x can be of three different types: (1) x has a parent but no child, (2) x has a parent and a single child, (3) x is the root of T . In the first case, x is also a leaf of T , and we can simply remove x from T . In the second case, we can replace the two edges between x and its parent and x and its child by a single edge between the parent and the child. In the third case we remove x from T and choose its child as the new root. The tree that is obtained after this operation is a search tree on G´x. We refer to this operation as pruning x from T .
A search tree on any connected subgraph GrSs can be constructed by iteratively pruning a leaf of G from T . We observe that given two leaves x, y of G, we can prune them in any order and get the same search tree on G´x´y. The sequence in which the leaves are pruned is called a vertex shelling order. It is known that vertex shelling orders form the basic words of an antimatroid [16,2], which are connected by adjacent transpositions. Hence the final tree that is obtained after a sequence of pruning only depends on the set of leaves that are pruned, and not on the specific order in which they are pruned. This leads to the following inductive definition, illustrated in Figure 5. (Projection of a search tree). Consider a tree G " pV, Eq and a search tree T on G. Let S Ď V be such that GrSs is connected. The projection T |S of T on S is the search tree on GrSs obtained as follows:

Definition 2
‚ If |V zS| " 1 then T |S is the result of pruning x from T , where x is the unique element of V zS. ‚ Otherwise, let x be any vertex of V zS adjacent to a vertex of S in G and let S 1 " S Y txu. Then T |S is the result of pruning x from T |S 1 .
We also observe the following property, which permits a more straightforward interpretation of the projection operation. Proof. Any connected component C of T rV zSs can be constructed, starting from the projection T |S, by iteratively performing the inverse operations of those in the pruning, that is, either (1) adding a leaf, (2) splitting a single edge into two edges, or (3) adding a new root node with a single child. No sequence of such operations can increase the number of vertices of V zS that have a neighbor in C above two. If the number of such vertices is equal to two, then the net effect of the pruning steps is to contract this component into a single edge. Otherwise, the component is simply removed.
We now consider rotation sequences, that is, sequences of rotation operations that can be applied starting with an initial tree T . ). Consider a tree G " pV, Eq, two search trees T and T 1 on G, and a rotation sequence π that transforms T into T 1 . Let S Ď V be such that GrSs is connected. Let the projection π|S of π on S be obtained from π by deleting every rotation on a pair u, v such that at least one of u, v lies in V zS. Then π|S is a rotation sequence that transforms T |S into T 1 |S.

Lemma 3 (Projection Lemma
Proof. By induction, it is sufficient to prove the result for a single rotation, and only in the case where S " V ztxu for some leaf x of G. Let T 1 be the result of performing a rotation on x in T . Since x is a leaf it must have at most one child in both T and T 1 , and pruning it from one tree or the other yields the same search tree T |S " T 1 |S. Similarly, let T 1 be the result of performing a rotation in T that does not involve x. Then the same rotation transforms T |S into T 1 |S.
Finally, our construction also relies on so-called bit-reversal permutations. These permutations play an important role in Fast Fourier Transform algorithms [15], but also in the analysis of performance of binary search trees [31,9]. We represent a permutation of n elements by a sequence of integers in t0, 1, . . . , n´1u, each appearing exactly once. Bit-reversal permutations get their name from the fact that they map each integer to the value obtained by reversing its binary representation.

Definition 3 (Bit-reversal permutations).
The bit-reversal permutation of parameter one is σ 1 " p0q. The bit-reversal permutation σ k of parameter k is defined by concatenating 2σ k´1 with 2σ k´1`1 .

Lemma 4.
There exists a family of trees tG n u on n vertices such that δpRpG n qq " Ωpn log nq.
Proof. Without loss of generality, we assume that n " 2 k´1 for some integer k ě 1. The family of trees G k " pV k , E k q is such that G 1 is a single vertex, and G k is composed of a single vertex connected to two subtrees isomorphic to G k´1 . Hence G k has the form of a complete binary tree. We label the :" pn`1q{2 " 2 k´1 leaves of the tree G k by the integers from 0 to ´1 in their order in an inorder traversal of an arbitrary plane embedding of G k .
We now construct two search trees T k and T 1 k on G k , such that the rotation distance between T and T 1 is Ωpn log nq. The first tree T k is isomorphic to G k . More precisely, let r be the unique vertex of degree two in G k . We first choose r as the root of T k . The remaining induced subgraph G k´r has two connected components isomorphic to G k´1 . Then we recursively choose the roots of the two subtrees in T k to be the vertices of degree two in each component, which are the two neighbors of r.
The tree T 1 k has the leaf labeled 0 as root, followed by the sequence of leaves of G k in order of the bit-reversal permutation σ k . Since those vertices are leaves of G k , they all have exactly one child in T 1 k . The last leaf is attached to the root of the remaining subgraph of G k , which retains the same shape as in T k . The trees T 4 and T 1 4 are illustrated on Figure 6. In what follows, we denote by f pkq the rotation distance between T k and T 1 k , with f p1q " 0. We consider a rotation sequence π of length f pkq that transforms T k into T 1 k . Let A and B denote the vertex sets of the two subtrees of the root r of T k . A rotation on u, v in π will be called an AA-rotation whenever both u and v belong to A. BB-rotations are defined similarly. AB-rotations are rotations on a pair of vertices such that one is in A and the other is in B.

Claim 1 (Splitting). The number of AA-rotations and the number of BB-rotations in π are
both at least f pk´1q.
Proof. By definitions of the projection of a search tree and of the bit-reversal permutations σ k , the pair of trees pT k |A, T 1 k |Aq is isomorphic to pT k´1 , T 1 k´1 q, in the sense that the bijections between the vertex sets of the trees in each pair are the same. An example with k " 4 is given on Figure 7. The sequence π|A contains exactly all the AA-rotations of π. By applying the projection Lemma on π with S " A, we know that the rotation sequence π|A transforms T k |A into T 1 k |A. Hence there is a rotation sequence of the same length transforming T k´1 into T 1 k´1 . Therefore, by definition of f , the sequence π|A must have length at least f pk´1q. The same holds for the number of BB-rotations, by replacing A by B.
Claim 2 (Merging). The number of AB-rotations in π is at least 2 k´2 .
Proof. Let us consider an arbitrary search tree T on G k and define its alternation number as the largest number of edges, on any path from the root to a leaf of T , with exactly one endpoint in A and one endpoint in B. We make the following two observations.
(1) An AB-rotation in T can increase its alternation number by at most two. To see this, note that a rotation on u and v can only change the number of alternations of the paths involving u or v, before or after the rotation. The net effect of a rotation on a path consists of either swapping the two vertices, removing one, or inserting one. Each of these changes modifies the alternation number by at most two.
(2) An AA or BB-rotation in T cannot increase its alternation number. Indeed, if the two vertices u, v on which the rotation is made are both A or B vertices, the number of alternations after removing one, inserting one, or swapping the two on a path leaves the alternation number unchanged.
We further observe that the alternation number of T k is 0, while the alternation number of T 1 k , by construction of the bit-reversal permutation σ k , is ´1. Altogether, this proves that the number of AB-rotations in π must be at least rp ´1q{2s " 2 k´2 .
Because the sets of AA, BB, and AB-rotations are disjoint, we obtain: f pkq ě 2f pk´1q`2 k´2 " Ωpk2 k q.