On the Balance of Unrooted Trees

We solve a class of optimization problems for (phylogenetic) $X$-trees or their shapes. These problems have recently appeared in different contexts, e.g. in the context of the impact of tree shapes on the size of TBR neighborhoods, but so far these problems have not been characterized and solved in a systematic way. In this work we generalize the concept and also present several applications. Moreover, our results give rise to a nice notion of balance for trees. Unsurprisingly, so-called caterpillars are the most unbalanced tree shapes, but it turns out that balanced tree shapes cannot be described so easily as they need not even be unique.


Introduction
Tree balance plays an important role in many different research areas, ranging from studies on evolution (cf. [1,2]) to theoretical computer science (cf. [14]). In this regard, recently various balance indices for rooted trees have been studied in detail (cf. [5,7,16]). However, the balance of unrooted trees has so far only been considered in few studies (e.g. [11,23]). Many questions concerning the balance of unrooted trees are therefore still open. In the present manuscript, we suggest a general framework for balance indices for unrooted trees, with a special focus on unrooted phylogenetic trees.
When such phylogenetic trees are considered, i.e. trees describing the evolutionary history of n present-day species which label the leaves of the tree, one is often confronted with the need to find the extreme values of the expression Here, τ varies over all phylogenetic trees with n leaves, and Σ * (τ ) is the set of so-called nontrivial splits of X = {1, . . . , n} induced by τ . Recall that a split σ of a set X is just a bipartition of this set into two non-empty subsets A and B (we then write σ = A|B), and a split is called non-trivial whenever both parts of the bipartition have cardinality at least 2. Splits of the species set X play an important role in mathematical phylogenetics, because every edge of a phylogenetic tree induces such a split, and splits are non-trivial if and only if they are induced by an inner edge of the tree (i.e. not by an edge connected to a leaf). Moreover, in the above definition of Φ f (τ ), A|B = min(|A|, |B|) denotes the cardinality of the smaller part of the split.
Such expressions recently appeared in different contexts, each time with a different choice of the monotonic function f : {2, . . . , n/2 } → R ≥0 : 1. The size of a TBR-neighborhood of the tree τ with f (k) = k(n − k), see [12]. This example is also related to the so-called Wiener index of the tree [23]. For this index, you need to assign edge lengths to all edges of τ . Then, the Wiener index is defined as W (τ ) = u,v∈V (T ) where V (τ ) refers to the vertex set of τ and d τ refers to the pairwise distances between any two vertices induced by the edge lengths.
Note that the number of cherries is a simple but well-known measure of tree balance for rooted trees [22], so the stated definition of f generalizes this concept.
In many situations, it turns out that the extremal shapes (giving the minimal or maximal values of the functional) are so-called caterpillars (i.e. rooted trees with just one cherry or unrooted trees with just two cherries) and so-called semi-regular trees, i.e. trees which have at most one non-leaf vertex that is not of maximum degree and that such a vertex, if it exists, cannot be adjacent to more than one non-leaf vertex [23]. While the first kind of trees, the caterpillars, are often considered the most unbalanced tree shapes, the latter kind, i.e. the semi-regular trees, are considered to be most balanced. This reoccurence is challenging, as there seems to be no study of the whole family of functionals with f broadly varying. We regard the present note as the beginning of this study.
But how is Φ f (τ ) measuring the balance of the shape of τ ? Intuitively, splits σ ∈ Σ * (τ ) with a high value of σ are very balanced, and it seems that the maximum of Φ f (τ ) should be attained by the most balanced shapes. But, more importantly, the balanced tree shapes display more splits σ with a small σ , for example cherries. Thus they realise a smaller value of Φ f than caterpillars.
In fact, the Arxiv version of [11], namely [12], provided already the main idea for deriving the maximal value for increasing functions f . As this Arxiv version provides a few more details than the published manuscript, we will subsequently refer to that version. Anyway, a lot of structure is required for deriving the minimal value of Φ f , whereas its maximum is significantly easier to establish, cf. [12,23].
We will show in the following that for general functions f , the main principle becomes even more transparent when considering particular functionals. Last but not least, we also give further applications to topological indices.

