Skip to main content
Springer logoLink to Springer
. 2025 Sep 5;87(10):145. doi: 10.1007/s11538-025-01522-1

The GFB Tree and Tree Imbalance Indices

Sean Cleary 1,#, Mareike Fischer 2,✉,#, Katherine St John 3,#
PMCID: PMC12413428  PMID: 40911217

Abstract

Tree balance plays an important role in various research areas in phylogenetics and computer science. Typically, it is measured with the help of a balance index or imbalance index. There are more than 25 such indices available, recently surveyed in a book by Fischer et al. They are used to rank rooted binary trees on a scale from the most balanced to the least balanced. We show that a wide range of subtree-size based measures satisfying concavity and monotonicity conditions are minimized by the complete or greedy from the bottom (GFB) tree and maximized by the caterpillar tree, yielding an infinitely large family of distinct new imbalance indices. Answering an open question from the literature, we show that one such established measure, the s^-shape statistic, has the GFB tree as its unique minimizer. We also provide an alternative characterization of GFB trees, showing that they are equivalent to complete trees, which arise in different contexts. We give asymptotic bounds on the expected s^-shape statistic under the uniform and Yule-Harding distributions of trees, and answer questions for the related Q-shape statistic as well.

Keywords: Tree balance, GFB tree, Phylogenetic tree, Yule model

Introduction

Trees are a canonical data structure, providing an efficient way to implement fundamental concepts such as dynamic sets as well as representing hierarchical and phylogenetic relationships between data (see Cormen et al. (2001) and Semple and Steel (2003)). Much of the power of the tree data structure relies on well-distributed branching that can yield tree height logarithmic in the total size of the tree, and result in efficient access, assuming a reasonable balance. The balance, or lack thereof, often affects the running time of algorithms, with many tree-based algorithms having significantly different times depending if they are very balanced (an element in a balanced, binary search tree on n leaves can be found in O(logn) time) or very imbalanced (the same search has O(n) time for the pectinate or caterpillar tree) (Cormen et al. 2001). There are many different measures suggested to assess balance, this fundamental property of trees, surveyed in Fischer et al. (2023). While similar in format, these indices can yield quite different rankings of trees, as illustrated in Figure 1. This figure compares the rankings of three different indices considered in the present manuscript (the s^-shape statistic, the Q-shape statistic and the Sackin index) as well as two other well-known indices, namely the popular Colless and total cophenetic indices for the case n=10.

Fig. 1.

Fig. 1

The rankings of all 98 tree shapes of size 10 with respect to the Sackin index, the s^-shape statistic, the Q-shape statistic, the Colless index, and the total cophenetic index (see Fischer et al. 2023 for a survey of indices). All indices rate the caterpillar tree shown in blue as extremely unbalanced, and the indices rank trees of intermediate balance in different orders. The sets of other minimal trees with respect to the other rankings contain the maximally balanced tree shown in green and/or the GFB tree shown in red (Color figure online)

When the number of leaves, n, is a power of 2, with n=2h for some h, all imbalance indices are minimal for the fully balanced tree and maximal for the caterpillar tree. For trees which are neither the fully balanced tree nor caterpillars, the values of each of these indices lie in the interval containing these extremes for that imbalance index.

We show a general result that applies to a broad range of tree imbalance indices. If a tree imbalance index function using subtree sizes satisfies some concavity and increasing conditions, the minimum value is achieved by “greedy from the bottom” (GFB) trees, as named in Fischer et al. (2023). We will show that these trees coincide with trees termed “complete trees” (Fill 1996), which have occurred in other contexts. The s^-shape statistic of Blum and François (2006) satisfies this property. The s^-shape statistic sums the logarithms of the subtree sizes across the tree, so for a rooted binary tree T, the s^-shape statistic is log(nv-1), where nv is the number of leaves in the subtree rooted at the internal node v. Blum and François (2006) note that once a normalizing constant has been removed, the s^-shape statistic corresponds to the logarithm of the probability of a tree in the uniform or equal rates model (ERM) for generating random trees (see Semple and Steel 2003, p. 29-30), and provides a strong tool rejecting the various tree models against the Yule-Harding or proportional to distinguished arrangements model (PDA) (see Kersting et al. 2025 and Section 2 of the present manuscript concerning probabilistic models of phylogenetic trees).

Our findings answer the open question of which trees, among all rooted binary trees of size n, minimize the s^-shape statistic as well as the question if there is an explicit formula for the minimum value of s^, both of which were posed in Fischer et al. (2023). We further analyze a related measure of tree balance, namely the Q-shape statistic, described by Fill (1996). Motivated by building binary search trees from random permutations, it can be recast as a close parallel to the s^-shape statistic. We discuss how his work shows the maximal and minimal tree shapes for this statistic and the moments for it under the uniform distribution. We consider the distribution of the relevant statistic under the Yule-Harding distribution as well. We describe many indices built from concave functions of subtree sizes as imbalance indices, in that they have maximal values on caterpillar trees and minimal values on GFB trees, which necessarily include fully balanced trees when the size is a power of two. We show that there are infinitely many distinct such indices.

The present manuscript is organized as follows: In Section 2, we present all definitions and notations needed throughout the manuscript. In Section 3, we state some known results from the literature which we will use to derive our results. Section 4 then contains all our results, which are structured as follows: Section 4.1 gives an overview of the minimizing properties of the GFB tree. The results of this subsection are used in Section 4.2 to show that both the s^-shape statistic and the Q-shape statistic belong to an infinitely large family of different imbalance indices. Section 4.3 then gives two explicit formulas for the minimum value both for s^ and Q, both of which are derived from the GFB tree. Finally, Section 4.4 derives some expected values for the s^-shape statistic, which also answers open questions posed in Fischer et al. (2023). We conclude with a brief discussion in Section 5.

Definitions

We outline the terminology used, following the standard notions from Fischer et al. (2023); King and Rosenberg (2021); Steel (2016).

Graph theoretical trees and phylogenetic trees

A rooted binary tree, or simply a tree, is a directed graph T=(V(T),E(T)) with vertex set V(T) and edge set E(T), containing precisely one vertex of in-degree 0, the root (denoted by ρ), such that for every vV(T) there exists a unique path from ρ to v, and such that all vertices have out-degree 0 or 2. In particular, the edges are directed away from the root. Nodes with out-degree 2 are internal nodes and nodes with out-degree 0 are leaf nodes or leaves. We use V˚(T) (or simply V˚) to denote the set of internal vertices of T and VL(T) to denote the set of leaves of T, respectively.

Tree balance is independent of any leaf labeling, but in phylogenetics, the leaf labeling plays an important role and is used when considering evolutionary models. A rooted binary phylogenetic X-tree T (or simply phylogenetic tree) is simply a tuple T=(T,ϕ), where T is a rooted binary tree and ϕ is a bijection from the set of leaves VL(T) to X. The (unlabeled) tree T is often referred to as the topology or tree shape of T and X is called the taxon set of T. We assume that the label sets are the numbers: X={1,,n}.

We consider two trees T and T as equal if they are isomorphic; that is, if there exists a mapping θ:V(T)V(T) such that for all u,vV(T) we have (u,v)E(T)(θ(u),θ(v))E(T) and with θ(ρ(T))=ρ(T). In particular, θ is a graph isomorphism which preserves the root position. We use BTn to denote the space (of isomorphism classes) of (rooted binary) trees with n leaves, which are unlabeled.

We use BTn to denote the space (of isomorphism classes) of rooted binary phylogenetic X-trees with |X|=n where the leaves are labeled. Moreover, we recall that |BT1|=1 and |BTn|=(2n-3)!!=(2n-3)(2n-5)1 for n2 (Semple and Steel 2003, Corollary 2.2.4).

Vertices and subtrees

We now define some properties of vertices and subtrees, which apply both for trees as well as phylogenetic trees. Throughout, for a given tree T, we denote the number of leaves by n, with n=|VL(T)|. In the special case of n=1, the tree consists of only one vertex, which is at the same time the root and its only leaf. The size of a tree T is defined as the number of leaf nodes and is sometimes also indicated as |T|.

Whenever there is a directed path P from a vertex u to a vertex v in T, we call u an ancestor of v and v a descendant of u. The depth δT(v) of a vertex v in T denotes the number of edges on the unique path P from the root ρ of T to v. If P consists of a single edge, u is the parent of v and v is the child of u. If two leaves u and v have the same parent w, u and v form a sibling pair or cherry, which we denote by [uv].

Every internal vertex v of T induces a pending subtree Tv, that is, the subtree of T which has v as its root and contains all descendants of v. The number of leaves of this subtree will be referred to as the size of Tv and will be denoted by nv. Note that nρ=n. An internal vertex u with children v and w is called balanced if |nv-nw|1. Finally, for a (phylogenetic) tree T, we denote its standard decomposition into its maximal pending subtrees (i.e., the subtrees rooted at the children of the root ρ of T) Ta and Tb by T=(Ta,Tb). Note that the height h(T) of a tree T is defined as h(T)=maxvV(T)δT(v); that is, the height of a tree coincides with the maximum depth of its vertices.

Special trees

We describe some trees which play important roles in tree balance. The first tree is the caterpillar tree, denoted by Tncat, which is a rooted binary tree with n leaves which either consists of only one vertex or it contains precisely one cherry (see Figure 2(a)).

