On the Complexity of Computing MP Distance Between Binary Phylogenetic Trees

Within the field of phylogenetics there is great interest in distance measures to quantify the dissimilarity of two trees. Recently, a new distance measure has been proposed: the Maximum Parsimony (MP) distance. This is based on the difference of the parsimony scores of a single character on both trees under consideration, and the goal is to find the character which maximizes this difference. Here we show that computation of MP distance on two binary phylogenetic trees is NP-hard. This is a highly nontrivial extension of an earlier NP-hardness proof for two multifurcating phylogenetic trees, and it is particularly relevant given the prominence of binary trees in the phylogenetics literature. As a corollary to the main hardness result we show that computation of MP distance is also hard on binary trees if the number of states available is bounded. In fact, via a different reduction we show that it is hard even if only two states are available. Finally, as a first response to this hardness we give a simple Integer Linear Program (ILP) formulation which is capable of computing the MP distance exactly for small trees (and for larger trees when only a small number of character states are available) and which is used to computationally verify several auxiliary results required by the hardness proofs.


Introduction
When present day species are considered and their evolutionary relationships are to be investigated, phylogeneticists often seek to estimate the best evolutionary tree explaining the given species data (e.g.DNA alignments).However, it is well known that different data sets on the same species can lead to different trees, or that different phylogenetic tree estimation methods, like e.g.Maximum Parsimony or Maximum Likelihood or distance based methods, can lead to different trees even for the same data set [6,10].Thus, in practice one is often confronted with multiple trees, and it is therefore interesting to measure how different these trees really are.A new way of determining their relative similarity has recently been proposed [5]: the Maximum Parsimony distance (or MP distance, for short).This metric basically requires the search for a character which has a low parsimony score on one of the trees involved and a high score on the other one.
In [5] it has been shown that calculating the MP distance between two trees is NP-hard.The proof presented there required non-binary trees (sometimes also called multifurcating trees).This was not entirely satisfactory, for the following reason.In many branches of phylogenetics multifurcating trees are used to model uncertainty about the precise order of branching events [13], in which case the term unresolved is often used instead of multifurcating.Distance measures which interpret multifurcations this way often have the property that the distance decreases, or in the worst case stays the same, if one or both of the input trees become more unresolved [11].However, the parsimony score of a single tree increases (or in the best case stays the same) if its edges are contracted to create multifurcations.This is why algorithms that compute Maximum Parsimony trees usually output binary trees: a nonbinary solution can be refined into a binary solution without loss of quality.Given this traditional emphasis on binary trees in the parsimony literature, and the fact that evolutionary events such as mutation or speciation are understood to split a lineage into two parts, not three or more [8], it is logical to explore the complexity of MP distance on binary trees.
In this paper, we answer this question by showing that computing the MP distance between two binary trees is, unfortunately, also NP-hard.This is by no means a simple extension of the hardness proofs in [5].To prove hardness in the present case we are required to develop a rather elaborate array of novel gadgets and arguments, with a strong graph-theoretical flavour.
Moreover, we show as a corollary to the main theorem that this hardness remains if we restrict the number of character states to four (or more).Note that this covers the most important biological applications, as the DNA and RNA alphabets consist of four character states each, and the protein alphabet consists of 20 states.However, when morphological data is analyzed, binary characters are also often relevant, which is why we consider this case, too.
We show that when restricted to two character states, calculating the MP distance is not only also NP-hard, but even APX-hard, which means that there exists a constant c > 1 such that a polynomial-time c-approximation is impossible unless P = N P .
As a tentative first step towards addressing the NP-hardness of the MP distance, we present a simple Integer Linear Program (ILP) which calculates this distance (both on a bounded number of states as well as in the unbounded case).The ILP is rather "explicit" in the sense that it has a static, constraintbased formulation of Fitch's algorithm embedded within it.Although faster than naive brute force algorithms, the ILP for an unbounded number of states does not scale well and is limited to trees with approximately 16 taxa.On the other hand, the ILP for binary characters is fast: it can cope with trees with up to 100 taxa in reasonable time.In both cases the ILP is fast enough to verify the MP distance of a number of gadgets used in the hardness proofs.An implementation of this ILP has been made publicly available at http://skelk.sdf-eu.org/mpdistbinary/[12].

Notation
Recall that an unrooted phylogenetic X-tree is a tree T = (V (T ), E(T )) on a leaf set X = {1, . . ., n} ⊂ V (T ).Such a tree is named binary if it has only vertices of degree 1 (leaves) or 3 (internal vertices).A rooted phylogenetic Xtree additionally has one vertex specified as the root, and such a rooted tree is named binary if the root has degree 2 and all other vertices are of degree 1 (leaves) or 3 (internal vertices).Note that two leaves are said to form a cherry, if they are connected to the same inner node.Moreover, a rooted binary tree on three taxa is also often referred to as a rooted triplet, and a rooted tree with only one cherry is also called a caterpillar tree or caterpillar for short.We often denote trees in the well-known Newick format [4], which uses nested parentheses to group species together according to their degree of relatedness.For instance, the tree ((1, 2), (3,4)) is a tree with two so-called cherries (1,2) and (3,4) and a root between the two.Furthermore, recall that a character f is a function f : X → C for some set C := {c 1 , c 2 , c 3 , . . ., c k } of k character states (k ∈ N).Often, k is assumed to equal 4 in order for C to represent the DNA alphabet {A, C, G, T }, but in the present paper k is not restricted this way but can be any natural number unless stated otherwise.Note that in the special case where |f (X)| = 2, we also refer to f as a binary character.In general, when |f (X)| = r, f is called an r-state character.In order to shorten the notation, it is customary to write for instance f = AACC instead of f (1) = A, f (2) = A, f (3) = C and f (4) = C.Note that each r-state character f on taxon set X partitions X into r non-empty and non-overlapping subsets X i , i = 1, . . ., r, where x j , x k ∈ X i if and only if f (x j ) = f (x k ).
Note that in this paper, we refer to a character always with its underlying taxon set partition in mind, i.e. for instance we do not distinguish between AACC, CCAA and CCGG, and so on.Moreover, when there is no ambiguity and when the stated result holds for both rooted and unrooted trees, we often just write 'tree' or 'phylogenetic tree' when referring to a phylogenetic X-tree.
An extension of a character f to V (T ) is a map g : V (T ) → C such that g(i) = f (i) for all i in X.For such an extension g of f , we denote by l g (T ) the number of edges e = {u, v} in T on which a substitution occurs, i.e.where g(u) = g(v).Such substitutions are also often referred to as mutations or changes.The parsimony score or parsimony length of a character f on T , denoted by l f (T ), is obtained by minimizing l g (T ) over all possible extensions g of f .For binary trees T , the parsimony score of a character f can easily be calculated with the Fitch algorithm [7].Recall that the bottom-up phase of Fitch starts at the labelled leaves and assigns to the unlabeled parent of two nodes the intersection of both children's label set if it is non-empty, or the union otherwise.The top-down phase then starts at the root with an arbitrary choice of the root states suggested by the bottom-up phase and keeps the current state for the descending nodes whenever this is contained in the label set of these nodes, and takes an arbitrary state out of the label set otherwise.This paper deals with the so-called parsimony distance d MP as introduced in [5].This distance is defined as follows: Given two phylogenetic trees T 1 and T 2 on the same set X of taxa, the parsimony distance between these trees is defined as where the maximum is taken over all characters f on X.A character f which maximizes this distance is called an optimal character.Note that, due to the fact that the parsimony score of a tree (for a given character) is not affected by the presence or absence of a root, parsimony distance is also oblivious to whether the input trees are rooted or unrooted.
For some proofs in this paper we need the notion of a maximum agreement forest, which is closely linked to the so-called rooted subtree prune and redraft distance or rSPR distance for short.Recall that, informally, an agreement forest of two rooted phylogenetic trees is a set of subtrees which are identical in both trees and which in total contain all leaves, see, e.g.[2].A maximum agreement forest is an agreement forest with minimum number of components.A single rSPR move involves moving to a neighboring rooted tree by detaching a branch and re-attaching it elsewhere.The rSPR distance d rSP R is the minimum number of rSPR moves required to transform one rooted tree into another.Maximum agreement forests and rSPR distance are closely linked by the well-known result that, modulo a rooting technicality, an agreement forest of two rooted trees with m components yields a set of m − 1 rSPR moves which turn the first tree into the second one [2].