Preliminaries
Let T n be the set of all (unrooted) phylogenetic trees (i.e. connected acyclic graphs with leaves labelled by a so-called taxon set X) with |X| = n ≥ 6 leaves, and T 2 n the subset of T n which contains all fully resolved (i.e. binary, bifurcating) trees in T n ; i.e. the trees in T 2 n have the property that all vertices have either degree 3 (inner nodes) or 1 (leaves). When there is no ambiguity, we often just say tree when referring to a phylogenetic tree or, when the leaf labeling is not important, its so-called tree shape, respectively.
Caterpillars with n leaves are binary phylogenetic trees with two leaves, say 1, n, such that every vertex of the tree is on the path from 1 to n or adjacent to a vertex on this path. In the so-called Newick format [6], which gives a nested list of all leaves such that leaves which are separated by fewer edges in the tree are also separated by fewer brackets, caterpillars may be denoted by the expression τ c = (((1, 2), 3), . . . , n).
If τ ∈ T n , let Σ(τ ) denote the set of all splits, i.e. all partitions of the leaf set X into two non-empty subsets A and B, and let Σ * (τ ) be the set of all non-trivial splits σ = A|B induced by inner edges of τ , i.e. Σ * (τ ) contains all splits for which both |A| ≥ 2 and |B| ≥ 2. For a split σ = A|B let σ = A|B = min(|A|, |B|) denote its size. Now we introduce for any function f : Clearly, a tree and its contraction, obtained by suppressing all inner vertices of degree 2, share the same value of Φ f . A rotation of the tree, which is obtained by permuting the leaf labels, does not alter the value of Φ f either. So Φ f is just a function of the phylogenetic tree shape of τ . Particularly, all caterpillars get the same value under Φ f .
Another concept we need to introduce before we can present our results are so-called NNImoves on binary trees. NNI stands for Nearest Neighbor Interchange, and in order to perform an NNI-move on a binary tree τ , you fix an inner edge of τ . This edge is connected to four subtrees, two on either side. You then swap two of these subtrees from opposite sides of the edge. This procedure is called NNI-move, and the resulting tree τ is called an NNI-neighbor of τ . You can also define a metric based on NNI in order to measure the distance between two trees τ , τ such that d(τ, τ ) equals the minimum number of NNI moves needed to get from τ to τ .
Finally, recall that a vector or sequence s is called Pareto maximal (or Pareto minimal ) in a set S ⊆ R n , if it is maximal (minimal) with respect to the componentwise order. This means that none of its entries can be increased (decreased) within the set S without decreasing (increasing) another one.