Fig. 2.

Fig. 2

Three tree shapes on 10 leaves: (a) a caterpillar with s^-shape of i=29logi=log(9!)12.8, (b) a greedy from the bottom (GFB) tree with s^-shape of log(9·51·32)6.0, and (c) a maximally-balanced tree with s^-shape of log(9·42·22)6.4, with the middle GFB tree (b) being the unique minimizer for the s^-shape statistic among all trees with 10 leaves

In considering a tree of size 2h, the fully balanced tree of height h, Thfb, is the tree where every node has two children and all leaves have depth exactly h. Note that for n2 both maximal pending subtrees of a fully balanced tree are again fully balanced trees, and we have Thfb=Th-1fb,Th-1fb. The maximally balanced (MB) tree with n leaves, denoted by Tnmb, is the unique rooted binary tree with n leaves in which all internal vertices are balanced. Recursively, a rooted binary tree with n2 leaves is maximally balanced if its root is balanced and its two maximal pending subtrees are maximally balanced, with Inline graphic (see Figure 2(c)).

The greedy from the bottom (GFB) tree for n leaves, denoted by Tngfb, is a rooted binary tree with n leaves that results from greedily clustering trees of minimal sizes from an initial forest in the following manner. We start with a forest of n trees each consisting of a single vertex and proceed by successively joining two of the smallest remaining trees in the forest until the forest is resolved into a single tree, with the resulting tree of the shape depicted in Figure 2(b). Coronado et al. describe this construction in Coronado (2020, Algorithm 2).

The complete tree (as defined in Fill 1996) for n leaves, denoted by Tnc, is a rooted binary tree with n leaves that results from creating the fully balanced tree of size 2log2(n), the largest fully balanced tree with n leaves or fewer, ordering the leaves from the left to the right and then attaching sibling pairs on the leaves from left to right until a total of n leaves are obtained. We will show below that the complete tree coincides with the GFB tree for all sizes, cf. Lemma 3. In order to simplify notation, throughout we use the shorthand log instead of log2 whenever we refer to a base-2 logarithm.

Note that if n=2h, we have Tngfb=Thfb=Tnmb. The latter equality follows from the fact that in the case where the number of leaves is a power of 2, Thfb is the unique tree all of whose internal vertices have a balance value of zero. The first equality holds, because if n=2h, nmod2i0 for all i=0,,h-1 and during the greedy clustering procedure, every tree with 2i leaves clusters with another tree of 2i leaves for all i=0,,h-1. This process continues until the single remaining tree is the fully-balanced tree.

Tree shape statistics and (im)balance indices

We focus on tree imbalance indices. Following (Fischer et al. 2023), we call a function t:BTnR a tree shape statistic if t(T) depends only on the shape of T and not on the labeling of vertices or the lengths of edges. Such a tree shape statistic t is called an imbalance index if

  • the caterpillar tree Tncat is the unique tree maximizing t on BTn for all n1, and

  • the fully balanced tree Thfb is the unique tree minimizing t on BTn for all n=2h for natural h.

The choice of base for the logarithm only affects the following indices by a multiplicative factor, and so we presume base 2 for all evaluations below. We first focus on several well-known and frequently used tree imbalance indices that are defined in terms of leaf counts of subtrees:

Definition 1

Let TBTn.

  • Sackin index (cf. Fischer 2021; Fischer et al. 2023; Shao and Sokal 1990): S(T)=vV˚(T)nv.

  • s^-shape statistic (Blum and François 2006; Fischer et al. 2023): s^(T):=vV˚(T)log(nv-1)=logvV˚(T)(nv-1).

  • Q-shape statistic (related to Fill 1996): Q(T):=vV˚(T)log(nv)=logvV˚(T)nv.

Note that the logarithm base was originally not stated (Blum and François 2006), however, it is common to use base 2 in binary (phylogenetic) trees, and we follow this convention here just as the authors of Fischer et al. (2023). In fact, we only consider logarithms of base 2 here; this is not limited to Definition 1.

Moreover, while we are mainly concerned with two imbalance indices, the s^-shape statistic and the Q-shape statistic, we also consider broader families containing both indices. The Q-shape statistic is related to measures introduced by Fill (1996) and differs from the s^-shape statistic by a difference of one before taking the logarithms for each term in the product. Despite the similarity, the statistics yield different rankings (see Figures 1 and 6). Note that Fill (1996) uses Q(T) for the reciprocal of the quantity of which we are taking the logarithm, and defines Ln=-ln(Q(T)) for the negative of its natural logarithm. Ln(T) differs from how we choose to define the Q-shape statistic here in the base of logarithm, but we proceed as above to make the Q-shape statistic more closely parallel to the s^-shape statistic. Fill (1996) shows that the complete (GFB) tree minimizes the Q-shape statistic and the caterpillar tree maximizes it, and further computes the moments under the uniform distribution as well as the random permutation model. King and Rosenberg (2021) employ a parallel structure to Fill’s methods for similar results on the Sackin index.

Fig. 6.

Fig. 6

Ranking differences for the imbalance indices from product functions πc for nine different choices of c with c>-2. The x-axis represents indices for values c=-1.99,-1.5,-1,-0.5,0,0.5,1,1.5,2, and the y-axis shows the 98 rooted binary trees with 10 leaves. Each tree has an associated line showing how high (imbalanced) or low (balanced) it is ranked for the different choices of c, with the rankings of three trees (caterpillar, GFB, and maximally balanced) highlighted in bold (Color figure online)

Probabilistic models of phylogenetic trees

We consider two popular models of evolution: the Yule-Harding and the uniform models. The Yule-Harding model is a pure birth process in which species are born but do not go extinct. It is a forward process generating a tree T as follows. The process starts with a single vertex and, at each step, chooses a leaf uniformly at random from those present and subsequently replaces that leaf by a cherry. As soon as the desired number n of leaves is reached, leaf labels X={1,,n} are assigned uniformly at random to the leaves. The probability PY,n(T) of generating a phylogenetic X-tree T=(T,ϕ) under the Yule-Harding model is then given by Steel (2016, Proposition 3.2):

PY,n(T)=2n-1n!·vV˚(T)1nv-1. 1

The uniform model selects a phylogenetic X-tree uniformly at random from the set of all possible phylogenetic trees (Rosen 1978). As |BTn|=(2n-3)!! for every n1 (with the convention that (-1)!!=1; see, for instance, Semple and Steel (2003, Corollary 2.2.4)), the probability PU,n(T) of generating a phylogenetic X-tree T under the uniform model is thus given by

PU,n(T)=1(2n-3)!!. 2

Prior results

In order to investigate the GFB tree and its relevance for the s^-shape statistic more deeply, we use the following earlier results.

Lemma 1

(Lemma 5 in Coronado et al. 2020) If T=(Ta,Tb) is a GFB tree, then Ta and Tb are also GFB trees.

Note that recursively applying Lemma 1 to the maximum pending subtrees of T and again their maximum pending subtrees and so forth, we easily derive the following corollary.

Corollary 1

If T is a GFB tree and v is a vertex of T inducing the pending subtree Tv, then Tv is also a GFB tree.

The following proposition, which has been adapted from Proposition 5 in Coronado et al. (2020), characterizes the sizes of the maximal pending subtrees of GFB trees.

Proposition 1

(adapted from Proposition 5 in Coronado et al. (2020)) For n2, we let Tngfb=(Ta,Tb), where na and nb denote the sizes of Ta and Tb, respectively. Let n=log(n). Then, we have:

  1. If 2nn3·2n-1, then na=n-2n-1, nb=2n-1 and Tb=Tn-1fb.

  2. If 3·2n-1n<2n+1-1, then na=2n, nb=n-2n and Ta=Tnfb.

We mainly work with Inline graphic rather than n=log(n) to simplify some proofs later.

Corollary 2

For n2, we let Tngfb=(Ta,Tb), where na and nb denote the sizes of Ta and Tb, respectively. Let Inline graphic. Then, we have:

  1. If 2kn-1<n3·2kn-2, then na=n-2kn-2, nb=2kn-2 and Tb=Tkn-2fb.

  2. If 3·2kn-2n2kn, then na=2kn-1, nb=n-2kn-1 and Ta=Tkn-1fb.

Proof

For all cases in which n is not a power of 2, we have kn=n+1. For these cases, substituting n in Proposition 1 by kn-1 directly leads to the required claims.

So it only remains to consider the case in which n is a power of 2. Note that in this case, Inline graphic, so we have n=2n=2kn. Proposition 1 covers this case in Case 1, which says that na=n-2n-1 and nb=2n-1. Using na+nb=n and kn=n and n=2kn in this case, we get: na=n-2n-1=2kn-2kn-1=2kn-1 and nb=2n-1=2kn-1.

Corollary 2 covers this case in Case 2, which implies that na=2kn-1 and nb=2n-1=2kn-1.

Results