Preliminaries
The following observation, which we will use extensively and implicitly throughout the article, appeared unchanged in our earlier work [5].
Observation 3.1.Let f be a character on X and T a tree on X.Let f ′ be any character obtained from f by changing the state of exactly one taxon.Then l f (T ) − 1 ≤ l f ′ (T ) ≤ l f (T ) + 1 i.e. the parsimony score can change by at most one.
Proof.Suppose l f ′ (T ) ≤ l f (T ) − 2. Consider any extension of f ′ to the interior nodes of T that achieves l f ′ (T ) mutations.Using the same extension but on f gives at most l f ′ (T ) + 1 mutations, because only one taxon changed state.So l f (T ) ≤ l f ′ (T ) + 1 ≤ l f (T ) − 1, which is a contradiction.In the other direction, take any optimal extension of f and apply it to f '.At most one extra mutation will be created, so l f ′ (T ) ≤ l f (T ) + 1.
A more general version of the following lemma appeared earlier in [5].
Here we have specialized the lemma and its proof to apply to rooted binary trees, which is the type of trees we will construct in the subsequent hardness reductions.Lemma 3.2.Let f be an optimal character for two rooted, binary trees T 1 and Without loss of generality assume l f (T 1 ) < l f (T 2 ).Then we can construct in polynomial time an optimal character f ′ with the following property: l f ′ (T 1 ) < l f ′ (T 2 ) and for each vertex u of T 1 such that both u's children are leaves (i.e. they form a cherry), f ′ assigns both children of u the same state.
Proof.Consider a vertex u of T 1 such that both of its children are taxa, but such that f assigns the two children different states.We calculate an optimal extension of f to the interior nodes of T 1 by applying Fitch's algorithm.Let s be the state allocated to u by the top-down phase of Fitch.Choose the child of u that does not have state s and change its state to s.This yields a new character f * .Clearly, l f * (T 1 ) < l f (T 1 ), simply by using the same extension that Fitch gave.Combining this with Observation 3.1 gives l f * (T 1 ) = l f (T 1 ) − 1 and thus l f * (T 2 ) = l f (T 2 ) − 1 (otherwise f could not have been optimal).Hence, f * is also an optimal character, and l f * (T 1 ) < l f * (T 2 ).This process can be repeated for as long as necessary.Termination in polynomial time is guaranteed because each taxon has its state changed at most once.Observation 3.3.Lemma 3.2 also holds for optimal characters under the Proof.The transformation in the proof of Lemma 3.2 does not increase the number of states in the character.

The symmetry-breaking construction
In the hardness proof in Section 4.2 we will construct two trees T E and T V and a central fact used in the proof of correctness of the reduction is that, for all optimal characters f , l f (T E ) < l f (T V ).In this section we show how to construct a gadget to enforce this property.Note that all the trees constructed in this section are binary.(As we demonstrated in [5] constructing such a symmetry-breaking gadget is far easier in the non-binary case).Expressed differently: there does not exist any optimal character f for which l f (T a ) > l f (T b ), so the instance is "asymmetric".For two trees T 1 and T 2 , let where f ranges over all characters (not just optimal ones).Note that gap(T a , , where e.g. the character We now describe an iterative construction such that, for any desired gap g, we can construct two trees T 1 and T 2 , both on O(g) taxa, such that gap(T 1 , T 2 ) ≥ g.
We start with T a and T b .Let T A be the rooted tree on 12 taxa obtained by taking two disjoint copies of T a and joining them together via their roots ρ 1 , ρ 2 to a newly introduced root ρ. (Here, the copying operation is assumed to introduce new taxon labels to prevent the same taxon occuring twice in the same tree).T B is defined the same way, but with respect to T b .
Proof.We will show that max from which the claim will follow.Let f be a character such that l f (T a )+2 = l f (T b ), i.e. f is an optimal character for T a , T b .We extend character f to become character F on T A , T B in the natural way i.e. disjoint copies of the same taxon receive the same character state.If we run the bottom-up phase of Fitch's algorithm on T A and T B , we observe that each copy of T a induces 2 fewer mutations than its corresponding copy of T b .Moreover, the set of states identified (by Fitch's bottom-up phase) to be possible at ρ 1 will be equal to the set of states identified to be possible at ρ 2 , so there will be no mutations incurred in T A on the two edges incident to its root ρ.By the same argument, there will be no mutations incurred in T B on the edges incident to its root.Hence, l F (T B ) − l F (T A ) ≥ 4. Showing max f (l f (T A ) − l f (T B )) ≤ 2 is possible analytically but it is technical.We therefore omit the proof, noting however that we have used an exhaustive computational search to verify that (a) max f (l f (T B ) − l f (T A )) = 4, where the maximum is reached e.g. by , where the maximum is reached e.g. by f = AABBAAAABBAA.Note that our ILP described in Section 6 can also be used to verify the claim.The computational search thus allows us to draw the slightly stronger conclusion that gap(T A , T B ) = 2.