Results for increasing functions f
In this section, we consider a function f : {1, . . . , n/2 } → R ≥0 with the additional assumption that f is increasing, i.e. if x > y, then f (x) ≥ f (y). The following theorem, which is based on ideas presented in [12], shows that caterpillars maximize Φ f in this case.
Theorem 1 Let τ c ∈ T n be a caterpillar and f : {2, . . . , n/2 } → R ≥0 increasing. Then for all If f is strictly increasing and τ ∈ T n is a point of maximum of Φ f , then τ is a caterpillar.
Before presenting the proof, we consider the following elementary lemma, which we will need subsequently. f (min(l, n − l)).
Proof: For symmetry reasons we may assume that p ≤ (n − 2 − m)/2 and consider the function f (min(l, n − l)).
We find Proof: [Proof of Theorem 1.] Consider first the case that f is strictly increasing and τ is such that Φ f (τ ) is maximal. We now follow directly the arguments in the proof of [12, Lemma 4.1]. Fix two cherries x 1 , x 2 and x 3 , x 4 of τ and partition {1, . . . , n} by the edges of the path from x 1 to x 4 , see Fig. 1. We just want to prove that the number of leaves in Y i , which we denote by |Y i | = y i , equals 1 for all i = 1, . . . , k, because this is equivalent to τ being a caterpillar. So let us assume there is an i with y i ≥ 2. We choose i minimal, i.e. y 1 = y 2 = · · · = y i−1 = 1. We now construct a new tree τ by moving Y i such that it is now a neighbor of x 1 , see again Figure 1. We now consider several kinds of non-trivial splits in τ : 1. Splits σ which are not on the path from x 1 to x 4 . For those splits σ is the same for τ as for τ .
2. Splits σ on the path from x 1 to x 4 before the edge splitting Y i−1 from Y i+1 (i.e. in Figure 1 to the left of this split). Enumerating these splits by their distance from x 1 in τ and τ , the size of the l th split changes from min(l + 1, n − l − 1) to min(l + y i , n − l − y i ).
3. The edge on the path from Here, the size of σ in τ equals the size of the split splitting Y i from Y i+1 in τ .
4. Splits σ on the path from x 1 to x 4 after the edge splitting Y i−1 from Y i+1 , i.e. in Figure 1 at the right-hand side. Here, the size of σ remains unchanged from τ to τ .
Thus we find by Lemma 1. However, this implies that τ is not optimal. This is a contradiction, because τ was chosen to be optimal. So we conclude that the assumption is wrong and y i = 1 for all i = 1, . . . , k. Therefore, τ is a caterpillar. If f is increasing but not strictly increasing take an arbitrary tree τ and a caterpillar τ c . For an arbitrary ε > 0 consider the function f ε : {1, . . . , n/2 } → R ≥0 , f ε is strictly increasing and we obtain from the previous arguments , which completes the proof.
Looking for an unconstrained minimum over T n does not make much sense since it is attained at the most unresolved tree τ 0 with no inner splits: Σ * (τ ) = ∅. Note that such a tree is also often referred to as a star-tree. If we restrict our consideration to T 2 n , instead of considering the minimum of an increasing function, we could equivalently consider decreasing functions f and look again at the maximum. Anyway, the analysis is much more difficult, which is why we first need to present an important concept needed in this context, namely the so-called split size sequences.