We show that the GFB tree plays a fundamental role for the s^-shape statistic, even more so than it does for other balance indices like the Sackin index, for which it is known to be contained in the set of minimal trees (cf. Fischer 2021; Fischer et al. 2023). Note that the GFB tree plays a similar role for other imbalance indices like the well-known Colless index, for which it is also known to be minimal ((Coronado et al. 2020; Fischer et al. 2023)). Figure 1 depicts the role of the GFB tree for various indices. Notably, there are indices like the so-called total cophenetic index, which do not assume their minimum values at the GFB tree, but at the MB tree instead (Mir et al. 2013), cf. Figure 1.

We now start to investigate the GFB tree further.

Minimizing properties of the GFB tree

The aim of this section is to show that Tngfb is the unique minimizer of all functions of the form Φf, which we define for any rooted binary tree T as follows:

Φf(T)=vV˚(T)f(nv),

where f is any strictly monotonically increasing and strictly concave function. Moreover, we will show that this implies that the GFB tree is the unique minimizer of the product function, which we define as follows:

πc(T)=vV˚(T)(nv+c),

where T is a rooted binary tree and cR>-2 is a constant. Note that the choice of c>-2 guarantees that nv+c>0 for all vV˚(T) (as the smallest pending subtree size is nv=2, when v is the parent of a cherry). The fact that all factors of the product function are strictly larger than 0 leads to meaningful properties of the product including the existence of the logarithm of the product function.

In Section 4.2, we will subsequently show that the above minimizing properties have significant implications on tree balance, as they lead to two new families of tree (im)balance indices, one of which can be shown to be a subfamily of the other one. Moreover, our results will lead to answers to open questions concerning existing imbalance indices.

We start with the following theorem, parts of which are based on the ideas of Fill (2021, Theorem 4).

Theorem 2

Let nN with n2 and let f:R2R a strictly monotonically increasing and strictly concave function. That is, we have f(n1)>f(n2) if and only if n1>n2, and we also have f(λx+(1-λ)y)>λf(x)+(1-λ)f(y) for all λ(0,1) and all x,yR2 with xy. We consider Φf(T)=vV˚(T)f(nv). Then, Tngfb is the unique tree in BTn minimizing Φf.

Proof

Towards a contradiction, we assume n is the smallest number where the minimizing tree is not the GFB tree. We let T be a rooted binary tree with n leaves minimizing Φf, such that T is not a GFB tree. Since there is only one tree when n=1, we can assume n>1.

By Lemma 1, the subtrees of a GFB tree are also GFB trees. T is by assumption not a GFB tree, so there will be at least two pending subtrees of T that would form a GFB tree but do not have a common parent in T. This is due to the fact that T, just like every rooted binary tree, can be obtained from clustering, starting with a forest of one-leaf trees and clustering two trees at a time until a single tree is obtained. We do this to build T by using the two smallest available trees at any point in time (just as in the GFB construction), until no such further clustering is possible. So there must be two trees which are present both in T and Tngfb, that have a common parent in Tngfb but do not in T. Let Ta and Tb be the smallest such subtrees of T.

We note that as all previous trees of Tngfb were also formed when building T, only two situations are possible:

  1. One of the two trees Ta, Tb, say Ta, is contained in T as a sibling tree to some tree Tc, and the other one, say Tb, is a sibling to a subtree of T containing the first tree, say Ta. This situation is depicted in Figure 3 at the left-hand side.

  2. The tree Ta is a sibling to some tree Tc not containing Tb, and Tb is a sibling to some tree Td not containing Ta. This situation is depicted in Figure 3 at the right-hand side.

We now consider these two cases separately.

Fig. 3.

Fig. 3

Top: Case 1 of the proof of Theorem 2. Here, Ta is a sibling of Tc in T, with size strictly larger than that of Tb, and Tb is a sibling of a subtree of T containing Ta. The highlighted path P contains all vertices whose induced subtree sizes change when subtrees Tb and Tc are swapped. The dotted edges and subtrees may or may not exist in T. Bottom: Case 2 of the proof of Theorem 2. Here, Ta is a sibling of Tc in T, with size strictly larger than that of Tb, but not containing Tb. Similarly, Tb is a sibling of Td in T, with size strictly larger than that of Ta, but not containing Ta. The highlighted paths P1 and P2 contain all vertices whose induced subtree sizes change when Tb and Tc or Ta and Td are swapped. The dotted edges and subtrees may or may not exist in T

  1. We start with Case 1 as depicted in Figure 3. We construct a new tree T as follows: T is like T, but the subtrees Tb and Tc are interchanged. We let P be the path highlighted in Figure 3, where P is the path containing all vertices v for which we have nv(T)nv(T), where nv(T) and nv(T) denote the induced subtree sizes of v in T and T, respectively. We note that for all vertices vV˚(T)\P we have nv(T)=nv(T), as these vertices’ subtree sizes are not affected by the subtree swap of Tb and Tc. This reasoning leads to the following observation:
    Φf(T)=Φf(T)-vPf(nv(T))-f(nv(T)-nc+nb), 3
    where nb and nc are the subtree sizes of Tb and Tc, respectively. Now, we know that nc>nb, because if nc<nb, the GFB algorithm would not have merged Ta and Tb (but Ta and Tc instead). Moreover, if we had nb=nc, then Tb and Tc would be isomorphic, as all steps prior to merging Ta and Tb worked in T in the same way as in Tngfb (by choice of (Ta,Tb) as the minimal subtree of Tngfb which could not be formed to build T). In this case, however, (Ta,Tb) would be isomorphic to (Ta,Tc) and thus be contained in T, a contradiction to our choice of Ta and Tb. Thus, nc>nb and therefore nv(T)-nc+nb<nv(T) for all vP. As f is strictly increasing, this implies that f(nv(T))>f(nv(T)-nc+nb). With Equation (3), this directly leads to:
    Φf(T)=Φf(T)-vPf(nv(T))-f(nv(T)-nc+nb)>0<Φf(T). 4
    Thus, we have Φf(T)<Φf(T), which contradicts the minimality of T and thus completes this case.
  2. Next, we let T be as depicted as Case 2 in Figure 3, with Ta a sibling to some tree Tc not containing Tb, and Tb a sibling to some tree Td not containing Ta. We now construct two trees T and T as follows: T is like T, but subtrees Tb and Tc are swapped. Similarly, T is like T, but subtrees Ta and Td are swapped. We denote by na, nb, nc and nd the number of leaves in Ta, Tb, Tc and Td, respectively. As in the first case, we necessarily have nd>na and nc>nb by choice of Ta and Tb. We let T1,,Tk be the subtrees pending on path P1 as depicted in Figure 3 if these subtrees exist in T. Similarly, we let T^1,,T^l be the subtrees pending on path P2 as depicted in Figure 3 if these subtrees exist in T. We denote by ni the number of leaves in Ti for i=1,,,k, and by n^i the number of leaves in T^i for i=1,,l. Moreover, we define n0=n^0=0. With these definitions, we can now introduce variables ti and t^i defined as follows: ti=j=0inj for i=0,,k and t^i=j=0in^j for i=0,,l.
    • We enumerate the vertices of P1 such that v0 is the parent of Ta and Tc in T and such that vi is the parent of vi-1 for each i=1,,k if k>0; that is, if trees T1,,Tk exist in T. Then, for the subtree sizes nvi we derive:
      • nvi(T)=na+nc+ti for i=0,,k,
      • nvi(T)=na+nb+ti for i=0,,k,
      • nvi(T)=nc+nd+ti for i=0,,k.
    • Similarly, we enumerate the vertices of P2 such that w0 is the parent of Tb and Td in T and such that wi is the parent of wi-1 for each i=1,,l if l>0; that is, if trees T^1,,T^l exist in T. Then, for the subtree sizes nwi we derive:
      • nwi(T)=nb+nd+t^i for i=0,,l,
      • nwi(T)=nc+nd+t^i for i=0,,l,
      • nwi(T)=na+nb+t^i for i=0,,l.
    We now set λ=nd-nand-na+nc-nb. Since we have nd>na and nc>nb, we have λ(0,1). We now show that this choice of λ has two additional properties, which will be useful regarding the concavity of f:
    • We have nb+nd+t^i=λ(nc+nd+t^i)+(1-λ)(na+nb+t^i) for all i=0,,l:
      λ(nc+nd+t^i)+(1-λ)(na+nb+t^i)=λnc+λnd-λna-λnb+na+nb+t^i=na+nb+t^i+λ(nd-na+nc-nb)=na+nb+t^i+nd-nand-na+nc-nb(nd-na+nc-nb)=na+nb+t^i+nd-na=nb+nd+t^i.
    • Analogously, we have na+nc+ti=λ(na+nb+ti)+(1-λ)(nc+nd+ti) for all i=0,,k.
    The first one of these two points above shows that there exists λ(0,1) with nb+nd+t^i=λ(nc+nd+t^i)+(1-λ)(na+nb+t^i), so that we have for all i=0,,l:
    f(nb+nd+t^i)=f(λ(nc+nd+t^i)+(1-λ)(na+nb+t^i))>λf(nc+nd+t^i)+(1-λ)f(na+nb+t^i), 5
    where the inequality holds due to the strict concavity of f. Analogously, by the second point, we have for all i=0,,k:
    f(na+nc+ti)=f(λ(na+nb+ti)+(1-λ)(nc+nd+ti))>λf(na+nb+ti)+(1-λ)f(nc+nd+ti). 6
    Now we are finally in a position to derive a contradiction, namely by investigating the term Φf(T)-λΦf(T)-(1-λ)Φf(T) in two different ways.
    1. By assumption, T is a minimizer of Φf, so we have that Φf(T)Φf(T) as well as Φf(T)Φf(T). Thus:
      Φf(T)-λΦf(T)-(1-λ)Φf(T)Φf(T)-λΦf(T)-(1-λ)Φf(T)=0. 7
    2. We now split the sum of Φf(T)=vV˚(T)f(nv) into three partial sums, namely the inner vertices belonging to P1, the ones belonging to P2 and the ones belonging to neither one of the paths. Note that as all vertices that are not contained in any one of the paths are not affected by the swaps leading from T to T or T, respectively, the last sum is the same for Φf(T), Φf(T) and Φf(T). From our above observations concerning the subtree sizes nvi of P1 and nwi of P2, we derive:
      Φf(T)-λΦf(T)-(1-λ)Φf(T)=vP1f(nv(T))+vP2f(nv(T))+vV˚\{P1,P2}f(nv(T))-λ·vP1f(nv(T))-λ·vP2f(nv(T))-λ·vV˚\{P1,P2}f(nv(T))-(1-λ)·vP1f(nv(T))-(1-λ)·vP2f(nv(T))-(1-λ)·vV˚\{P1,P2}f(nv(T)) 8
      =i=0kf(na+nc+ti)-λf(na+nb+ti)-(1-λ)f(nc+nd+ti)>0byEq.(6)+i=0lf(nb+nd+t^i)-λf(nc+nd+t^i)-(1-λ)f(na+nb+t^i)>0byEq.(5)>0. 9
      The obvious contradiction between Inequalities (7), which states that Φf(T)-λΦf(T)-(1-λ)Φf(T)0 and (9), which states that Φf(T)-λΦf(T)-(1-λ)Φf(T)>0, shows that our assumption concerning the existence of T must have been wrong. In fact, this contradiction shows that at least one of the two trees T and T must have a lower Φf value than T. This completes the proof and thus shows that Tngfb is the unique tree minimizing Φf.