Let T k
A be the rooted tree on 12k taxa obtained by arranging k disjoint copies of T A along a caterpillar backbone.That is, Proof.By extending the character F to T 2 A , T 2 B in the usual fashion, and using the same Fitch-based argument as in the previous proof, we see that max f (l f (T 2 B )−l f (T 2 A )) ≥ 8.One the other hand, due to the fact that max f (l f (T A )− l f (T B )) ≤ 2, the total number of mutations incurred inside the two copies of T A can in total be at most 4 more than the total number of mutations incurred inside the two copies of T B .In the worst case, T 2 A can perhaps also suffer a single mutation on the two edges incident to the root, while Proof.We prove this statement by induction.For k ∈ {1, 2} the lemma has already been proved, so assume k ≥ 3.By continuing the arguments used in the previous claims, we see that where the 1 in the second expression accounts for the possibility that in T k A a mutation is incurred on one of the root edges, while no such mutation is incurred in T k B .Combining the above with the fact that max )) ≤ 5, we obtain the desired result.
In addition to Lemma 4.3, we actually also need to know a (polynomialtime computable) expression for d MP (T k A , T k B ). Conveniently, we have a closed expression for this.
Proof.From the proof of Lemma 4.3 we know that ). Due to the recurrence shown in the proof of that lemma we see, To do this, we exploit the fact (proven in [5] MP distance is a lower bound on the well-known rooted subtree prune and regraft (rSPR) distance.In particular, we prove that d rSP R (T k A , T k B ) ≤ 8 + 4(k − 2).We do this by showing that T k A , T k B permit an agreement forest with at most 8 + 4(k − 2) + 1 = 4k + 1 components.(It is well-known that an agreement forest with m components yields a set of m − 1 rSPR moves that turn one tree into the other, see [2]) 2 .Now, observe that T k A , T k B contains 4 + 2(k − 2) = 2k copies of the original T a , T b trees.Next, observe that an agreement forest for T a , T b with 3 components can be obtained by placing taxon 3 and taxon 6 each in a singleton component, and {1, 2, 4, 5} in the remaining component.To obtain an agreement forest for T k A , T k B we put all copies of taxon 3 and all copies of taxon 6 in singleton components, yielding 4k singleton components.All remaining taxa can be placed in one large component, yielding 4k + 1 components in total.
Finally, we consider the following auxiliary observation, which will be useful later.
Observation 4.5.For each k ≥ 2, there exists an optimal character f k on T k A , T k B such that f k has 3 states, and there exist optimal extensions of f k to both trees, such that the roots of T k A , T k B both receive the same state.
Proof.As noted earlier, f asym = GAACCG is an optimal character for T a , T b and permits optimal extensions such that the roots of both trees can be assigned state G.We can obtain an optimal character f k on T k A , T k B simply by making 2k copies of f asym .The optimality of f k follows from the fact that f asym is optimal for T a , T b and that Claim 4.1 holds for any optimal character.Given that each copy of T a and T b can have state G allocated to its root, it follows (by continuing the bottom-up phase of Fitch on the remainder of T k A and T k B ) that there exist optimal extensions of f k such that the roots of T k A and T k B are both allocated state G.

The reduction
In this section we exclusively consider simple undirected graphs.Recall that a graph G = (V, E) is cubic if every vertex has degree exactly 3, in which case |E| = 3|V |/2.A proper edge colouring of a graph G is an assignment of colours to the edges such that no two adjacent edges have the same colour, where two edges are adjacent if they have a common endpoint.Let χ ′ (G), the chromatic index of G, be the minimum number of colours required to properly colour the edges of G.The classical result of Vizing (see any standard graph-theory text, such as [3]) states that for every graph where ∆(G) is the maximum degree of a vertex in G. Hence, for cubic G, χ ′ (G) ∈ {3, 4}.Even for cubic graphs it is NP-hard to distinguish between these two possibilities [9].Proof.Let G = (V, E) be a cubic graph where n = |V |.We give a polynomialtime reduction from computation of χ ′ (G) to computation of d MP , from which NP-hardness will follow.Specifically, we will construct two trees T E and T V such that, for a certain integer P , d MP (T E , T V ) = P if and only if χ ′ (G) = 3.In particular, if χ ′ (G) = 4, then d MP (T E , T V ) will be P − 1 (or less).An important difference with Theorem 4.6 of [5] is that here optimal characters f will be engineered to always have the property and not the other way round.Informally, at optimality T E always "wins".
The high-level idea is that in T E we will choose the colours of the edges of G.In fact, for each edge we will choose three colours, all different, representing the colour of e in three different copies of G. Due to the way we construct the two trees, there will exist optimal characters in which the edge colouring (in each of the three copies of G) is proper.This is because, the closer an edge colouring is to being proper, the higher the parsimony score induced in T V .Within the space of proper edge colourings, we will show that it is advantageous to use as few colours as possible, because this will give the character a low parsimony score on T E .Leveraging the fact that the colours used for the three copies of each edge are all different, we will derive the conclusion that d MP can reach a certain value P if and only if there is a proper edge colouring that uses only 3 colours i.e. that χ ′ (G) = 3.We will prove the following: Let M be a large integer, at most polynomially large in n, whose value we will specify later.Letting k = M , construct T k A , T k B (as described in the previous section).Relabel The core ingredients of T E are the subtrees B, S E and T * * * .We construct B by taking an arbitrary rooted binary tree on 3|V | + |E| taxa.By appending an extra taxon α just above its root, we create a new root yielding 3|V | + |E| + 1 taxa in total.Note that since α is not a taxon of B, in the following we refer to B including α or B without α to stress whether or not α is considered together with B or not.
Tree T * * * is constructed as follows.Fix an arbitrary rooted binary tree T * on |E| leaves, identifying the leaves with elements of E. Replace each leaf u e of T * , where e ∈ E, with a rooted triplet to obtain T * * on 3|E| leaves u e,j where e ∈ E and j ∈ {1, 2, 3}.Finally, replace each leaf u e,j of T * * with a rooted triplet on three taxa x u e,j , x v e,j and x edge e,j where u, v ∈ V are the two endpoints of e.We ensure that x u e,j , x v e,j are sibling to each other (i.e.form a cherry).This is T * * * , which is depicted in Figure 2, and it has thus 9|E| taxa.The basic idea is that each edge e = {u, v} occurs 3 times in total, and each such occurrence consists of a cherry representing u and v, and an extra taxon ("edge" ) sitting just above the cherry.
The construction of T E is concluded by joining B including α, S E and T * * * as shown in Figure 3, which also introduces auxiliary taxa β 1 , β 2 , γ 1 , γ 2 .We adopt the labels used in that figure.Summarizing, T E contains To construct T V we start by taking B and attaching S V on the edge entering taxon α.Now, let Clearly, |H| = 3|V | + |E|.Pick an arbitrary bijection between the taxa of B (excluding α) and the elements of H.For each edge e ∈ H, introduce a rooted triplet on the three taxa x edge e,1 , x edge e,2 , x edge e,3 and attach this rooted triplet on the edge entering the taxon of B corresponding to e.For each tuple (v, j) ∈ H, let {e, e * , e * * } be the 3 edges incident to v in G, introduce a rooted triplet on the three taxa x v e,j , x v e * ,j and x v e * * ,j , and attach this rooted triplet on the edge entering the taxon of B corresponding to (v, j).Finally, The tree TE .Taxon α is closely linked to subtree B as it is descending from the same root as B in TE .This root is considered in the proof.However, in TV , α shares a direct common root with SV , not B.
we introduce a new root and join B to the new subtree on ((β 1 , γ 1 ), (β 2 , γ 2 )).This completes the construction of T V , which is depicted in Figure 4.
We are now in a position to specify the number M .We require M to be sufficiently large that, for every optimal character f , l f (T E ) < l f (T V ).From Lemma 4.4 we know that there exists some character f ′ such that (In particular, we can obtain such a character by -for example -extending the character suggested by Lemma 4.4 such that all taxa outside S E and S V are assigned the same state.)Now, let t be the number of edges in T E that lie outside S E .For every character f we have The 4M term is obtained from Lemma 4.4, the (M + 1) term from Lemma 4.3, and the t term arises (pessimistically) from the situation when every edge in T E (outside S E ) incurs a mutation, but no edge in T V (outside S V ) incurs a mutation.So, if we choose M such that Choosing M = t is therefore sufficient to achieve this.This "symmetry breaking" has far-reaching consequences which we shall heavily utilize later.
Next, let f S be any 3-state character on the taxa in S E and S V such that ).This character exists and x edge e,1 x edge e,2 x edge e,3 α can be constructed in polynomial time thanks to Observation 4.5.Recall, in particular, that it is constructed by making many disjoint copies of the character f asym = GAACCG.Now, suppose χ ′ (G) = 3.We will extend f S to all the taxa in T E as follows, obtaining a 4-state character.Take any proper edge colouring Col of graph G using three colours red, blue and green.We start by relabelling f S as follows: character state G maps to blue, A maps to red and C maps to green.Next, colour all the taxa in B including α pink.Colour the cherry {β 1 , β 2 } pink and the cherry {γ 1 , γ 2 } blue.
Next, consider the following cyclical mapping F : Now, for every e ∈ E, j ∈ {1, 2, 3} and letting e = {u, v}, we assign x u e,j , x v e,j and x edge e,j all the same colour: the colour F (Col(e), j) where as usual Col(e) is the colour assigned to e by the proper edge colouring Col.
Let this character be called f Col .Observe, This can be confirmed by applying Fitch's algorithm.Note, in particular, that there is an optimal extension such that all the internal nodes of the tree B (including α) are coloured pink, all the nodes of the T * part of T * * * are blue, p 2 is blue, the root is blue, and all the unlabelled nodes are blue.The +1 is then the mutation in the transition from pink to blue on, for example, the edge between the cherries {β 1 , β 2 } and {γ 1 , γ 2 }.There is no mutation on the edge entering the root of S E because, by Observation 4.5 and the way we relabelled f S , there is an optimal extension of S E in which its root is permitted to be blue.Also, The +1 term here is definitely incurred because there is an optimal extension in which the root of T V and α are both coloured pink, but pink is not used in f S , so there will then be a mutation on the edge entering the root of S V .The +2 term corresponds to mutations incurred in the β 1 , β 2 , γ 1 , γ 2 region of T V .Now, define P as follows: . Once these facts have been established NP-hardness will follow.
We approach this by starting from an arbitrary optimal character f and then transforming f step by step such that we do not lose optimality but the character attains a certain canonical form.This canonical form will be attained by accumulating one special property at a time.In all cases the argument that a new property can be obtained, is based on the assumption that all earlier properties have already been accumulated.Properties are never lost, and each property can be attained in polynomial time.Thus, given an arbitrary optimal character we can transform it in polynomial time into a character that has all the described properties.The proofs of the following properties can be found in the Appendix (unless stated here).
Property 1.All cherries in T E are monochromatic.That is, if {x, y} are two taxa that share a parent in T E , then both are assigned the same colour (i.e.state).
Proof.This is possible by combining Lemma 3.2 with the fact (established earlier) that, for every optimal character f , l f (T E ) < l f (T V ).