Results for split size sequences and minima
From now on, we focus on binary trees, and we now introduce so-called split size sequences. In order to obtain these, we first associate to every binary tree τ ∈ T 2 n the (multi-)set of split sizes { σ : σ ∈ Σ * (τ )}. However, for ease of notation, it is better to work with ordered n − 3 tuples instead of (unordered) sets, which is why we continue with the following definition.
n . Then, τ induces n−3 non-trivial splits, i.e. |Σ * (τ )| = n−3. We assume an arbitrary ordering σ 1 , . . . , σ n−3 of these splits and define the (n − 3)-tuples(τ ) as follows: We then define the split size sequence s(τ ) as follows: Order the n − 3 entries ofs(τ ) increasingly and call the resulting ordered sequence s(τ ). This is the split size sequence. Moreover, we denote by S n = s(τ ) : τ ∈ T 2 n the set of all split size sequences on n taxa.
As an example for the split size sequence, we now consider the caterpillar tree. Consider again Figure 1. If τ in this figure is a caterpillar, denoted τ c , it has |Y 1 | = · · · = |Y k | = 1. In order to get an (unordered) sequence of all split sizes, we start at one cherry, say x 1 , x 2 and subsequently consider the splits It is clear that the cherry contributes the value 2 tos(τ c ), then we get a 3, 4, 5, and so forth. However, as soon as there are fewer leaves on the right-hand side, say in set B, than on the left-hand side, say in set A, where σ = A|B, the sequence will continue with |B| = n − |A| instead of |A|. In the end, we order the elements ofs(τ c ) increasingly in order to derive s(τ c ). For example, if the caterpillar has n = 6 leaves, we get s(τ c ) = (2, 2, 3), if n = 7, we get s(τ c ) = (2, 2, 3, 3), if n = 8, we get s(τ c ) = (2, 2, 3, 3, 4), and so forth.
Note that there is an alternative equivalent definition of s(τ ). At first, it might seem a little less intuitive, but it proves to be useful in the following. Consider the increasing sequence m(τ ) ∈ N {2,..., n/2 } whose entries are defined as follows: In order to clarify m(τ ), consider again the above caterpillar examples. If n = 6, we have s(τ c ) = (2, 2, 3), so we have 2 splits of size ≤ 2 and 3 splits of size ≤ 3. So we get m(τ c ) = (2, 3). Similarly, if n = 7, we get m(τ c ) = (2, 4), and for n = 8, we have m(τ c ) = (2,4,5). Now note that s(τ ) ∈ N n−3 is just the left inverse of m(τ ): This means The function m will be used in the subsequent proofs.
Note that it is not so clear how to characterize S n , i.e. all possible split size sequences. However, in the following we investigate them a bit further. Therefore, first of all we order S n in the pointwise sense. So we say that τ ∈ T 2 n is not less balanced 1 than τ ∈ T 2 n , denoted τ τ , if This leads to the following theorem.
1 As we will show in the present manuscript, the balance definition as chosen here is sensible in the sense that it for instance leads to caterpillars being the least balanced trees. Not only does this make sense intuitively, it also coincides with the extremal behavior of commonly used balance indices for rooted trees, like e.g. the Sackin [7,19], Colless [3,4] or Total Cophenetic [16] indices. So the definition as presented here provides a desirable generalization of the rooted case.
This immediately leads to m(τ ) j ≤ m(τ ) j for all j = 2, . . . , n/2 and thus τ τ . Proof: That caterpillars give the only maximal point on S n is derived easily from the previous two theorems, as for a caterpillar τ c we have Φ f (τ c ) ≥ Φ f (τ ) for all τ ∈ T 2 n by Theorem 1, and thus, by Theorem 2 we conclude τ τ c for all τ . The split size sequence of caterpillars has already been described above.
Thus, the Pareto maximum of S n is unique. It even corresponds to a unique tree shape. Unfortunately, s(τ ) does not determine the shape of τ in general. This means that does not induce a partial order on tree shapes. We illustrate this with the following example.
Example 1 The basis for this example are the following two trees: for two (rooted) subtrees T 1 , T 2 on the same number of leaves with different shape. τ and τ are just one NNI-move apart, which means that only two subtrees have to swap their position across one inner edge. Note that τ and τ show the same split size sequences: First of all, both trees contain the splits induced by edges inside T 1 and T 2 , as well as the four splits separating either of the two copies of T 1 or either of the two copies of T 2 from the rest of the tree. However, τ and τ are different because they differ in the split induced by the central edge: this split separates the two copies of T 1 from the two copies of T 2 in τ and thus differs from the edge separating one copy of both T 1 and T 2 from another copy of T 1 and T 2 . But even for these two splits the split size is the same, namely n/2, because T 1 and T 2 have the same number of leaves. Clearly, τ and τ differ in shape if T 1 , T 2 do so. The simplest situation is for |T 1 | = |T 2 | = 4, because for fewer than 4 leaves, there is only one rooted binary tree shape, respectively. However, for 4 leaves we have the following two distinct trees: .
So τ and τ have the same split size sequence but differ in shape. By exhaustive search we found different (more complex) tree shapes with the same split size sequence already for n = 11 2 . For n ≤ 10, all binary trees with the same split size sequence have the same shape.
So far we have analyzed the maximum of S n and have seen that it is achieved uniquely by the caterpillar tree. However, we also want to find the most balanced tree shape(s), i.e. Pareto minima of S n . Surprisingly, they are not unique, as we will demonstrate now. which are depicted in Figure 2. One could think of τ being mostly balanced with respect to the edge 1234|5678 and τ being mostly balanced with respect to the vertex which is incident to the three edges 123|45678, 12345|678 and 123678|45.
For the increasing function f with On the other hand, for the increasing function g with So depending on the underlying increasing function, either tree can be better than the other one. However, that the split size sequences induced by these trees are both Pareto minimal, i.e. that there is no tree which is more balanced than these two trees, can be seen when considering the hypothetical split size sequence (2, 2, 2, 2, 3). This sequence would clearly dominate the above sequences, but (2, 2, 2, 2, 3) / ∈ S 8 : There are only eight leaves, so if there are four splits of size 2, this implies that all leaves should be in cherries. However, this contradicts the existence of a split of size 3. As we have seen above, Pareto minima are not necessarily unique. The above example employed eight leaves. The following example shows that for n = 12, there are even more Pareto minima, namely three.
We explicitly calculated the number of Pareto minima of S n up to n = 22 3 . Surprisingly, the number of Pareto minima is not monotonical, see Figure 3. The sequence of the numbers of Pareto minima had not been contained in the online encyclopedia of integer sequences before we submitted it, which means that it seems to be unrelated to problems inducing other known integer sequences. It can now be found as sequence A275882 in [20].
Next we want to focus on NNI-moves and the neighborhoods they induce.
Definition 2 Let f be increasing. Then τ ∈ T 2 n is called an NNI-local minimum of Φ f if for τ in the 1-NNI-neighborhood of τ , i.e. in the set of trees which can be reached from τ by performing one NNI-move, we have Φ f (τ ) ≥ Φ f (τ ).
Using an analogous argument for the other possible tree τ containing split σ = X 1 ∪ X 4 |X 2 ∪ X 3 leads to the desired result. (3) is just NNI-local minimality with respect to the function f (k) = k.