Before we investigate the implications of Theorem 2 on imbalance indices, we derive the following corollary.

Corollary 3

Let nN, n2 and let cR with c>-2. Let f:R2R be a strictly increasing function. Then, we have that Tngfb is the unique minimizer of f(πc(T)) among all rooted binary trees T with n leaves, where πc(T)=vV˚(T)(nv+c). In particular, this holds for the identity function, f(x)=x for all xR2.

Proof

We start with considering the product function πc. We let c and n be as described in the corollary. We have nv2 for all inner nodes v of a rooted binary tree T, as the smallest possible subtree size is 2 (which is the case in which v is the parent of a cherry). Thus, we have nv+c>0 for all vV˚, as c>-2 by assumption. This, however, means that all factors in πc(T) are strictly larger than 0, which shows that πc(T)>0. This, in turn, means that log(πc(T)) is defined.

Now we consider this term further:

log(πc(T))=logvV˚(T)(nv+c)=vV˚(T)log(nv+c).

As the logarithm is strictly concave and strictly monotonically increasing, we know by Theorem 2 that the latter sum is uniquely minimized by Tngfb. Thus, the same applies to log(πc(T)). However, by the strict monotonicity of log, the minimum of log(πc(T)) is reached precisely when the minimum of πc(T) is reached, which shows that Tngfb is also the unique tree minimizing πc(T).

Now, for any strictly increasing function f:R2R, we have that Tngfb is also the unique minimizer of f(πc(T)) due to the monotonicity of f. This completes the proof.

Implications of the extremal GFB properties on measures of tree balance

The main aim of this section is two-fold: First, we want to show that both functions Φf and πc as defined in the previous section form families of imbalance indices for certain choices of f and c, respectively. We will continue to show that the imbalance index family based on the product function and a constant c is merely a subfamily of the imbalance index family based on strictly increasing and strictly concave functions f.

Then, we want to use our findings to characterize all trees minimizing the s^-shape and Q-shape statistics, thus answering several open questions from Fischer et al. (2023).

However, in order to show that a function is an imbalance index, analyzing the minimum as in the previous section is not sufficient. Instead, we also need to investigate the caterpillar in order to investigate the maximum. We start with Φf. Note that the following theorem can already be found in Hamann (2023, Theorem 4.7), albeit with a different proof.

Theorem 3

Let nN, n2 and let f:R2R be strictly monotonically increasing, with f(n1)>f(n2) if and only if n1>n2. We consider Φf(T)=vV˚(T)f(nv). Then, Tncat is the unique tree maximizing Φf.

Proof

We prove the statement by contradiction. We suppose that there is a non-caterpillar tree T maximizing Φf. We choose the smallest possible n for which such a tree T with n leaves exists. Thus, for all numbers smaller than n, the unique maximizer of Φf is the caterpillar. In particular, this shows that n4, because for any value smaller than 4, there is only one rooted binary tree.

We let T=(T1,T2) be the standard decomposition of T. Then, Φf(T)=Φf(T1)+Φf(T2)+f(n), where the last summand f(n) results from the root ρ of T. This equality shows that T can only maximize Φf among all trees with n leaves if T1 and T2 maximize Φf among all trees with n1 and n2 leaves, respectively, where n1 is the number of leaves of T1 and n2 is the number of leaves of T2. Thus, as we chose T to be a counterexample of minimal size concerning the statement of the theorem, we know by assumption that T1 and T2 must be caterpillars. Note that this implies that n12 and n22 (which is possible as n1+n2=n4), because if we had n2=1 and T1 is a caterpillar, then T would be a caterpillar also. The same would happen if n1=1.

Thus, we know that, as T1 and T2 are caterpillars with at least two leaves each, each of them has precisely one cherry. Let [a1,b1] denote the cherry of T1 and [a2,b2] denote the cherry of T2. The parents of [a1,b1] and [a2,b2] are denoted by v0 and w0, respectively. Note that on the path from v0 to the root ρ of T, there might be more vertices v1,,vk, all of which – if they exist – are adjacent to a leaf as T1 is a caterpillar. Analogously, there might be more vertices w1,,wl on the path from w0 to ρ, all of which – if they exist – are adjacent to a leaf as T2 is a caterpillar. Note that this means that T looks as depicted on the left-hand side of Figure 4. We denote the leaves adjacent to vi with xi for i=1,,k (if they exist), and the leaves adjacent to wi with yi for i=1,,l (if they exist).

Fig. 4.

Fig. 4

Trees T and T as described in the proof of Theorem 3. The only differences between the subtree sizes are at nodes wl and vk+1, highlighted with a box

Now we assume without loss of generality that kl and consider wl (note that l might be 0) and consider a leaf zl adjacent to wl (note that zl might be either a2 or b2 if l=0; otherwise we have zl=yl). We now create a tree T by deleting edge (wl,zl), subdividing edge (ρ,vk) by introducing a new degree-2 vertex vk+1 and then adding a new edge (vk+1,zl) and suppressing wl. The resulting tree T is depicted on the right-hand side of Figure 4. Note that between T and T, all subtree sizes are equal except for that of vk+1, which equals k+3 in T as above but does not exist in T, and that of wl, which equals l+2 (stemming from the fact that wl is ancestral to a2, b2 and y1,,yl if the latter leaves exist). Thus, we derive for Φf(T):

Φf(T)=Φf(T)+f(k+3)-f(l+2),

which immediately shows that Φf(T)>Φf(T), as we assumed that kl. This contradicts the maximality of T and thus completes the proof.

The maximality of the caterpillar now immediately leads to the following corollary, which shows that each Φf is indeed an imbalance index.

Corollary 4

Let nN,n2 and let f:R2R be a strictly increasing and strictly concave function. Then, Φf is an imbalance index. Moreover, the GFB tree Tngfb is the only minimizer of this function in BTn.

Proof

This is a direct consequence of the definition of an imbalance index in combination with Theorems 2 and 3 and the fact that Thfb=Tngfb if n=2h.

We now use Corollary 4 to answer several open problems from the literature, most notably from Fischer et al. (2023). Note that while it is already known that the s^-shape statistic is an imbalance index (Fischer et al. 2023), this has not been formally proven yet for the Q-shape statistic. However, while for the s^-shape statistic the minima have already been known for the cases in which n=2h (it is Tnfb as s^ is an imbalance index), it has not been known what the minimal trees are in cases in which n is not a power of two (Fischer et al. 2023). The following corollary fully characterizes these minima both for s^ and Q by showing that in both cases, Tngfb is the unique minimizer.

Corollary 5

The s^-shape statistic and the Q-shape statistic are both tree imbalance indices with the property that the GFB tree Tngfb is their only minimizer in BTn for any value of nN,n2.

Proof

Let nN,n2. We define fs^(i)=log(i-1) and fQ(i)=log(i) for iR2. Note that fs^ and fQ are both strictly increasing and strictly concave. Now, by definition of s^ and Q, we have for all rooted binary trees T with n leaves:

Φfs^(T)=vV˚(T)fs^(nv)=vV˚(T)log(nv-1)=s^(T),

as well as

ΦfQ(T)=vV˚(T)fQ(nv)=vV˚(T)log(nv)=Q(T).

Applying Corollary 4 completes the proof.