Property 2.3
In T E , all the taxa in B have the same colour which, with the possible exception of β 1 , β 2 , does not appear on taxa outside B and α.
Property 3. In T E , all the taxa in B have the same colour, and cherry {β 1 , β 2 } also has this colour.Moreover this colour does not appear on any other taxa i.e. it is unique for B (including α) and β 1 , β 2 .
From now on we refer to the unique colour used by B (including α), β 1 and β 2 as pink.Property 3 is extremely important.In particular, it means that from now on we can assume the existence of optimal extensions of T V such that the root of T V is coloured pink and, moreover, that the entire image of B inside T V is coloured pink.We call these pink extensions.These greatly simplifies the task of counting mutations inside T V .In particular, it means that we from now on (in T V ) only need to consider mutations incurred inside the subtrees sibling to the taxa of B, which we call below pink subtrees.These subtrees never contain pink taxa.Property 4. Let f be an optimal character with properties 1-3 and let f * be the restriction of f to the taxa in S V and S E .Then Proof.Fix a pink extension of f .From the earlier properties, f * does not contain any pink taxa.Now, taxon α is coloured pink, because α is a taxon of B. This means that, in T V , there is unavoidably a mutation on the edge entering the root of S V .Moreover, we know that there exist optimal characters for S E , S V in which the roots of S E and S V can be allocated the same colour blue: this is the 3-state character f S that we constructed at the start of the proof.This means that, without loss of optimality, we can assume f * = f S , where we are free to (and should) relabel the blue inside f S such that in T E no mutation is incurred on the edge entering the root of S E .(This can be achieved by running the bottom-up phase of Fitch on the subtree sibling to S E in T E , identifying the set of colours permitted by Fitch at the root of the subtree, and arbitrarily picking one of those colours as the relabelling colour).Optimality is assured because (1) (2) we force a mutation at the root of S V and (3) we definitely avoid a mutation at the root of S E .
Property 5. (a) For every edge e = {u, v} ∈ E the three taxa x edge e,1 , x edge e,2 , x edge e,3 all have distinct colours.Moreover, (b) x edge e,1 , x u e,1 , x v e,1 all have the same colour, x edge e,2 , x u e,2 , x v e,2 all have the same colour, and finally x edge e,3 , x u e,3 , x v e,3 all have the same colour.
Proof.First, suppose for some e ∈ E there exists j, j ′ ∈ {1, 2, 3} such that j = j ′ and x edge e,j , x edge e,j ′ have the same colour.Observe that x edge e,1 , x edge e,2 , x edge e,3 all form a single below pink subtree in T V .Suppose we recolour x edge e,j to some brand new colour.This raises the parsimony score of T E by at most 1.However, it also raises the parsimony score of T V by at least one, due to the introduction of a new colour into the corresponding below pink subtree.
Hence the recoloured character is optimal.We can repeat this as long as necessary to ensure that (a) eventually holds.Now, suppose for some e ∈ E and j ∈ {1, 2, 3} the taxa x edge e,j , x u e,j , x v e,j do not all have the same colour.By Property 1 we know that x u e,j and x v e,j have the same colour, because they form a cherry in T E .We recolour all 3 taxa with a brand new colour.This cannot raise the parsimony score of T E .On the other hand, it cannot lower the parsimony score of T V , because the three now uniquely coloured taxa all occur in different below pink subtrees of T V .Hence the recoloured character is optimal, and (a) is still holding.We repeat this as long as necessary to ensure that (b) eventually also holds.Property 6.For every j ∈ {1, 2, 3}, the edge colouring induced by the colours of the x edge e,j taxa (e ∈ E), is a proper edge colouring.
Recall that, by Property 5, each x edge e,j taxon has the same colour as the x u e,j and x v e,j taxa below it in T E .Suppose that there is some j ∈ {1, 2, 3} for which the induced edge colouring is not proper.Then there exists some u ∈ V and two edges e = e ′ in E incident at u such that x u e,j and x u e ′ ,j both have the same colour.Both these taxa are together in a below pink subtree of T V .This subtree therefore currently induces m < 2 mutations (excluding the mutation as the subtree touches the pink region).Now, suppose we introduce a brand new colour and recolour x u e,j , x v e,j and x edge e,j with it.This raises the parsimony score of T E by at most 1.However, it definitely also raises the parsimony score of T V , by at least 1, because the aforementioned below pink subtree now induces m + 1 mutations (due to the introduction of a new colour).Hence the new character is optimal, and all earlier properties are preserved.We can repeat this process until the induced edge colouring is proper.
Property 7.For an optimal character f , Proof.This is a consequence of the fact that (from Property 6) we can assume that in T V a proper edge colouring is induced, plus the fact that a pink extension is an optimal extension.In particular, the proper edge colouring means that each of the 3|V | + |E| below pink subtrees induces 2 mutations on its internal edges and a third mutation where the subtree touches the pink region.The '2' term corresponds to the fact that the two taxa γ 1 , γ 2 are necessarily not pink.The '1' term is the mutation at the root of S V .

Central argument
As a consequence of Property 7, optimal characters (which we always assume to induce proper edge colourings) are only distinguished by their ability to minimize the number of mutations induced in T E .We can already establish a strong lower bound for this number: Every proper edge colouring induces (at least) these mutations in T E .The '1' term is the mutation that occurs between the β 1 , β 2 and γ 1 , γ 2 taxa and the 2|E| term is a consequence of (amongst others) Property 5.
Hence, d MP (T E , T V ) = l f (T V ) − l f (T E ) ≤ P , where P is the value defined earlier in the proof.We have already shown that, if G has χ ′ (G) = 3, P is possible.We now see that this is optimal.The only thing we have left to show, is that if χ ′ (G) > 3, that P is not possible.We use the contrapositive to prove this.In particular, we will show Suppose, then, that l f (T E ) = 1 + 2|E| + l f S (S E ).This means that there are no mutations in the subtree T * * * other than the 2|E| unavoidable mutations due to Property 5. To achieve this it must be the case that all the |E| subtrees (each containing 9 taxa) in T * * * all have a single colour in common.Let us call this colour blue.Hence, for every e ∈ E, there exists exactly one j ∈ {1, 2, 3} such that x edge e,j , x u e,j , x v e,j are all blue.We now build a proper 3-edge-colouring for G.If j = 1, we assign e the colour red.If j = 2, we assign e the colour blue.If j = 3, we assign e the colour green.This must be a proper colouring: if it was not, then there would be some vertex u ∈ V , two incident edges e, e ′ incident to u, and some j ∈ {1, 2, 3} such that x edge e,j and x edge e ′ ,j were both blue.But this would contradict Property 6.Hence, χ ′ (G) = 3.
This completes the proof.Summarising, for a given cubic graph from which the NP-hardness of computing d MP (T E , T V ) on binary trees follows.
Corollary 4.7.For every fixed integer i ≥ 4, computation of d i MP on binary trees is NP-hard.
Proof.This is a consequence of the fact that in the theorem only 4 states are required to construct a character achieving MP distance P .Namely, the 3 colours used in the proper edge colouring of G, plus pink.
Note that the above proof cannot (obviously) be extended to give APXhardness.By taking multiple copies of the tree T * * * it is possible to increase the gap between χ ′ (G) = 3 and χ ′ (G) = 4 instances to more than 1, but this is insufficient for APX-hardness.

Computation of d 2
M P is NP-hard on binary trees.
As in the previous section we first require a gadget that can break symmetry between two trees.Here, it can be verified (e.g. by exhaustive search) that d 2 MP (T a , T b ) = 3, and the character f asym = AAGGGGAA can achieve this: l fasym (T a ) = 1 and l fasym (T b ) = 4.
In fact, these trees are asymmetric, in the sense that for every optimal 2-state character f , l f (T a ) < l f (T b ).In particular, as can be verified by computational search (e.g. using the ILP formulation or performing an exhaustive search), max (The second maximum is achieved by the character AAGAAGGG, for example.)Using the same notation as in Section 4.1, but restricted to characters with at most 2 states, we therefore obtain: From now on we implicitly assume that all characters have at most 2 states.
Define T A and T B in the same way as in Section 4.1.It can be verified that gap(T A , T B ) ≥ 1.This is not yet strong enough for what we require, so let T AA and T BB be obtained by joining two copies of T A , and two copies of T B , together (respectively).Claim 5.1.gap(T AA , T BB ) ≥ 2.
Proof.It can easily be checked that max f (l f (T BB ) − l f (T AA )) ≥ 12.This can be achieved, for example, by taking a character f that comprises 4 disjoint copies of f asym , thus obtaining l f (T BB ) = 16 and l f (T AA ) = 4. (In fact, by performing an exhaustive search, one can show that this is optimal).Verifying that max f (l f (T AA ) − l f (T BB )) = 10 is more challenging.We have used an exhaustive search to check this, but note that our ILP gives the same result in significantly less time.In fact, l f (T AA ) − l f (T BB ) = 10 can be achieved by f = AGAGAGGAAGGGAGGAGAAAGAAGAGGGAGGA, for which the score on T AA is 14 and the score on tree T BB is 4. So, altogether we have max f (l f (T BB ) − l f (T AA )) = 12 and max f (l f (T AA ) − l f (T BB )) = 10, so gap(T AA , T BB ) ≥ 2 and d 2 MP (T AA , T BB ) = 12.
Let T k AA be the rooted tree on 32k taxa obtained by arranging k disjoint copies of T AA along a caterpillar backbone.That is, Proof.The case k = 1 is proven by Claim 5.1 and for higher k we use analogous arguments to the proof of Claim 4.2 and Lemma 4.3.We omit details.
Proof.T k AA comprises 4k copies of T a .By taking 4k copies of character f asym , we see that . That 12k is also the upper bound, can be verified by showing d rSP R (T k AA , T k BB ) ≤ 12k.This follows because by cutting off all copies of taxa 2, 5, 7 into separate components, we obtain an agreement forest of T k AA , T k BB containing 12k + 1 components.