Remark 2 Note that
We now consider the role of NNI concerning the Pareto minima discussed earlier.
Lemma 3 Let f be an increasing function. Let τ ∈ T 2 n for some n ∈ N such that s(τ ) is a Pareto minimum. Then, τ is a local NNI minimum.
Proof: Any NNI-move changes at most one split size. Thus, Inequality (3) follows immediately from Pareto minimality of s(τ ).
We are now in the position to state the following proposition.
Proposition 1 Let f be strictly increasing. Then for any minimal point τ ∈ T 2 n of Φ f , the split size sequence s(τ ) is a Pareto minimum of S n .
Now let τ ∈ T 2 n be such that τ dominates τ , i.e. τ τ , i.e. s(τ ) i ≤ s(τ ) i for all i = 1, . . . , n − 3. This immediately implies So altogether, this gives us which is a contradiction and thus completes the proof.
Following the convention of [23], we call a tree τ semi-regular, if for all representations with (without loss of generality) n 1 ≤ n 2 and n 3 ≤ n 4 , we additionally have n 2 ≤ n 3 or n 4 ≤ n 1 .
There is a unique semi-regular tree shape for every n ≥ 4 which is completely characterized [11]. (3) is just semi-regularity of τ as defined above and in [23], but restricted to adjacent vertices.

Remark 3 Inequality
We are now in the position to state and prove the following theorem.
Proof: First observe that we can extend f to a concave function f : {1, . . . , n − 1} → R ≥0 with f (n − k) = f (k). Now consider a tree of the form depicted in (4) and assume n 2 > n 3 and n 4 > n 1 . Fix the trees We set now λ = n2−n3 n2−n3+n4−n1 , and z j = j m=1 y j where z 0 = 0. This way we obtain from strict concavity and Thus, at least one of Φ f (τ 1 ) or Φ f (τ 2 ) is less than Φ f (τ ). This contradicts minimality of τ , so the assumption was wrong. This leads to the desired result.
Remark 4 Note that the trees τ 1 , τ 2 are exactly at NNI distance 2k + 1 from τ . This is due to the fact that we first need to move the subtree with taxon set X 2 (or X 1 in case of τ 2 , respectively) across all k + 1 inner edges on the path between X 1 and X 4 . The last of these moves can be used to swap X 2 and X 3 (or X 1 and X 4 , respectively), which is why we then only need k more moves to get X 3 (or X 4 , respectively) across these inner edges into the right position.
Furthermore, this example shows that the size of the NNI-neighborhood for one NNI-move is not sufficiently large for minimality (and maximality) for n ≥ 8, as the minimum (or maximum) might be further away than just one NNI-step. This is consistent with the empirical observation that tree search algorithms using too small NNI-neighborhoods often get stuck in local minima [10,Section 3.3]. Note that it looks like strict concavity is not needed, but we are still lacking a more general proof for this case.
Example 4 Also for non-concave f the semi-regular pattern can be the minimal point. For n = 12 we saw that there are 3 different Pareto minima. For the convex function f (k) = k 2 we obtain the values 72, 79, 88 for the split sequences in (2). This means the semi-regular pattern (2, 2, 2, 2, 2, 2, 4, 4, 4) is still the minimizer.
We conclude this section with the following lemma which is used in a later example.
Proof: Let σ be the split the size of which is s(τ ) n−3 . Consider the edge e of τ corresponding to σ. Note that e splits τ into two parts, which we call the left-hand part and the right-hand part.
Moreover, e must be an inner edge (as n ≥ 4 and thus there is at least one inner edge giving rise to one non-trivial split, so the split of size s(τ ) n−3 , which is maximal, has to refer to a non-trivial split). Without loss of generality assume that the left-hand part of τ corresponds to s(τ ) n−3 . Then, the left-hand side end vertex of edge e must have degree 3 (as e is an inner edge). The splits corresponding to the two other edges coincident with this vertex must have a size not larger than s(τ ) n−3 . Thus 3 · s(τ ) n−3 ≥ n and the lower bound is derived. The upper bound is trivial.