So, we now know that for all values of n, there is only one tree minimizing the s^-shape statistic (thus answering the question concerning the number of minima posed in Fischer et al. (2023, Chapter 9)), and we have fully characterized this unique minimum as Tngfb. In Section 4.3, we will also deliver explicit formulas to calculate the minimal value of s^ for all n.

We now turn our attention to the product function to show that functions of this type also form a family of tree imbalance indices. We again start with considering the caterpillar.

Corollary 6

Let nN,n2 and let cR, c>-2. Then, we have that Tncat is the unique maximizer of πc(T) in BTn, where πc(T)=vV˚(T)(nv+c).

Proof

Let cR, c>-2. We can set fc(i)=log(i+c) for iR2. Then, fc is both strictly concave and strictly increasing (as the logarithm with base 2 has these properties). With this function fc, we have for any rooted binary tree T with n leaves:

Φfc(T)=vV˚(T)fc(nv)=vV˚(T)log(nv+c)=logvV˚(T)(nv+c)=log(πc(T)). 10

By Theorem 3 we know that Tncat is the unique maximizer of Φfc, and, thus, we can conclude that log(πc(Tncat))>log(πc(T)) for all rooted binary trees T with n leaves. By the monotonicity of log, this directly implies πc(Tncat)>πc(T) for all such trees T. This concludes the proof.

We now use Corollary 6 to show that the product function leads to a family of imbalance indices.

Corollary 7

Let nN, n2 and let cR,c>-2. Moreover, let f:R2R be a strictly increasing function. Then, f(πc) is an imbalance index. Moreover, the GFB tree Tngfb is the only minimizer of this function.

Proof

The fact that Tncat is the unique maximizer of πc follows from Corollary 6, which in turn shows by the monotonicity of f that Tncat is the unique maximizer of f(πc). The fact that Tngfb is the unique minimizer of f(πc) was shown in Corollary 3. Using the fact that Thfb=Tngfb if n=2h and the definition of an imbalance index thus completes the proof.

Corollary 7 shows that the product functions are a family of tree imbalance indices. We further classify this family as merely a subfamily of the family of tree imbalance indices Φf in the sense that the tree rankings from balanced to imbalanced induced by these indices coincide with rankings induced by members of the Φf family, as the following proposition shows.

Proposition 4

Let cR,c>-2 and nN, n2, let f be a strictly increasing function. We consider the imbalance index f(πc) and its induced ranking of trees Tngfb,,Tncat from balanced to imbalanced. Then, there is a strictly increasing and strictly concave function fc:R2R such that Φfc induces the same ranking as f(πc).

Proof

First we note that by the monotonicity of f, f(πc) induces the exact same ranking as πc, which in turn induces the exact same ranking as log(πc) by the monotonicity of the logarithm.

Now, we set fc(i)=log(i+c) for iR2. Then, as in the proof of Corollary 6, fc is both strictly concave and strictly increasing, and just as in Equation (10) we can conclude Φfc(T)=log(πc(T)) for all rooted binary trees T with n leaves. This shows that Φfc and f(πc) induce the same rankings of all rooted binary trees with n leaves and thus completes the proof.

Before we turn our attention to deriving explicit formulas for the minimum values of s^ and Q in Section 4.3, we investigate the family of tree imbalance indices πc further. We first show that the family contains infinitely many different members in the sense that for choices of real c1,c2 larger than -2 with c1c2, we can find two trees T and T such that πc1 will consider T as more imbalanced than T and πc2 gives the opposite ranking. Thus, there is an uncountably infinite family of genuinely distinct imbalance indices.

Proposition 5

Let c1,c2R be distinct with c1,c2>-2. Then there exist two trees T and T such that πc1(T)>πc1(T) and πc2(T)<πc2(T); that is, the imbalance indices πc1 and πc2 rank T and T differently.

Proof

We will construct T and T as depicted in Figure 5 with suitable choices of sizes of subtrees: n11 of T11, n12 of T12, n21 of T21 and n22 of T22, respectively. Subtrees T11, T12, T21 and T22 can then be chosen arbitrarily as long as they have the respective numbers of leaves.

Fig. 5.

Fig. 5

Trees T, T, and T as needed in the proofs of Propositions 5 and 6. Note that all three trees share the same subtrees T11, T12, T21, and T22, which are depicted schematically as triangles. The stars depict the inner vertices that play an important role in the proofs

Since the subtree sizes induced by the two trees T and T only differ in two nodes, we can easily express πc(T) using πc(T) for any choice of cR as follows:

πc(T)=πc(T)·(n11+n21+c)·(n11+n12+n21+c)(n11+n12+c)·(n21+n22+c).

This implies:

πc(T)πc(T) 11
(n11+n21+c)·(n11+n12+n21+c)(n11+n12+c)·(n21+n22+c)cn11+cn21-cn22n11n22+n12n22-n112-n11n12-n11n21-n212cn11n22+n12n22-n112-n11n12-n11n21-n212n11+n21-n22, 12

(where the -symbol stands for either > or < consistently throughout).

The proof strategy now is to show that for any choice of c1,c2 larger than -2 we can choose n11, n12, n21 and n22 such that the fraction of Equation (11) lies between c1 and c2. By Equation (11), this will show that πc1(T)<πc1(T) and πc2(T)>πc2(T) and thus conclude the proof. In the following, we assume without loss of generality that c2>c1 by exchanging T and T if needed.

So now we let c1,c2R with c1>-2 and c2>c1. We let kN be such that k·(c2-c1)>2. This guarantees that the open interval (k·c1,k·c2) contains two consecutive integers m and m+1, where mZ. This implies that mk and m+1k are contained in the open interval (c1,c2). We have two rational numbers contained in (c1,c2). We now consider their mean 2m+12k. We have:

c1<mk<2m+12k<m+1k<c2.

Following our proof strategy, the proof is thus complete if we can show that we can choose n11, n12, n21 and n22 such that the fraction of Equation (11) equals 2m+12k.

We now set n11=1, n22=2, n21=2k+1, n12=4k2+2+6k+2m. We first verify that these are all valid leaf numbers: that all of these numbers are natural. Clearly, this holds for n11 and n22. Moreover, recall that kN, so n21 is also natural. But as mZ, m<0 could be possible. So we need to verify that n12 is positive. However, we know that mk>c1>-2 by the choice of c1 and mk, respectively. This shows that m>-2k and thus 2m>-4k, which leads to n12=4k2+2+6k+2m>4k2+2+6k-4k=4k2+2+2kN. So our choices of n11, n12, n21 and n22 result in four positive integers and can be realized as subtree sizes in trees. We show that with these choices, we indeed get that the fraction of Equation (11) equals 2m+12k:

n11n22+n12n22-n112-n11n12-n11n21-n212n11+n21-n22=2+2(4k2+2+6k+2m)-1-(4k2+2+6k+2m)-(2k+1)-(2k+1)21+(2k+1)-2=1+(4k2+2+6k+2m)-(2k+1)-(4k2+4k+1)2k=2m+12k.

This completes the proof.

Note that unsurprisingly, it is easier to make πc1 and πc2 disagree concerning the ranking of T and T if c2-c1 is large. If the difference is larger than one, the value of k chosen in the proof can be 1, which is as small as possible. As our choice of subtree sizes in the proof was n11=1, n22=2, n21=2k+1, and n12 such that n12>4k2+2+2k, this shows that even if k=1, we already need n=1+2+3+8=14 leaves for our construction. It may be possible to have smaller examples showing different rankings, but it is clear that no two indices πc1 and πc2 will rank all trees in the same order if c1c2.

We note T and T as used in the proof of Proposition 5 only differ in two subtree sizes, yet they will be ranked differently by certain members of the πc family. On the other hand, there are always pairs of trees that are ranked identically for all choices of c. Most prominently, this is of course the case for Tncat and Tngfb, but these differ in most subtree sizes. The next proposition shows that for all n at least 6, there are pairs of trees T and T such that these trees differ only in two subtree sizes and we have πc(T)>πc(T) for all cR,c>-2.

Proposition 6

Let nN with n6. Then there exist two trees T and T which only differ in two subtree sizes such that πc(T)>πc(T) for all cR, with c>-2.

Proof

We give an explicit construction for two non-isomorphic trees T and T which fulfill the condition. We begin by choosing nijN such that n11<n22 and n12<n21 and such that n11+n12+n21+n22=n6. These values of nij (with i,j{1,2}) will be used as leaf numbers for the subtrees Tij for T and T as depicted in Figure 5. Note that the conditions on nij guarantee that T and T are not isomorphic.

Moreover, note that as the subtree sizes induced by the two trees T and T from Figure 5 only differ in two nodes, we can easily express πc(T) using πc(T) for any choice of cR:

πc(T)=πc(T)·(n11+n21+c)·(n12+n22+c)(n11+n12+c)·(n21+n22+c).

This shows that we have:

πc(T)πc(T)(n11+n21+c)·(n12+n22+c)(n11+n12+c)·(n21+n22+c)n11n12+n21n22n11n21+n12n22

(where again the -symbol is a consistent inequality throughout). As the latter term is completely independent of c, this shows that all indices in the πc family will agree on how to rank T and T, and this will only be determined by these trees’ subtree sizes. This completes the proof.