The reduction
We reduce from the NP-hard (and APX-hard) problem CUBIC MAX CUT [1].Here we are given a cubic graph G = (V, E), |E| = 3|V |/2, and we are asked to partition V into two disjoint pieces V 1 ∪ V 2 such that the number of edges that have one endpoint in V 1 and one endpoint in V 2 ("cut" edges), is maximized.Let M AXCU T (G) represent this value.We can assume without loss of generality that G is connected and not bipartite.
The high-level idea is similar to the 2-state hardness reduction in [5].Namely, we will construct two trees T V and T E and apply the symmetrybreaking gadget to ensure that for all optimal characters f , l f (T V ) < l f (T E ).We will model the vertices as subtrees in T V , each comprising three taxa, and argue -via a technical argument -that these subtrees are monochromatic.We will let the 2 states represent the two sides of the chosen partition V 1 ∪ V 2 .Henceforth we will call these states red and blue.The colour of a vertex subtree thus denotes which side of the partition it is on.The tree T E will be constructed such that, the more cut edges are induced by the partition chosen by T V , the higher the parsimony score of T E .The construction will thus naturally choose a character that maximizes M AXCU T (G).
The fact that T V and T E must be binary, introduces significant complications compared to the 2-state hardness reduction in [5].For this reason we will introduce two new special gadgets, that allow T V (respectively, T E ) to be viewed as the independent union of several subtrees.In T V the gadget will be called the cherry switch and in T E we will have the D(w i ) gadget, to be explained in due course.These independence gadgets neutralise the influence of side-effects that can occur as a consequence of the fact that T V and T E are both binary.
Tree T is the left-hand side subtree of TE in the 2-state NPhardness construction, cf. Figure 7. Every internal node wi with children nodes pi and qi of the original tree T is replaced by tree D(wi) with root wi and children w 0 i , . . ., w 5 i .Children w 0 i and w 1 i correspond to pi and qi, respectively, whereas the other children form new leaves.Therefore, each D(wi) contributes four leaves to tree T .For the leaves labelled xe i [ui] and xe i [vi], ui and vi are the endpoints of edge ei.
We begin by constructing T E .First, we construct the left-hand side subtree T of T E as depicted in Figure 6.Let T be an arbitrary rooted binary tree on |E| + 1 leaves {m 1 , . . ., m |E|+1 }.Let I = {w 1 , . . ., w |E| } be the |E| interior nodes of T .Let M be a large integer whose value we will determine in due course.Let S V be the tree T M AA and S E be the tree T M BB .Let l be an arbitrary leaf of T .We replace l with S E .Next, select an arbitrary bijection between the remaining leaves of T and E. For each edge e = {u, v} ∈ E, replace the leaf of T corresponding to e with a cherry on two taxa {x e [u], x e [v]}.Now, for each internal vertex w i , let p i and q i be the two children of w i .We now introduce the independence gadget D(w i ), constructed as follows.Take a rooted binary tree (w 2 i , ((w 0 i , w 4 i ), (w 3 i , (w 5 i , w 1 i )))).We replace w i with this tree, in the following sense: delete w i , identify w 0 i with p i , identify w 1 i with q i and if w i had an incoming edge, identify the root of D(w i ) with the head of this edge.The remaining leaves of D(w i ) are {w 2 i , w 3 i , w 4 i , w 5 i } and we regard these as taxa, so replacing each w i with D(w i ) increases the number of taxa in total by 4|E|.T has in total 2|E| + 32M + 4|E| taxa, where the 32M is the number of taxa in S E .
Let T ′ be a rooted caterpillar on |V |+3|E| leaves {l 1 , . . ., l |V |+3|E| }.Replace each leaf l i by a "double cherry" ((α i , γ i ), (β i , δ i )) where {α i , β i , γ i , δ i } are taxa.Join T and T ′ together by a new root: this completes the construction of T E as depicted in Figure 7. T E thus has in total, To construct T V we start by creating a set of taxa-disjoint trees J.The disjoint union of the taxa in the |V | + 1 + 3|E| trees in J will be exactly the set of taxa in the tree T mentioned earlier.J contains, 1. S V ; Figure 8. TV consists of a modification of a caterpillar tree with directed path K which starts at the root and leads to a leaf in a cherry.Path K is depicted in bold.Each of the |V | + 3|E| edges in K carries two additional cherries (αi, βi) and (γi, δi).Therefore, K contributes in total 4(|V | + 3|E|) taxa.Moreover, for each of the original |E| inner nodes wi of tree T as depicted in Figure 6, TV contains four taxa w 2 i , w 3 i , w 4 i , w 5 i .This leads to 4|E| more taxa.Finally, for each vertex u in V , TV contains a triple  e, e * , e * * are the three edges incident to u in G; 3.For each gadget D(w i ), two single taxon trees w 4 i and w 5 i , and one cherry (w 2 i , w 3 i ).
Let C be a rooted caterpillar on |V | + 1 + 3|E| leaves.Consider a directed path on |V | + 3|E| edges that starts at the root of C and terminates at one of the leaves in the unique cherry of C. Let K be the edges in this path.
Choose an arbitrary bijection between the leaves of C and the trees in J, and replace each leaf with its corresponding subtree.We now need to replace each edge in K with a special gadget.In particular, select an arbitrary bijection between K and {1, . . ., |V | + 3|E|}.Next, for each edge in K, subdivide it twice.From one of the vertices created by the subdivision operation, hang a cherry (α i , β i ), and from the other hang a cherry (γ i , δ i ), where i is the index given by the bijection.We call these two cherries a cherry switch -this is the independence gadget for T V .This completes the construction of T V , which is depicted in Figure 8.
We are now in a position to specify the number M .We require M to be sufficiently large that, for every optimal character f , l f (T V ) < l f (T E ).
From Lemma 5.3 we know that there exists some character f ′ such that We can obtain such a character by extending the character suggested by Lemma 5.3 such that all taxa outside S E and S V are assigned the same state.Now, let t be the number of edges in T V that lie outside S V .For every character f we have The 12M term is obtained from Lemma 5.3, the (M + 1) term from Lemma 5.2, and the t term arises (pessimistically) from the situation when every edge in T V (outside S V ) incurs a mutation, but no edge in T E (outside S E ) incurs a mutation.So, if we choose M such that and in particular l f (T E ) > l f (T V ).Choosing M = t is therefore sufficient to achieve this.
Consider now the following.
Observation 5.4.Let T 1 , T 2 be two binary trees and let f be an optimal character such that l f (T 1 ) < l f (T 2 ).Suppose T 1 contains two cherries (a, b) and (c, d) and, in T 2 , there are cherries (a, c) and (b, d) under a common parent (i.e. a "double cherry").Then f can be modified to obtain an optimal character f ′′ in which (a, b) and (c, d) are both monochromatic but with different colours, and the colours of all other taxa are unchanged.
Proof.Let f be an optimal character.We first apply Lemma 3.2 to obtain an optimal character f ′ in which the two cherries are monochromatic in T 1 .
If the two cherries have different colours we are done.If not, then recolour one of the cherries to obtain f ′′ .This raises the parsimony score of T 1 by (at most) one.In T 2 two new mutations are created in the cherries (a, c) and (b, d) while at most one mutation is saved on the edge entering the common parent.Hence, f ′′ is also optimal.
In exactly the same way as Theorem 4.6 we now give an accumulating list of properties which can be shown to be enjoyed by at least one optimal character that can be constructed in polynomial time.
Property 1.In T V , for each i ∈ |V | + 3|E|, cherry (α i , β i ) is monochrome and cherry (γ i , δ i ) is monochrome, and the cherries have different colours.
Proof.This is an immediate consequence of Observation 5.4.
Next, observe that if a character f has Property 1, and we swap the colours used in some (or all) of the cherry switches to obtain f ′ , then l f (T E ) = l f ′ (T E ).This is because each cherry switch in T V corresponds to a double cherry in T E , and (as long as Property 1 already holds) the behaviour of the double cherries is invariant under permutation of red and blue.This is the key observation behind the next property.Property 2. There is an optimal character f such that where l f (T * ) has the expected meaning i.e. the parsimony score of T * after restricting f to the taxa in T * .
Proof.Observe that for any optimal character f , |V | + 3|E| + T * ∈J l f (T * ) is a lower bound on l f (T V ).This can be observed by first applying Fitch's algorithm to the trees in J (which are all pendant in T V ) and then noting that, due to Property 1, each of the |V | + 3|E| cherry switches also incurs a mutation, irrespective of the states that Fitch's algorithm designates to the roots of the trees in J.To show that it is also an upper bound, first run Fitch on the trees in J.For those trees in J that are allowed by Fitch to have either colour at the root, pick one arbitrarily.For each cherry switch, consider the root state of the tree from J directly above it (where here "above" means: closer to the root of T V ), and directly below it.There are four possibilities: red-blue (i.e. the tree from J above it wants a root state of red, the tree below it wants blue), red-red, blue-red, and blue-blue.If it is red-blue, then if necessary swap the colours on the two cherries in the cherry switch, to ensure that the red cherry is closer to the root of T V .If it is blue-red, then ensure that the blue cherry is closer to the root of T V .Now, irrespective of which of the four possibilities holds, there is an optimal extension which occurs exactly one mutation (and not more) per cherry switch.In the red-blue and blue-red cases the mutation will be on the edge between the two subdivision vertices (i.e. the edge between the vertices at which the two cherries are attached to the caterpillar backbone).In the cases red-red and blue-blue the mutation will be on the edge feeding into the blue, respectively red cherry.Property 3. In T V , the trees in J that are rooted triplets or cherries, are all monochrome.
Proof.That the cherries can be made monochrome, is simply a consequence of Lemma 3.2.That the rooted triplets are monochrome is more subtle.Consider any triplet in J, this has the form (x e [u], (x e * [u], x e * * [u])).We already know that {x e * [u], x e * * [u]} have the same colour, as they form a cherry.Now, if x e [u] also has this colour, we are done.If not, then recolour it to give it the same colour as the other two taxa.By Property 2, this must lower the parsimony score of T V by exactly one.Hence, the new character is also optimal.(We really need Property 2 here, since "the parsimony score of T V does not increase" -which in general is the strongest statement we can make after such a recolouring -is not strong enough for our purposes).Property 3 basically says that, in T V , the three taxa that represent each vertex of G all have the same colour.This will allow us to encode MAX CUT correctly.Property 3 also tells us that the {w 2 i , w 3 i } pairs of taxa, which form part of the D(w i ) gadget, will be monochrome.This is particularly useful when combined with the fact that w 4 i and w 5 i are both single taxa trees in J.A tree comprising only a single taxon has parsimony score 0, so whichever colour is allocated to the w 4 i and w 5 i taxa, they do not impact upon the parsimony score of T V , by Property 2. In other words, these two taxa are "free": they can be allocated any colour in an attempt to cause as many mutations as possible in T E .The {w 2 i , w 3 i } pairs of taxa are also "free", except for the limitation that w 2 i and w 3 i should have the same colour.This underpins the following critical observation.
Observation 5.5.Consider the rooted binary tree ). Suppose we fix w 0 i as red, or blue, or {red, blue}, where {red, blue} has the same meaning as in Fitch's algorithm i.e. "both states are possible".Suppose we do the same (independently) for w 1 i .Then depending on our choice we can always select colours for w 2 i , w 3 i , w 4 i , w 5 i , whilst ensuring that the same colour is chosen for w 2 i and w 3 i , such that the parsimony score of D(w i ) under the resulting character is at least 2.Moreover, it is never possible to achieve a parsimony score higher than 2 in this way.
Proof.A straightforward case-analysis is sufficient to verify the "at least 2" part of the claim.There are 3 2 cases, several of which are symmetrical.These are the relevant cases: 1. w 0 i and w 1 i are both red.Then choose all other taxa to be blue.