Applications
As we already mentioned in the introduction, functionals of the kind analyzed in the present manuscript have recently occurred in various contexts, some of which we want to mention here.

Example 5
In [12] the authors considered the functional which is equivalent to Φ f for f (k) = k · (n − k). They considered the functional only on T 2 n , but for the maximum there is no difference anyway. The application of Theorem 1 is just the same as [12,Lemma 4.1], where we adapted our proof of Theorem 1 from. Further, the minimum is attained for the semi-regular shape, since f is even strictly increasing.
There is also a close relation between Γ(τ ) and the Wiener index of τ as described in the next section, see also [23].

Example 6
Recently, the maximum parsimony distance was defined independently in [8] and [17]. We will now briefly explain this concept before we show how it is related to the topic of this manuscript.
Recall that a character χ is a function χ : X τ → C from the leaf set X τ of τ to an alphabet C. In biology, C often refers to the four nucleotides in the DNA alphabet, but we do not restrict the definition to this case. Then, an extensionχ : V (τ ) → C is a function from the vertex set V (τ ) of τ to C which agrees with χ on the leaf set X. For a character χ with extensionχ, the changing number ofχ, denoted ch(χ), is defined as the number of edges e = {u, v} such thatχ(u) =χ(v), and the parsimony score P S(χ, τ ) is then defined as the minimum number of changes over all extensionsχ of χ on τ , i.e. P S(χ, τ ) = min χ ch(χ). Note that the parsimony score of a character on a binary tree can be easily calculated with the Fitch algorithm [9]. Now, the parsimony distance between two trees τ 1 and τ 2 is defined as follows: d M P (τ 1 , τ 2 ) = max χ |P S(χ, τ 1 )−P S(χ, τ 2 )|. It has been shown [8,13] that it is NP-hard to calculate this distance for two given trees (even if both trees are binary). We now consider neighborhoods induced by this metric.
In [17], the size of the 1-neighborhood of a tree τ ∈ T n with respect to d M P was derived to be where V q (τ ), q = 1, 2, 3 is the set of vertices of degree q after removal of all pendant edges. Clearly, V 1 (τ ) are just all cherries. Unfortunately, |V 2 (τ )| is not of the form Φ f , but we can provide bounds on the minimal and maximal values, since we have To be precise, consider the parametric functions We observe 4Γ(τ ) − c|V 1 (τ )| = Φ fc (τ ) such that c = 2 helps in deriving a lower bound for n p , c = 6 for the upper bound likewise. For all c < 2n + 2, f is strictly increasing and concave. Note that for binary trees, the first instance with more than one unrooted tree shape is for n = 6 leaves. So for c = 2, 6, we find maximal values of Φ fc at caterpillars and its minimal values at semi-regular shapes. Those values for c = 2, 6 can be used to bound n p (τ ).
Note that if you restrict the parsimony distance to binary characters, denoted d 2 M P , and define f (τ ) = d 2 M P (τ, τ 0 ), where τ 0 denotes the star-tree, i.e. the tree with no inner edges, then by Lemma 4, we have f (τ ) ≤ n/2 − 1 and f (τ ) ≥ n/3 − 1. It can easily be seen that f is maximized by all trees containing an edge inducing a split σ = A|B with |A| = n/2 and |B| = n/2 . This is due to the fact that if a binary character contains, say, |A| taxa in state a and |B| taxa in state b, the parsimony score on the star-tree will be precisely min{|A|, |B|}, because the root state will be chosen to be the state that occurs most often in the character, and all other taxa require changes. Of course min{|A|, |B|} is maximized when |A| = n/2 and |B| = n/2 (or vice versa). On the other hand, a binary character contains precisely two states, so at least one change is always needed. So f (τ ) = d 2 M P (τ, τ 0 ) ≤ n/2 − 1, where equality is achieved if and only if τ contains the split corresponding to a binary character with n/2 many a's and n/2 many b's (otherwise, the parsimony score on τ would be strictly more than 1).
Thus, all trees containing an edge inducing a split σ = A|B with |A| = n/2 and |B| = n/2 maximize f . For instance, caterpillar trees have this property, but they are not the only ones. On the other hand, f is minimized by all trees containing a node which is adjacent to three subtrees of size at least n/3 . Therefore, the minimum is not unique, either.
Example 7 Consider the functional τ → |V 1 (τ )|, the number of cherries. Clearly, this functional is equal to Φ f taking Since f is decreasing and convex (on {2, . . . , n/2 }), the minimum number 2 of cherries is attained by caterpillars only. The maximal number of cherries is yielded by the semi-regular shapes. As stated before, this functional is directly related to the so-called cherry tree balance index for rooted trees [22].
Example 8 Another application are estimates of the diameter of T n with respect to the Gromovtype p -distances on T n introduced in [15] for p = 1, 2. We do not want to repeat the lengthy definition of these distances here. It is enough to note that Example 3 from that paper computed D p (τ, τ ) if τ and τ differ by one split, say A|B. Then D p (τ, τ ) = min(|A|, |B|) for p = 1, |A| · |B|/n for p = 2.
At least, Theorem 1 supports now the conjecture that the maximal distance is attained between two caterpillars. But note that we are just dealing with upper bounds on the diameter here.
This functional is not of the form Φ f . Still, it is increasing with respect to ≺. Its extremal values n/2 , n/3 were derived in Lemma 4. By the previous section, they are achieved by caterpillars (cf. Theorem 3) and some Pareto minimum cf. Examples 2 and 3), possibly among others.