Figure 6 illustrates the differences of rankings within the πc family by considering the range of values c=-1.99,-1.5,-1,-0.5,0,0.5,1,1.5,2 and comparing the rankings induced by these values for n=10.

Explicit formulas for π-1Tngfb and π0Tngfb

The first aim of this section is to provide two alternative direct (non-recursive) formulas to calculate the values both of π-1Tngfb as well as of π0Tngfb, corresponding to the s^-shape and the Q-shape statistic, respectively. It turns out that the sequence π-1TngfbnN can already be found in the Online Encyclopedia of Integers Sequences OEIS (Sloane 1964), namely under reference number A132862. However, the OEIS only contained a recursive formula to calculate π-1TngfbnN. Within the scope of the present manuscript, we have submitted our two explicit formulas for π-1Tngfb to the OEIS for addition to their database. Moreover, the sequence π0Tngfb of the Q statistic was added to the OEIS under the identifier A386912 (Sloane 1964, Sequence A386912).

The second aim of this section is to use our new formulas to derive explicit formulas for the minimum value of the s^-shape statistic (which answers an open question (Fischer et al. 2023, Chapter 9)) as well as for the Q-shape statistic.

We first prove the following lemma to give insight into the greedy clustering algorithm defining Tngfb.

Lemma 2

Let nN. Let A be the greedy clustering algorithm constructing Tngfb. Then, at any point during the run of this algorithm, there is at most one tree contained in the present set of trees whose size is not a power of two.

Proof

Towards a contradiction, we assume at some point during the course of the algorithm, there exists more than one tree in the present set of trees whose size is not a power of two. Consider the first step, j, where two such trees exist, and call them T and T. We assume that T=(T1,T2) (where (T1,T2) denotes the standard decomposition of T as defined above) was constructed from the trees of minimal size, T1 and T2 at step i<j. Further assume that at some later step j, T=(T1,T2) was constructed from the trees of minimal size, T1 and T2. By hypothesis, at the previous step, i-1, all trees, have size a power of 2. And at step j-1, all trees, besides T, have size a power of 2. Since both T1 and T2 have size a power of 2 and the result of joining them, T, does not, we know that T1 and T2 have different heights, and without loss of generality, we have that |T1|<|T2|<|T|. Further, by construction, h(T2)+1=h(T), and, by Corollary 2, h(T1)+1=h(T2). By a similar argument, |T1|<|T2|<|T|, h(T2)+1=h(T), and h(T1)+1=h(T2).

At each step, algorithm A joins the two trees of the present set of the smallest size, so, all other trees at step i-1 must have at least the size of T2, and all other trees at step j-1 must have at least the size of T2. In particular, T must be as least as large as T2. Since T does not have size a power of 2, but T2 does, we conclude from |T||T2| that in fact |T|>|T2|. Moreover, as a power of two, |T2| as a subtree of the GFB tree must be a fully balanced tree by Corollary 1, so it has minimal height for any tree with |T2| leaves. Thus, as |T|>|T2|, we conclude that we additionally have h(T2)+1=h(T)>h(T2)>h(T1). This necessarily implies h(T2)h(T2)>h(T1). Together with h(T2)>h(T1), this gives a contradiction, as in step i, T1 would not have been clustered with T2 as tree T1 of strictly smaller size than T2 was still available. This completes the proof.

The following theorem will prove useful for calculating an explicit formula for the minimum value of the s^-shape statistic. It counts the number of subtrees of Tngfb for all possible subtree sizes.

Theorem 7

Let n1, and let an(i) denote the number of subtrees of Tngfb of size i for i=1,,n. Let Inline graphic. Then, we have:

an(i)=niifi=2kiandif((nmodi)=0or(nmodi)2ki-1),ni-1ifi=2kiandif(0<(nmodi)<2ki-1),1ifi2kiand(n-i)mod2ki-1=0,0ifi2kiand(n-i)mod2ki-1>0..

The appendix contains a proof of Theorem 7, which is based on Lemma 2.

We now turn our attention to πcTngfb.

Corollary 8

Let nN, n2 and let cR,c>-2. Then, πcTngfb=i=2n(i+c)an(i), where an(i) is given by Theorem 7.

Proof

By definition, we have πc(T)=vV˚(T)(nv+c). Since the values of nv range between 2 and n, sorting the subtrees by sizes and using Theorem 7 gives the desired result.

Corollary 5 together with Corollary 8 leads to an explicit formula for the minimum value for the s^-statistic, thus solving an open problem stated in Fischer et al. (2023, Chapter 9).

Corollary 9

Let s^n=minTBTns^(T). Then, we have: s^n=logi=2n(i-1)an(i).

Proof

By Corollary 5, s^ is uniquely minimized by Tngfb, which directly implies s^n=s^Tngfb. By definition, this shows s^n=logvV˚Tngfb(nv-1). Applying Corollary 8 with c=-1 and the monotonicity of the logarithm, immediately leads to the required result and thus completes the proof.

Remark 1

The sequence i=2n(i-1)an(i)n1 starts with the values:

1,1,2,3,8,15,36,63,192,405,1080,2079,6048,12285,31752,59535,193536

has already occurred in different contexts (cf. Bodini et al. 2022). It is listed in the Online Encyclopedia of Integer Sequences (Sloane 1964, Sequence A132862), where only recursive formulas were given. Using the GFB tree, in particular Theorem 7 and Corollary 9, now allows for a simple explicit formula to calculate this sequence.1 The explicit formulas arising from the present manuscript have meanwhile been submitted to the OEIS.

Analogously, we can derive a result as given by Corollary 9 also for the Q-shape statistic.

Corollary 10

Let Qn=minTBTnQ(T). Then, we have: Qn=logi=2nian(i).

Proof

Using c=0, the proof of Corollary 10 is analogous to the proof of Corollary 9.

While the explicit formulas for π-1Tngfb and for π0Tngfb provided by Corollary 8 are non-recursive and thus already an improvement to the previous state of the literature, they heavily depend on Theorem 7. The following theorem provides another direct formula independent of the values an(i).

Theorem 8

Let nN, n2 and let cR,c>-2. Let Inline graphic, and let dn=n-2kn-1 be the difference between n and the next lower power of 2. Then, we have:

  1. If dn=2kn-1 (with n=2kn), then πcTngfb=πcTknfb=i=0kn-1(2kn-i+c)i.

  2. If dn<2kn-1, (with n<2kn), then we have:
    graphic file with name 11538_2025_1522_Equ32_HTML.gif

Before we can prove Theorem 8, we briefly show that the complete tree Tnc of Fill (1996) coincides with the GFB tree Tngfb, which has been independently shown in Riesterer (2022, Theorem 4.2), albeit with a different proof. This result will enable us to use a different construction of Tngfb, namely to start with Tkn-1fb, fix an orientation and then replace a certain number of leaves by cherries from left to right, until n leaves in total are reached.

Lemma 3

(Theorem 4.2 in Riesterer 2022) Let n1. Then, Tngfb=Tnc.

Proof

We prove the statement by induction on n. In the following, let Tngfb=(Ta,Tb), where Ta has size na and Tb has size nb with nanb. Similarly, let Tnc=(Tac,Tbc), where Tac has size nac and Tbc has size nbc with nacnbc.

For n=1 there is only one tree, so there is nothing to show. We now assume the statement holds for all trees with up to n-1 leaves and consider n2. Let n=log(n), that is n{2n,,2n+1-1}. Then, by construction of Tnc, we know that if n3·2n-1, nbc=2n-1 (as in this case, no leaves of Tb get replaced by cherries), and nac=n-nbc=n-2n-1. By Part (1) of Proposition 1, we can then conclude na=nac and nb=nbc.

If, on the other hand, n>3·2n-1, we know by construction that Tac=Tnfb and thus nac=2n (as all leaves of the left subtree have been replaced by cherries) and thus nbc=n-nac=n-2n. By Part (2) of Proposition 1, we can then conclude na=nac and nb=nbc.

Thus, in both cases, the sizes of Ta and Tac as well as the sizes of Tb and Tbc, respectively, coincide, which by induction shows that Ta=Tac and Tb=Tbc. Thus, Tngfb=(Ta,Tb)=(Tac,Tbc)=Tnc, which completes the proof.

We are now in the position to prove Theorem 8.

Proof of Theorem 8

For the case in which dn=2kn-1, the statement is a direct conclusion of the fact that for n=2kn, the GFB tree and the fully balanced tree coincide.