w 0
i is red and w 1 i is blue.Then choose w 4 i to be blue, w 5 i to be red, and w 2 i and w 3 i to both be blue.

w 0
i is red and w 1 i is {red, blue}.Then choose w 4 i to be blue, w 5 i to be blue, and w 2 i and w 3 i to both be red.4. w 0 i is {red, blue} and w 1 i is red.Then choose w 4 i to be red, w 5 i to be blue, and w 2 i and w 3 i to both be blue.5. w 0 i and w 1 i are both {red, blue}.Then choose w 4 i to be red, w 5 i to be red, and w 2 i and w 3 i to both be blue.
To show that 3 or more mutations are never possible, note that a character on 6 taxa can only possibly have a parsimony score of 3 if there are exactly 3 red taxa and exactly 3 blue taxa.(Otherwise, simply choose an extension that assigns the majority colour to all internal nodes of the tree, yielding at most 2 mutations.)Now, if at least one of w 0 i and w 1 i chooses {red, blue}, then 3 mutations are certainly not possible, because we can (again) colour all the internal nodes of the tree monochrome in the majority colour, yielding at most 2 mutations.So, suppose without loss of generality w 2 i and w 3 i are both red.Then exactly one of w 0 i and w 4 i will be red, and the other blue.But then w 1 i and w 5 i will both be blue.But this character has parsimony score at most 2, contradiction.
In T E the taxa w 0 i and w 1 i become the roots of subtrees, and the three possible choices for each taxon in Observation 5.5 reflect the three possible decisions that Fitch's algorithm can make when, in the bottom-up phase, the root of that subtree is reached.Essentially, then, Observation 5.5 allows us to "glue" these two subtrees together with a profit of exactly 2 mutations, entirely independently of the two subtrees themselves.Now, consider any optimal character f that has Property 3 (and thus all earlier properties too).We have since (by Property 2) the singletons, cherries and triplets in J do not internally generate any mutations and mutations along the K part of T V are already accounted for.(As usual, l f (S V ) refers to the parsimony score of the restriction of f to the taxa in S V ).Let CU T (f ) be the number of cut edges induced by f i.e. after partitioning the vertices of V according to the colours of the corresponding rooted triplets in J.We have, The 2(|V | + 3|E|) term is the contribution of the double cherries, and the 2|E| term is the 2 mutations that we know we can definitely incur in each D(w i ) gadget.Hence, an optimal character should try and make the induced cut as large as possible: there is no other freedom.Consequently, It is a consequence of the fact that in this context there is no point choosing a character f which, when restricted to S V and S E , yields an MP distance smaller than d 2 MP (S V , S E ) (where the latter value is equal to 12M by Lemma 5.3).
The terms can easily be rearranged to obtain M AXCU T (G) from d 2 MP , which yields the overall theorem: MP is NP-hard on binary trees.
We also obtain the following corollary.
Corollary 5.7.Computation of d 2 MP is APX-hard on binary trees.
Proof.We will show that if d 2 MP can be approximated in polynomial time to within a multiplicative factor of (1 − ǫ), for some ǫ > 0, that CUBIC MAXCUT can be approximated in polynomial time to within a factor of (1 − kǫ) for some constant k > 0 that is independent of ǫ.Given that CUBIC MAX CUT is APX-hard [1] there is (by definition) some ǫ ′ > 0 such that a factor (1 − ǫ ′ ) approximation or better is not possible in polynomial time unless P = N P .The APX-hardness of d 2 MP will then follow3 : the corresponding threshhold for d 2 MP will be ǫ ′ /k.
First, suppose we obtain character f , which is a (1 − ǫ) approximation to d 2 MP (T V , T E ).We need to show that a feasible solution (i.e. a cut) can be extracted in polynomial time from f , which requires that the solution obeys all the Properties.Character f might not have these Properties, but they can be acquired in polynomial time without lowering the parsimony distance score of the character.To do this, ensure first that S V and S E use the duplicated character f asym (which optimizes the MP distance between S V and S E ).This ensures that l f (T V ) < l f (T E ).From this point on the Properties can be accumulated one at a time: the constructive proofs describing how the Properties are obtained do not require that f is optimal, only that l f (T V ) < l f (T E ).
Recall that |V | = (2/3)|E|.We need an explicit expression for M .This was set to be t, the number of edges in T V minus the edges in subtree S V .T V has in total 32M + 18|E| + 4|V | taxa, and after subtracting the 32M this gives 18|E| + 4|V |.A rooted binary tree on |X| taxa has 2(|X| − 1) edges, yielding 36|E| + 8|V | − 2, plus 2 extra edges created when the subtree S V is re-attached, giving 36|E| + 8|V | which is (124/3)|E|.Hence, The size of the cut returned after processing f is at least It is well-known that for cubic G, M AXCU T (G) ≥ 2|E|/3, by moving a vertex to the other side of the partition if one or fewer of its incident edges is in the cut.So, This concludes the proof.