Discussion
We derived necessary and sufficient criteria to compute minimal and maximal points of the functionals Φ f . There were a lot of specific functionals of this kind considered in the past, see the previous section. By our theory, it is now less surprising that quite often caterpillars yielded maximal values and the semi-regular trees yielded minimal ones. But, we also saw that sometimes the minimum of Φ f could be achieved by a different Pareto minimum. So the set of split size sequences S n and their Pareto minima seems quite interesting to study. For instance, it would be nice to know whether all Pareto minima, not only the semi-regular one, correspond to a unique tree shape.
The Γ−index from Example 5 is closely related to the Wiener index of graphs, it is its leafrestricted form. Indeed it holds that: where d τ is the metric induced by τ and L(τ ) are the leaves of τ , see [23]. This kind of index is a shape invariant of τ .
It is easy to see that we can derive a whole family of similar topological indices if we introduce another metric on the tree, still just depending on the shape of τ . More precisely, introduce for any σ ∈ Σ(τ ) a weight w(σ, τ ) = g( σ ) ≥ 0 and the corresponding (semi-)metric d w τ on L(τ ). Then, setting we obtain Γ w (τ ) = Φ f (τ ) for f (k) = g(k)k(n − k). If g is increasing, f is increasing as well. Unfortunately, concavity is not so easy to derive. Nevertheless, our theory will apply to many of these Γ w −indices.
Clearly, these indices are linear in d τ . It is easy to derive similar functionals which are quadratic in d τ or depending on triple partitions A|B|C compatible with the tree τ . For instance, the functional Φ(τ ) = |V 2 (τ )| from Example 6 is of this kind. It would be quite valuable to extend our theory to this type of functionals.