It remains to consider the case dn<2kn-1. In this case, by Lemma 3, we can derive the GFB tree from Tkn-1fb by replacing dn leaves by cherries from left to right. Thus, we can start with πcTkn-1fb and modify this product by dividing out all factors of πcTkn-1fb that are no longer present in πcTngfb and multiypling in factors newly occuring in the latter term. We do this using the following considerations:

  • The factor (2+c)dn stems from the dn newly formed cherries, each of which contributes a factor of 2+c. For this new factor, nothing needs to be divided out as the former leaves did not occur in the term πcTkn-1fb.

  • Next, for each i=1,,kn-1, we need to check how many subtrees of size 2i in Tkn-1fb get replaced by subtrees of size 2i+1 when Tngfb is formed. These are precisely the subtrees of size 2i in Tkn-1fb all of whose leaves get replaced by cherries. As we fill the tree up from left to right, it can be easily seen that there are dn2i such trees, explaining the term 2i+1+c2i+cdn2i.

  • Last, for each i=1,,kn-1, there may be at most one subtree of size 2i in Tkn-1fb some of whose leaves but not all get replaced by cherries. This depends on whether dn2i is an integer. If it is, then the dn new cherries completely fill up all trees of size 2i to which they were added, (that is, all these trees have already been considered in the previous term). This is the case when Inline graphic, which implies that in this case, the latter term in the equation equals 1 and thus does not contribute to the overall product. If, however, dn2i is not an integer and thus Inline graphic, then there is a tree of size 2i to which dn-2i·dn2i leaves get added, namely precisely the “left over” leaves after filling up dn2i many subtrees of Tkn-1fb with 2i new leaves each. This explains the last factor and thus completes the proof.

Next, we again turn our attention to the s^-shape statistic.

Expected values of the s^-shape statistic

The s^-shape statistic plays an important role in tree balance, particularly in the context of mathematical phylogenetics and the Yule-Harding model, cf. Kersting et al. (2025). However, so far the expected values of the s^-shape statistic under the Yule-Harding and the uniform models, which are common distributions of trees, are unknown (Fischer et al. 2023, Chapter 9). In the following, we give bounds on the expected value of the s^-shape statistic under these two distributions: the uniform distribution where each (binary) tree on n leaves is equally likely, and the Yule-Harding distribution. To show our bounds, we outline and use the elegant approach of King and Rosenberg (2021). They note that the expectation of the Sackin index can be computed in terms of the cluster sizes for any distribution, θ, on trees which has the exchangeability property, that is, for each TBTn and each permutation, σ, of its leaf labels, Pθ(T)=Pθ(σ(T)). For such distributions, the proposition from Than and Rosenberg (2014) applies for the Sackin index, Sn:

Proposition 9

(Than and Rosenberg 2014, Lemma 6) If a probability distribution, Θ, on BTn satisfies the exchangeability property, then the expected value for the Sackin index on n-leaf trees is:

Eθ[Sn]=k=1n-1nkkpn(k)

where pn(k) is the probability that a given subset AX with |A|=k, 1kn, is a cluster of a tree of size n leaves sampled from BTn according to Θ.

Note that the s^-shape statistic, like the Sackin index, sums across all cluster sizes of a given tree: the Sackin index sums up the respective size k, while the s^-shape statistic sums the logarithm of said size (namely, log(k-1)). This similarity between the indices allows us to use the above approach introduced for the Sackin index also for the s^-shape statistic:

Proposition 10

If a probability distribution, Θ, on BTn satisfies the exchangeability property, then the expected value for the s^-shape statistic on n-leaf trees is

Eθ[s^n]=k=2n-1nklog(k-1)pn(k)

where pn(k) is the probability that a given subset AX with |A|=k, 2kn, is a cluster of a tree of size n leaves sampled from BTn according to Θ.

King and Rosenberg (2021) give an elegant proof of the expected value of the Sackin index and the resulting closed form:

Theorem 11

(King and Rosenberg 2021, Corollary 7) The expectation of the Sackin index under the uniform model on rooted binary labeled trees of n leaves is:

EU[Sn]=4n-1Cn-1-n

where Cn=1n+12nn, the nth Catalan number.

Using the bounds from King and Rosenberg (2021), we can show:

Theorem 12

The expectation of the s^-shape statistic under the uniform model on rooted binary labeled trees of n leaves is:

lognn4n-1Cn-1-nEU[s^n]4n-1Cn-1-n

Proof

The upper bound follows directly from the Sackin index being an upper bound for the s^-shape statistic.

For the lower bound, we use Proposition 10 and the simple bound of log(k-1)klog(n-1)n for 2kn:

Eθ[s^n]=k=2n-1nklog(k-1)pn(k)=k=2n-1nkn-1k-12n-22k-2log(k-1)log(n-1)nCn-14n-1-2(n-1)n-1+22n-5n-3+2(n-1)n-1=log(n-1)nCn-14n-1-22(n-1)n-1+22n-5n-3.

This completes the proof.

Discussion and Conclusion

We have introduced two families of imbalance indices, namely Φf for strictly increasing and strictly concave functions f and the product functions πc for c>-2, and shown that both of them are uniquely minimized by the GFB tree. For the s^-shape statistic, which is an important imbalance index used in the phylogenetic literature, this finding answered the open question concerning its extrema from (Fischer et al. 2023, Chapter 9). However, our approach is more general and not just focused on the s^-shape statistic. In particular, we have shown that our families of imbalance indices contain infinitely many different imbalance indices, some of which might be useful in phylogenetics and other research areas where tree balance plays a role.

Acknowledgements

The authors wish to thank Tom N. Hamann, Kristina Wicke and Volkmar Liebscher for helpful discussions. The present manuscript is based upon work supported by the National Science Foundation under Grant No. DMS-1929284 while the authors were in residence at the Institute for Computational and Experimental Research in Mathematics (ICERM) in Providence, RI, during the Theory, Methods, and Applications of Quantitative Phylogenomics semester program.

Appendix A Proof of Theorem 7

Here we present the somewhat technical proof of Theorem 7.

Proof of Theorem 7

We first analyze the procedure with which the GFB tree is generated. When the greedy clustering is performed to form Tngfb, we refer to all clusterings that involve at least one tree of size 2m and no tree of size 2m-1 as phase m of the algorithm. Phase 0 includes all steps that cluster subtrees of size 2m=20=1, that is the leaves to form cherries. If n is odd, this includes as the last step the clustering of a leaf and a cherry (subtree of size 2). Phase 1 contains all steps that involve clustering of cherries. Almost all these clusterings will be two cherries clustered into a new subtrees of size 4. The last clustering in phase 1 could cluster a cherry with a subtree of size 3 or 4, if nmod43 or 2, respectively.

We now proceed by considering some i{1,,n} with Inline graphic at the end of phase ki-1 of the algorithm (or, equivalently, the beginning of phase ki). The trees present at this stage will be referred to as the current set of trees. All trees in the current set must have size at least 2ki-1+1 as all trees of size up to 2ki-1 have already been clustered into larger trees. Moreover, all trees in the current set have size strictly smaller than 2ki+1. This is due to the following: first, phase ki-1 only performs clusterings in which at least one tree has size at most 2ki-1. Second, all trees formed throughout the course of the algorithm are again GFB trees by Corollary 1. This implies by Corollary 2 that a tree of size 2ki+1 or larger would have two maximum pending subtrees of size at least 2ki each – but two such trees could not have been clustered during phase ki-1 of the algorithm. So, all trees T in the current set have size nTS={2ki-1+1,,2ki+1-1}. However, by Lemma 2, there is at most one tree present in the current set of trees whose size is not a power of 2. As S only contains one power of 2, namely 2ki, we conclude that all trees except possibly for one have size 2ki.