An Integer Linear Programming (ILP) formulation for binary instances
Let T 1 and T 2 be two binary phylogenetic trees on n ≥ 2 taxa.Given the hardness of MP distance it is natural to ask how well d MP (T 1 , T 2 ) can be computed in practice.One option is to leverage the result in [5] which proves that there always exists an optimal character that is convex on one of the trees (i.e. has a parsimony score exactly one less than the number of states in the character).Hence we can guess which of the two input trees is convex, guess the number of states s in the optimal character, and then guess the (s − 1) edges of the convex tree on which the mutations occur.Assuming the trees are unrooted, and letting g(T 1 , T 2 ) be any safe upper bound on s, this gives a deterministic running time of As the following observation shows, we can take g(T 1 , T 2 ) = ⌊n/2⌋.Observation 6.1.Let T 1 and T 2 be two binary phylogenetic trees on n ≥ 2 taxa.There exists an optimal convex character with at most ⌊n/2⌋ states.Moreover, this bound is tight.
Proof.Let f be an optimal convex character.Suppose f has strictly more than ⌊n/2⌋ states.Then there exists a state t that occurs on only one taxon x.We root T 1 on the edge entering x.If we run Fitch on this rooted tree a union event will necessarily be generated at the root due to the fact that t occurs on only one taxon.Let C be the set of states in this union event, and let t ′ be any state in C \ {t}.Let f ′ be the character obtained from f by assigning state t ′ to taxon x.By re-running Fitch we see that l f ′ (T 1 ) = l f (T 1 ) − 1.Moreover, f ′ has one fewer state than f , so f ′ is convex.By Observation 3.1 Hence, f ′ is optimal, convex and has fewer states than f .By repeating this process we eventually obtain an optimal convex character with at most ⌊n/2⌋ states.
The trees in Figure 1 on 6 taxa are a tight example for this bound: it can easily be verified computationally that for these two trees optimal characters require at least 3 states.
Of course, even if we take g(T 1 , T 2 ) = ⌊n/2⌋, such brute-force algorithms will quickly become impractical for even very small n.Hence we turn to Integer Linear Programming (ILP), which allows us to compute d MP and d i MP for larger trees.The ILP for computing d 2 MP performs very well, allowing computation of d 2 MP in reasonable time for trees with up to 100 taxa.Unfortunately, in the case of d MP the ILP struggles to terminate in reasonable time for trees with more than 16 taxa.Future research (i.e.better ILP formulations) will hopefully improve upon this.
The ILP formulation is currently limited to binary trees but the model could be extended to non-binary trees without too much difficulty.
Let T 1 and T 2 be rooted, binary phylogenetic trees on the same set of taxa X, where |X| = n.Let U be the internal nodes of T 1 and V the internal nodes of T 2 .Let s be a constant denoting the maximum number of states that any character can have; as discussed taking s = ⌊n/2⌋ is a safe choice.(To compute d i MP we simply take s ≤ i.)The following ILP maximizes l f (T 1 ) − l f (T 2 ) ranging over all characters f with at most s states.To obtain the true parsimony distance the ILP should be run twice, once to compute the maximum of l f (T 1 ) − l f (T 2 ) and once to compute the maximum of l f (T 2 ) − l f (T 1 ).
All variables in the program are binary.
First of all we constrain that in both trees the taxa have the same state, and that each taxon chooses exactly one state.We introduce variables x t,i for each t ∈ X and 1 ≤ i ≤ s.For each t ∈ X we introduce the constraint: We now show how the parsimony score can be computed for T 1 .The variables and constraints essentially "hard-code" Fitch's algorithm.(The encoding of T 2 is symmetrical.The two encodings are linked together via the variables that represent the states of the taxa in X, and the objective function, which we shall discuss in due course).
Given an internal node u ∈ U , let l be its left child and r be its right child.Fitch's algorithm tells us to take the intersection of the states at l and r, if the intersection is non-empty, and otherwise the union (in which case we pay 1 mutation).We do this computation as follows.For 1 ≤ i ≤ s we introduce a variable x u,i .The idea is that x u,i will be 1 if and only if state i is in the set of states at node u (in the bottom-up phase of Fitch).We determine the set of states at u by performing the union and intersection computations directly.For that purpose, for 1 ≤ i ≤ s we introduce x ∩ u,i and x ∪ u,i and the following constraints: The top group of constraints ensure that the x ∩ u,i variables reflect the intersection of the states at the children (i.e.logical AND) and x ∪ u,i the union (i.e.logical OR).
For each u ∈ U we have a variable x ∩ u and x ∪ u which is 1 (resp.0) if Fitch wants an intersection operation at node u.We can ensure that these variables take the correct value as follows.Firstly: And, secondly, we add the following constraint for each 1 ≤ i ≤ s: To ensure that x ∩ u and x ∪ u are complementary we add the constraint Now, we have to ensure that x u,i takes the value x ∩ u,i whenever x ∩ u is 1, and x ∪ u,i otherwise.We do this by, for each 1 ≤ i ≤ s, adding the following four constraints: Finally, all that remains is to compute the difference between the two parsimony scores.We do this with the following objective function:

Maximize
This concludes the formulation.We have implemented it by using Java to translate the input trees into an ILP format suitable for solvers such as GLPK, SCIP or CPLEX.We have used this to verify several of the bounds used in Section 4.1.The source code can be downloaded from [12].
We tested our ILP running CPLEX on a 3.10GHz 64-bit machine with 4 GB RAM.We observed the following running times.For computation of d MP : • the two trees T a and T b on 6 taxa as depicted in Figure 1: total running time < 1 second.• the two trees T A and T B on 12 taxa consisting of two copies of T a or T b , respectively: 70 seconds.
For computation of d 2 MP : • the two trees on 8 taxa as depicted in Figure 5: < 1 second.
• the two trees T A and T B on 16 taxa consisting of two copies of T a or T b , respectively: < 1 second.• the two trees T AA and T BB on 32 taxa consisting of four copies of T a or T b : 6 seconds.
Computation of d i MP , for small i, is much faster than d MP due to the greatly reduced number of binary variables.We observed that the ILP could compute d 2 MP for trees with 100 taxa in approximately 140 seconds.

Conclusion
In this article we have proven that calculating MP distance (d MP ) is NPhard on binary trees.Computation of d 2 MP (the version of the problem where we are restricted to binary characters) is also NP-hard on binary trees.The latter problem is also APX-hard, and determining whether d MP is APX-hard remains an open question.At the moment we do not have an NP-hardness proof for d 3  MP on binary trees but given that d i MP on binary trees is NP-hard for each i ≥ 4 we expect that this will also be hard.
We have presented and implemented a simple ILP formulation, which is publicly available at [12].The ILP is much faster than obvious bruteforce algorithms and allowed us to verify the MP-distance of the symmetrybreaking gadgets used in the hardness reductions.The ILP for d 2 MP is fast but the ILP for d MP does not scale well.An important open problem is therefore to develop an ILP formulation that avoids the present approach of simply hard-coding Fitch's algorithm.
Finally, elucidating the exact relationship between MP distance and other phylogenetic metrics remains an intriguing challenge.

Acknowledgement
We would like to thank Nela Lekic for valuable discussions.