We now consider the decomposition n=a·2ki+b with b=nmod2ki{0,,2ki-1} and a=n2ki. We distinguish three cases depending on the value of b. Note that this decomposition together with the above observations immediately implies that there are a-1 or a trees of size 2ki in the current set. In the first case, the only remaining tree has size 2ki+b, and in the second case, the only remaining tree has size b.

  • If b=0, we have n=a·2ki. Thus, we have (nmod2ki)=0, and obviously all trees in the current set have size 2ki, because n-(a-1)·2ki=2ki, so if you consider a-1 trees of size 2ki and one remaining tree, the remaining tree has the same size. This directly proves the statement an(i)=ni of the theorem for i=2ki and (nmodi)=0 (as all trees of the current set are subtrees of Tngfb and no other trees of size i=2ki can be formed throughout the algorithm). Moreover, as b=0, we also have for i{2ki-1+1,,2ki-1} that ((n-i)mod2ki-1)>0, and as there is no tree of such a size i (as all trees in the current set have size 2ki, which by Corollary 2 are formed of two trees of size 2ki-1 each), we have an(i)=0 for such values of i. This is in accordance with the last case of the theorem.

  • If 0<b<2ki-1, we observe that there cannot be a trees of size 2ki in the current set. Otherwise, there would be b leaves not contained in any 2ki tree, thus belonging to a tree T of size b in the current set – but this would imply that the size of T is strictly smaller than 2ki-1, a contradiction to the current set being the set at the end of phase ki-1, as T would have had to cluster in this phase. So the only possibility is that there are a-1 trees of size 2ki in the current set and one tree T of size 2ki+b. But by Corollary 2, T cannot have a subtree of size 2ki (as a tree of size 2ki cannot be clustered with a tree of size b<2ki-1 to form a GFB tree, and T has to be a GFB tree, too, as it is a subtree of Tngfb); it instead has one maximum pending subtree of size 2ki-1 and one of size 2ki-1+b. Thus, Tngfb contains a-1=ni-1 trees of size i=2ki, so an2ki=ni-1, which proves the second case of the theorem as we have 0<b=(nmodi)<2ki-1. Further, if i=2ki-1+b, we have n-i=a·2ki+b-2ki-1+b=(2a-1)·2ki-1, and thus ((n-i)mod2ki-1)=0. As we have already seen that a subtree of size 2ki-1+b was formed in the course of the algorithm (and no more such trees can be formed as the algorithm proceeds), we have an2ki-1+b=1, which is in accordance with the third case of the theorem. Last, if i{2ki-1+1,,2ki-1} with i2ki-1+b, we have seen that no such tree can be formed in the course of the algorithm, so an(i)=0. As in this case we have ((n-i)mod2ki-1)>0, this is in accordance with the fourth case of the theorem.

  • Finally, we consider the case b>2ki-1. In this case, before considering the beginning of phase ki of the algorithm, we consider the beginning of phase ki-1, which is the end of phase ki-2. We can write n=a·2ki+b=(2a+1)·2ki-1+b, where b=b-2ki-1<2ki-1 (as b<2ki). Using the same reasoning as above, in the beginning of phase ki-1, there must either be 2a trees of size 2ki-1 and one tree of size n-2a·2ki-1=2ki-1+b, or there are 2a+1 trees of size 2ki-1 and one tree of size b<2ki-1. In the latter case, if in the beginning of phase ki-1 we have 2a+1 trees of size 2ki-1 and one tree of size b<2ki-1, note that we must have b>0 (empty trees are never formed in the algorithm). Then, the tree of size b will be the first one to be clustered in phase ki-1 to one of the 2a+1 trees of size 2ki-1. This forms a tree of size 2ki-1+b, and the remaining 2a trees of size 2ki-1 will cluster to form a trees of size 2ki in the course of phase ki-1. Thus, in the end of this phase, we have a trees of size 2ki and one tree of size 2ki-1+b=2ki-1+b-2ki-1=b. This tree of size b would be the first tree to be clustered in phase ki with one of trees of size 2ki to form a tree of size 2ki+b. Now, we consider the first case, the case where in the beginning of phase ki-1 we have 2a trees of size 2ki-1 and one tree of size 2ki-1+b. If b>0, phase ki-1 would not involve the last tree, it would only cluster the 2a trees of size 2ki-1 to form a trees of size 2ki. The remaining tree of size 2ki-1+b would be the first one to be clustered in phase ki with one of trees of size 2ki, though, to form a tree of size 3·2ki-1+b=2ki+b+2ki-1=2ki+b. Similarly, if b=0, phase ki-1 would first cluster the 2a trees of size 2ki-1 to form a trees of size 2ki and then, in its last step, it would cluster the remaining tree of size 2ki-1+b=2ki-1 with one of the already formed trees of size 2ki to form a tree of size 3·2ki-1+b=2ki+b. So in all cases, we can see (either directly after phase ki-1 or after the first step of phase ki) that Tngfb contains precisely a trees of size 2ki, one of which gets clustered with a tree of size b to form a tree of size 2ki+b. Now, if i=2ki, the a=ni many trees of size 2ki are in accordance with the first case of the theorem, because here we have (nmod2ki)=b2ki-1. Therefore, in this case we have an(i)=ni. However, if i{2ki-1+1,,2ki-1}, we have an(i)=1 if i=b (because a tree of size b gets clustered with a tree of size 2ki). This is in accordance with the third case of the theorem, as here we have n-i=n-b=a·2ki+b-b=a·2ki, and thus ((n-i)mod2ki-1)=0. If, on the other hand, we have i{2ki-1+1,,2ki-1} and ib, then there cannot be a subtree of size i: It would have to be clustered away last in phase ki of the algorithm. So it would have to be there in the end of phase ki-1 (which is not the case as we have analyzed above), or it would have to arise within phase ki. The latter cannot happen as we have seen that at the latest after one step of phase ki, we are left with only trees of size at least 2ki. Thus, we conclude that for such values of i, we have an(i)=0. This is in accordance with the fourth case of the theorem, because in this case we have n-i=a·2ki+b-i. Since both b and i are contained in the set {2ki-1,,2ki-1}, their maximal difference is bounded by 2ki-2ki-1. We can distinguish two cases: If b>i, we have n-i=a·2ki+b-i>a·2ki=2a·2ki-1 as well as n-i=a·2ki+b-i<a·2ki+2ki-2ki-1=(2a+1)·2ki-1, so we have (2a+1)·2ki-1>n-i>2a·2ki-1, which shows that ((n-i)mod2ki-1)>0. Similarly, if b<i, we have n-i=a·2ki+b-i<a·2ki=2a·2ki-1 as well as n-i=a·2ki+b-i>a·2ki-2ki+2ki-1=(2a-1)·2ki-1, so we have 2a·2ki-1>n-i>(2a-1)·2ki-1, which shows that ((n-i)mod2ki-1)>0.

This completes the proof of the theorem.

Funding

Open Access funding enabled and organized by Projekt DEAL. The present manuscript is based upon work supported by the National Science Foundation under Grant No. DMS-1929284 while the authors were in residence at the Institute for Computational and Experimental Research in Mathematics (ICERM) in Providence, RI, during the Theory, Methods, and Applications of Quantitative Phylogenomics semester program.

Data Availability

The authors declare that all data generated for this study are contained in the manuscript. No other sources of data have been used.

Declarations

Competing interests

All others received the funding declared above. The authors confirm that they have no other financial or non-financial interests to declare.

Footnotes

1

We note that another explicit, but more complicated, formula was independently derived in Riesterer (2022).

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Sean Cleary, Mareike Fischer and Katherine St. John all authors contributed equally to this work.

References

  1. Blum MG, François O (2006) Which random processes describe the tree of life? A large-scale study of phylogenetic tree imbalance. Syst Biol 55(4):685–691 [DOI] [PubMed] [Google Scholar]
  2. Bodini O, Genitrini A, Gittenberger B, Larcher I, Naima M (2022) Compaction for two models of logarithmic-depth trees: Analysis and experiments. Random Struct Algorithms 61(1):31–61. 10.1002/rsa.21056https://onlinelibrary.wiley.com/doi/pdf/10.1002/rsa.21056
  3. Cormen TH, Leiserson CE, Rivest RL, Stein C (2001) Introduction to Algorithms, 2nd edn. MIT Press, Cambridge, MA [Google Scholar]
  4. Coronado TM, Fischer M, Herbst L, Rosselló F, Wicke K (2020) On the minimum value of the Colless index and the bifurcating trees that achieve it. J Math Biol 80(7):1993–2054. 10.1007/s00285-020-01488-9 [DOI] [PubMed] [Google Scholar]
  5. Fill JA (1996) On the distribution of binary search trees under the random permutation model. Random Struct Algorithms 8(1):1–25. 10.1002/(sici)1098-2418(199601)8:1<1::aid-rsa1>3.0.co;2-1
  6. Fischer M (2021) Extremal values of the Sackin tree balance index. Ann Comb 25(2):515–541. 10.1007/s00026-021-00539-2 [Google Scholar]
  7. Fischer M, Liebscher V (2021) On the balance of unrooted trees. J Graph Algorithms Appl 25(1):133–150. 10.7155/jgaa.00553 [Google Scholar]
  8. Fischer M, Herbst L, Kersting SJ, Kühn L, Wicke K (2023) Tree Balance Indices - A Comprehensive Survey. Springer, Berlin [Google Scholar]
  9. Hamann TN (2023) Metaconcepts for rooted tree balance. Master’s thesis. University of Greifswald, Germany [Google Scholar]
  10. Kersting SJ, Wicke K, Fischer M (2025) Tree balance in phylogenetic models. Philos Trans R Soc Lond B Biol Sci 380(1919):20230303 [DOI] [PMC free article] [PubMed] [Google Scholar]
  11. King MC, Rosenberg NA (2021) A simple derivation of the mean of the Sackin index of tree balance under the uniform model on rooted binary labeled trees. Math Biosci 342:108688 [DOI] [PMC free article] [PubMed] [Google Scholar]
  12. Mir A, Rosselló F, Rotger L (2013) A new balance index for phylogenetic trees. Math Biosci 241(1):125–136. 10.1016/j.mbs.2012.10.005 [DOI] [PubMed] [Google Scholar]
  13. Riesterer T (2022) Der Greedy-from-the-bottom-Baum und seine Bedeutung für die Phylogenetik. Master’s thesis. University of Greifswald, Germany [Google Scholar]
  14. Rosen DE (1978) Vicariant patterns and historical explanation in biogeography. Syst Zool 27(2):159. 10.2307/2412970 [Google Scholar]
  15. Semple C, Steel M (2003) Phylogenetics. Oxford Lecture Series in Mathematics and its Applications. Oxford University Press, Oxford [Google Scholar]
  16. Shao K-T, Sokal RR (1990) Tree balance. Syst Zool 39(3):266. 10.2307/2992186 [Google Scholar]
  17. Sloane NJA (1964) The On-Line Encyclopedia of Integer Sequences. http://oeis.org
  18. Steel M (2016) Phylogeny: Discrete and Random Processes in Evolution. Society for Industrial and Applied Mathematics, Philadelphia PA [Google Scholar]
  19. Than CV, Rosenberg NA (2014) Mean deep coalescence cost under exchangeable probability distributions. Discret Appl Math 174:11–26 [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Data Availability Statement

The authors declare that all data generated for this study are contained in the manuscript. No other sources of data have been used.


Articles from Bulletin of Mathematical Biology are provided here courtesy of Springer

RESOURCES