Appendix
Here, we present the proofs we omitted in the previous sections.Proof.Suppose this is not so.Recolour {β 1 , β 2 } to some new colour not appearing elsewhere.This increases the number of mutations in T E by at most 1.However, in T V the number of mutations in the β 1 , β 2 , γ 1 , γ 2 subtree increases from 0 to 2. Possibly T V then saves a single mutation at the root, but in any case the parsimony score of T V increases by at least 1.So the new character is still optimal.Property 2.2.In T E , the (possibly multiple) colours used for the taxa of B (including α) are not used elsewhere in T E , except possibly {β 1 , β 2 }.
Proof.Take an optimal extension F of f by applying Fitch's algorithm.Let c be the colour allocated to the root of B by this extension.Let c * be the colour of the parent p 1 of the root of B, and c * * the colour of its parent p 2 .Let c β be the colour of the {β 1 , β 2 } taxa and define c γ similarly.Suppose c = c * = c * * .We will recolour the character -and this extension -to ensure that this is no longer the case.By Property 2.1, c β = c γ .If c = c β and c = c γ , then recolour γ 1 , γ 2 and their parent to colour c. (This lowers the parsimony score of T E by 1, and can lower the parsimony score of T V by at most 1, so the character -and the extension -is still optimal.)Otherwise, exactly one of c β and c γ is equal to c.If c β has this property, then swap the colours of {β 1 , β 2 } and {γ 1 , γ 2 } (and their parents).So we now have c = c γ and c = c β .In particular, there is a mutation on the edge entering the cherry {β 1 , β 2 }.For technical reasons we now introduce a brand new colour, bronze say, and recolour {β 1 , β 2 } (and their parent) to be bronze.This leaves the parsimony score of T E unchanged, and cannot decrease the parsimony score of T V , so the character is still optimal.We do this simply to ensure that the colour of β 1 , β 2 does not occur anywhere else.Run Fitch's algorithm on T V and record the output as R.
At this point we introduce a new colour silver.Recolour the following vertices silver: β 1 , β 2 , their parent, p 1 and the entire c-coloured connected component inside B starting at the root of B. This gives a new character and extension which saves one mutation (on the edge leading into the cherry β 1 , β 2 ) but creates one mutation between p 1 and p 2 .So the parsimony score of T E does not increase.It is not obvious, but the parsimony score of T V will not drop.To see why this is, note that (under this particular recolouring) the only way the parsimony score of T V could drop, is if the recolouring causes a mutation (i.e.union event) at the root of T V to vanish, and at the same time does not create any additional mutations elsewhere.If R did not have a mutation event at the root of T V anyway we are done, there is nothing to consider.If it did, then in R the union event at the root must have had the form {c, bronze}∪W where W ∩{c, bronze} = ∅ and the W is the set of states generated by the bottom-up phase of Fitch's algorithm for the root-incident right subtree of T V , let us call this T right .Now, if the recolouring causes the parsimony score of T right to increase, we are also done.So suppose the parsimony score of T right stays the same and T right suddenly has an optimal extension (generated by any method, not necessarily Fitch) in which its root can be coloured c or silver (which is necessary to save a mutation at the root of T V ).But then we could take this extension and re-merge the colours c and silver back into c, showing that T right did originally have an optimal extension in which its root could be coloured c.This would mean that R cannot possibly have been an optimal extension: it claimed a mutation was needed at the root of T V , but we have just shown that colouring the root c would have avoided mutations on both of its outgoing edges.Contradiction on the assumed optimality of F .Hence, this new character is indeed still optimal.The modified extension (on T E ) is necessarily also optimal for this new character: if some other extension existed that induced fewer mutations, then this would violate the assumed optimality of the original character (i.e. because the parsimony score of T V does not decrease).
At this point we can recolour all the monochromatic connected components induced by the extension, and starting at some vertex of B, with brand new colours.This new character must be optimal.(The score of T V under this new character does not decrease, so the recoloured extension must also be optimal.)Moreover, with the possible exception of β 1 , β 2 none of the colours used for taxa in B are used outside B. This is guaranteed because the silver recolouring ensured that there are no longer monochromatic connected components that connect taxa in B with taxa beyond B ∪{β 1 , β 2 }.

Property 2.3
In T E , all the taxa in B have the same colour which, with the possible exception of β 1 , β 2 , does not appear on taxa outside B and α.
Proof.Let f be an optimal character.If the taxa in B are monochromatic we are done.Otherwise, run Fitch's algorithm to generate an optimal extension on T E .(Also run Fitch on T V and let m be the number of mutations incurred there, although we do not need to remember the corresponding extension).In T E at least one node of B must be a union event (in the bottom-up phase of Fitch).Let u be such a node that is furthest from the root of B, and let T u be the subtree of B rooted at u. Let T 1 , T 2 be the two subtrees rooted at the two children of u.The taxa in T 1 must be monochromatic with some colour c 1 , and the taxa in T 2 must be monochromatic with some colour c 2 = c 1 .Suppose, without loss of generality, that the optimal extension colours u with colour c 2 .This causes a mutation between u and the root of T 1 .Hence, if we recolour the entire subtree T 1 (i.e.taxa and non-taxa alike) with colour c 2 , then this generates a new character f ′ (and new extension) in which the parsimony score of T E drops by (at least) 1.We argue that f ′ can decrease the parsimony score of T V by (at most) 1, from which the optimality of f ′ (and its new extension) will follow.Suppose, for the sake of contradiction, that f ′ generates m − 2 or fewer mutations in T V .Apply Fitch to f ′ on T V .Now, due to the fact that B has essentially the same topology in both T V and T E , the subtree T u is topologically preserved inside T V .In particular, the images of all vertices of T u are unambiguously defined inside T V .Now, in its bottom-up phase Fitch will generate in T V no union events on the images of the nodes of T u , due to the fact that all taxa in T u have colour c 2 .(There might be a union event generated at the point a pendant rooted triplet is grafted onto the image of T u , see Figure 4, but such subdivision nodes are not considered to be part of the image of T u .)At this point we recolour in T V T 1 (taxa and non-taxa alike) with colour c 1 , creating in total exactly one extra mutation, on the edge between u and the root of T 1 . 4This new extension is a valid extension of f on T V but generates at most m − 1 mutations, contradicting the assumption that an optimal extension of f on T V had m mutations.Hence, f ′ must be optimal.If f ′ is not yet monochromatic for B, then we re-run Fitch on T E to generate a fresh optimal extension, and iterate the entire process until B becomes monochromatic.This process must terminate (in polynomial time) because each iteration merges two distinctly coloured subtrees of B into one strictly larger monochromatic subtree.Property 3. In T E , all the taxa in B (including α) have the same colour, and cherry {β 1 , β 2 } also has this colour.Moreover this colour does not appear on any other taxa i.e. it is unique for B and β 1 , β 2 .
Proof.From Property 2.3 we already know that all taxa in B have the same colour and, with the possible exception of β 1 , β 2 , this colour does not appear outside B. Let c be the colour used in B. If c is the same as the colour of {β 1 , β 2 }, denoted again c β , we are done.If c is the same colour as {γ 1 , γ 2 }, then swapping the colours on {β 1 , β 2 } and {γ 1 , γ 2 } preserves optimality, and we are done.(Optimality is preserved because the parsimony score of T E cannot increase under such a swap, and the parsimony score of T V cannot decrease due to symmetry.)So suppose neither c β nor c γ is equal to c. Run Fitch to generate an optimal extension.In the bottom-up phase Fitch will assign states {c, c β } to p 1 and {c, c β , c γ } to p 2 .Suppose, in the top-down phase, the parent of p 2 communicates a state to p 2 that is either equal to c, or not in {c, c β , c γ }.In this case Fitch allows us to give p 2 colour c.We can then recolour {γ 1 , γ 2 } to be c (saving at least one mutation in T E , and saving at most one mutation in T V , thus preserving optimality) and then switch back to the earlier case.If Fitch permits p 1 to be coloured c, we simply recolour {β 1 , β 2 } to be c and we are done because this, via the same analysis, preserves optimality.The only case remaining is if every possible set of choices in the top-down phase of Fitch leads to the conclusion that both p 1 and p 2 are coloured c β .(This is the only remaining case because if p 2 is or can be coloured c γ , then Fitch will subsequently allow us to colour p 1 with colour c, due to the fact that c γ ∈ {c, c β } i.e. we will be in an earlier case.)So consider an extension generated by Fitch in this case.We swap the colours on {β 1 , β 2 } and {γ 1 , γ 2 } (including the colours of their parents).This colour swap does not affect the number of mutations but it ensures that both edges leaving p 1 carry mutations.Hence, if we now colour {β 1 , β 2 }, their parent, and p 1 all c, both these mutations vanish.So we definitely save one mutation in T E , and as usual at most one mutation is saved in T V .So we are done.This concludes the proof of Property 3.

5 C T a 3 Figure 1 .
Figure 1.The two "asymmetric" trees Ta and T b and an optimal character fasym = GAACCG.

Figure 2 .
Figure 2. The tree T * * * .Here we have identified E with the set {1, . . ., |E|} to simplify the figure.In the lowermost leaves we have overloaded u and v: in each case they refer to the two endpoints of the edge in question.

5. 1 .Figure 5 .
Figure 5. Two trees Taand T b that are "asymmetric" on characters with at most 2 states.An example of an optimal character is fasym = AAGGGGAA.
Figure 8. TV consists of a modification of a caterpillar tree with directed path K which starts at the root and leads to a leaf in a cherry.Path K is depicted in bold.Each of the |V | + 3|E| edges in K carries two additional cherries (αi, βi) and (γi, δi).Therefore, K contributes in total 4(|V | + 3|E|) taxa.Moreover, for each of the original |E| inner nodes wi of tree T as depicted in Figure6, TV contains four taxa w 2 i , w 3 i , w 4 i , w 5 i .This leads to 4|E| more taxa.Finally, for each vertex u in V , TV contains a triple (xe[u], (x e * [u], x e * * [u])), which are 3|V | taxa.Using the fact that in cubic graphs we have |V | = 2 3 |E|, TV employs in total 32M + 16|E| + 7|V | = 32M + 18|E| + 4|V | taxa.