Abstract
A common problem in phylogeny is to reconstruct the ancestral states of a feature measured at the present time. The classic Fitch-Hartigan and Sankoff algorithms compute the most parsimonious or most likely reconstruction. However, these approaches do not readily extend to structured ancestral reconstruction problems, such as encountered when inferring the routes of metastases in cancer, deriving the transmission history of viruses, or detecting horizontal gene transfer in phylogenetic networks. We develop a combinatorial optimization approach to ancestral reconstruction problems based on the tree labeling polytope, a geometric object whose vertices represent the ancestral labelings of a tree. We derive algorithms for three structured ancestral reconstruction problems: parsimonious migration history, softwired small parsimony, and convex recoloring. We apply these algorithms to analyze routes of metastasis in a mouse model of lung adenocarcinoma using lineage-tracing data from thousands of single cells.
Introduction
A foundational problem in phylogenetics is to infer the ancestral states of phylogenetic characters from the states on the leaves of a phylogenetic tree. Finding the most parsimonious labeling of ancestral vertices that minimizes the number of changes on the tree is called the small parsimony problem and is solved in polynomial time via the Fitch-Hartigan recurrence1,2 in the unweighted case, and Sankoff’s algorithm3–5 in the weighted case. In the statistical setting, the maximum likelihood labeling is also found via Sankoff’s algorithm by appropriately transforming probabilities into weights. Classically, the ancestral reconstruction problem was solved to infer molecular sequences of ancestral species6–8. More recently, ancestral reconstruction has been applied to infer the metastatic history of tumors9–15, host-to-host transmission networks of viruses16–25, and cellular differentiation maps in developmental biology26. Ancestral reconstruction has also been used to model recombination and horizontal gene transfer by scoring and ordering phylogenetic networks27–30.
However, many ancestral reconstruction problems of interest11,19,20,22,24,27–30 introduce global constraints or additional criteria, yielding NP-hard variants of the classic small parsimony problem. Solving these structured ancestral reconstruction problems by naïvely applying Sankoff’s algorithm results in brute-force approaches with exponential runtime, making it impractical for large datasets. To address this issue, researchers have developed specialized methods, including integer linear programming approaches11,26,31–34 and dynamic programming algorithms24,27,30,35–37, though both methods come with their own drawbacks.
In the combinatorial optimization literature, however, there is an alternative approach which starts with a linear programming formulation of the unconstrained problem and tacks on the additional, typically integer, complicating constraints. For example, the minimum spanning tree problem has an elegant linear programming formulation solvable in polynomial time, of which the feasible region is the spanning tree polytope due to Edmonds38. However, when constraints on the degree of the inferred spanning tree are added, the minimum spanning tree problem becomes NP-hard39. To solve the NP-hard bounded degree minimum spanning tree problem, state-of-the-art algorithms39,40 start by simply appending the degree constraints to the linear program for the (unconstrained) minimum spanning tree problem. Solving the resultant linear program, one obtains non-integral solutions, which are then fixed using either rounding39–41 or cutting plane42,43 approaches.
The advantage of building an integer programming formulation by starting with a linear program for the easy subproblem is that one obtains formulations with strong linear relaxations which often contain only a small number of integer variables44,45. In fact, integer programming formulations constructed in this way serve as the starting point for state-of-the-art approximation and exact algorithms for solving NP-complete generalizations of minimum spanning tree39,46,47, shortest path48,49, and maximum flow problems50–52. Unfortunately, it is often not obvious how to obtain linear programming formulations, or polyhedral descriptions1, of combinatorial problems.
We derive a polynomial sized, polyhedral description of the small parsimony problem by defining a new geometric object called the tree labeling polytope (Figure 1a). We show that for a phylogenetic tree with vertices and a character with states the tree labeling polytope is described by a polynomial-sized set of linear inequalities (or facets). To obtain this result, we provide an algorithmic primal-dual packing proof of the total dual integrality of a corresponding tree labeling system. As an immediate corollary, we obtain a polynomial-time algorithm for the general case of the small parsimony problem based on linear programming. These results extend earlier work by Erdős and Székely53–55 that derive a partial polyhedral description of the small parsimony problem via a combinatorial duality theorem (STAR Methods).
Figure 1: The tree labeling polytope and ancestral labeling problems.

a) The vertices of the tree labeling polytope denoted as are in one-to-one correspondence with the vertex labelings of . b) The small parsimony problem aims to find the ancestral labeling with the fewest number of label changes. c) The parsimonious migration history problem aims to find the most parsimonious ancestral labeling under structural constraints on the induced migration graph . d) The multi-cost small parsimony problem finds the cheapest labeling with respect to one cost function while satisfying a constraint on a second cost function .
We demonstrate the utility of the tree labeling polytope by developing mixed integer linear programming algorithms to solve three NP-hard variations of the small parsimony problem.
We solve a generalization of the parsimonious migration history problem introduced with the MACHINA algorithm11. In particular, we develop a fixed parameter tractable, mixed integer linear programming formulation for this generalization with strong linear relaxations.
We solve the softwired small parsimony problem on phylogenetic networks27,28,30 with a fixed parameter tractable, mixed integer linear programming formulation containing only binary variables, where is the number of reticulation, or in-degree 2, vertices in the network.
We solve an analog of the convex recoloring problem on trees56 called the multi-cost small parsimony problem. We obtain a mixed integer programming formulation for the multi-cost small parsimony problem with strong linear programming relaxations by drawing a connection to the constrained minimum spanning tree approximation algorithm of Ravi and Goemans46.
We demonstrate that our algorithms for all three of the aforementioned problems outperform existing algorithms on both simulated and real datasets. For the parsimonious migration history problem, our algorithm, fastMACHINA, scales to trees with thousands of leaves, making it possible to analyze large trees obtained from single-cell sequencing technologies. This is an improvement over existing algorithms, which only scale to phylogenetic trees with hundreds of leaves11. We apply fastMACHINA to evaluate migration histories between 83 tumor clones derived from single-cell lineage tracing data from a mouse model of lung adenocarcinoma15. Further, using a precise quantitative model based on convex recolorings, we find that while some tumors suggest patterns of monoclonal seeding, most do not, concordant with recent literature on the polyclonality of metastatic tumors57,58.
Results
Parsimonious ancestral labeling problems
Let be a rooted tree with root , leaf set , and edges. For a vertex , let denote the set of children of be the set of descendants of , and be the parent of vertex in ( is undefined).
We are interested in describing labelings of the vertices of . Assume is an alphabet of labels. A map is a leaf labeling of 2. A map is a vertex labeling of and is an extension of the leaf labeling if for all leaves . A cost function is a map , and gives the cost of a transition from label to across edge . Following the terminology in Erdős & Szekely54, we say a cost function is integral if range and non-integral otherwise. A cost function is called edge independent if for all pairs of edges , and is called edge dependent otherwise. If a cost function is edge independent, by slight abuse of notation is denoted . A cost function is normal if for all edges and not normal otherwise. A normal cost function is called label independent if for all and , and is called label dependent otherwise.
The small parsimony problem59 asks to find an extension of the leaf labeling such that the total weighted cost is minimized. In other words, the small parsimony problem finds the most parsimonious ancestral explanation of the leaves (Figure 1b).
Small Parsimony Problem.
Given a tree , a label set , a leaf labeling , and a cost function , find an extension where .
Originally, the unweighted small parsimony problem (taking ) was solved in time by the famous Fitch-Hartigan algorithm1,2. More generally, Sankoff gave a time algorithm for the case where the cost of a transition from label to label can depend on the labels3,4. In fact, essentially all dynamic programming algorithms for different cases of the small parsimony problem can be viewed as specializations, and often optimizations, of the Sankoff-Rousseau recurrence3,4, an idea fleshed out in detail in Csűrös5.
Generalizing slightly, Sankoff’s algorithm need not require that the inferred vertex labeling is an extension of , nor that the cost function is constant with respect to the edge (i.e. edge independent). In particular, Sankoff’s algorithm also solves the version where the cost function is a map and the cost . To recover the case where is required to extend , simply set the cost function if is a pendant edge with . Interestingly, the problem of inferring the most probable ancestral labeling under a probabilistic model of sequence evolution, or joint reconstruction60, is a special case of this generalized small parsimony problem where the cost function is edge dependent and not normal. To see this, observe that negative log-transforming the transition probabilities across each branch to obtain a cost function implies that minimizing the cost maximizes the probability of the labeling (see Section 4.4.2.2 of Yang61 for a thorough discussion). Throughout the remainder of the manuscript, all references to the small parsimony problem refer to this more general setting.
In several applications, additional constraints11,16,20–22,24,25 are placed on the inferred labeling. For example,11 places structural constraints on the inferred labeling , defining the parsimonious migration history problem (Figure 1c). In this setting, the label set is interpreted as a set of anatomical sites, the vertices of are interpreted as cells, and the labeling is interpreted as the anatomical location of cell . The main quantity of interest is the migration graph associated with a vertex labeling , which tells us the patterns of cellular migration between anatomical sites. The migration graph has vertex set and includes a directed edge if and only if there exists an edge such that and . The parsimonious migration history problem aims to find the most parsimonious ancestral labeling under structural constraints on the induced migration graph , specified with a graph class (Figure 1c).
Parsimonious Migration History Problem.
Given a tree , a label set , and a cost function , find the vertex labeling with minimum cost such that .
El-Kebir et al.11 considered several choices of the graph class including the class of rooted trees, the class of directed acyclic graphs, and the class of all graphs3. When consists of all graphs, the parsimonious migration history problem is equivalent to the small parsimony problem and thus solveable in polynomial time. Otherwise, the problem is more difficult. For example, the parsimonious migration history problem is NP-hard when is the class of trees35. Another variant of the small parsimony problem is the softwired small parsimony problem27,28, which generalizes the small parsimony problem to phylogenetic networks, modeling events such as horizontal gene transfer and recombination62. A phylogenetic network is a directed acyclic graph with a unique root having in-degree zero and a leaf set . We assume that each vertex in has in-degree at most two, and use to denote the set of vertices with in-degree two, herein referred to as reticulation vertices. The set of edges with terminals in are the reticulation edges. For a spanning tree of , let denote the small parsimony score of . Using this notation, the softwired small parsimony problem is defined as follows.
Softwired Small Parsimony Problem.
Given a phylogenetic network , a label set , and a cost function , compute the softwired small parsimony score:
| (1) |
That is, the softwired small parsimony score is the minimum parsimony score over all spanning trees of . As each spanning tree of corresponds to the choice of one of two in-edges of for all reticulation vertices , the total number of spanning trees is . In the case when is a tree, contains only a single spanning tree (itself) and the softwired small parsimony problem reduces to the small parsimony problem. The softwired small parsimony problem is NP-complete and not-approximable, meaning that no polynomial time algorithm admits a constant factor approximation assuming . Numerous algorithmic approaches have been developed for the softwired small parsimony problem including specialized dynamic programming27,28,30,63, integer programming31,37, and constant-factor approximation algorithms37.
Finally, we introduce the multi-cost small parsimony problem, a cost-constrained variant of the small parsimony problem, which, to our knowledge, has not yet been studied in the phylogenetics literature (Figure 1d). In this setting, we are provided two cost functions and a real number , and the goal is to minimize the primary cost subject to the constraint on the secondary cost. This problem is analogous to the constrained minimum spanning tree39,46 problem studied in the operations research and computer science literature, which has an additional constraint on the spanning tree with respect to a second set of weights. While the minimum spanning tree problem is solved in polynomial time with dynamic programming algorithms, the constrained minimum spanning tree problem is NP-complete64. Similarly, the multi-cost small parsimony problem is NP-complete. This problem is also closely related to the NP-complete convex recoloring problem56, a connection we describe in (STAR Methods).
The tree labeling polytope
In this section, we describe the tree labeling polytope, a polytope whose vertices are in one-to-one correspondence with labelings of (Figure 1a). We show that using the tree labeling polytope, one is able to write the small parsimony problem as a linear programming problem. The tree labeling polytope then serves as the basis for solving several variants of the small parsimony problem previously described. A complete description of the tree labeling polytope with related mathematical results is provided in STAR Methods.
To write the small parsimony problem as a linear program, the naïve starting point is to directly encode the extensions as binary vectors on the vertices of . Specifically, given a labeling define an -dimensional binary vector that records the label of each vertex. Unfortunately, with this encoding the cost of the labeling is not a linear function of the vector . Consequently, this encoding does not allow us to write the small parsimony problem as a linear program without additional variables.
Rather than encode the labeling on the vertices of , we encode the labelings on the edges of . That is, we encode as an -dimensional binary vector defined as . Stated simply, this encoding records the change in label (or lack thereof) across each edge. While this encoding requires binary variables compared to the variables for the vertex encoding, the advantage is that the cost of a labeling is a linear function of an -dimensional cost vector. In particular, we have that
| (2) |
where the vector is defined as . The observation that the cost of a labeling is a linear function of the indicator vector leads us to our definition of the tree labeling polytope.
Definition 1. Let be a rooted tree. The tree labeling polytope is the convex hull of , where ranges over all labelings of . That is,
| (3) |
Using this notation, the (generalized) small parsimony problem is equivalent to the following linear optimization problem:
| (4) |
where the vector is defined as . This follows from (2) and the fact that the optimum of a linear program is always at an extreme point of its feasible region.
A final ingredient in deriving a polynomial-sized linear program for the small parsimony problem is to describe the tree labeling polytope with a polynomial number of linear inequalities. From a computational perspective, the description as the convex hull of the encoded vertex labelings given in (3) is intractable as it requires enumerating all vertex labelings. Instead, we aim to describe the tree labeling polytope using a polynomial (in and ) number of linear inequalities, as this enables us to solve the small parsimony problem in polynomial time (in and ) using linear programming. In STAR Methods, we provide descriptions of the tree labeling polytope using linear (in)equalities. Briefly, the idea behind our approach is to first write down a set of necessary linear inequalities satisfied by all points in the tree labeling polytope. Using a primal-dual packing argument, we then show that this set of necessary linear inequalities is sufficient, completing the argument.
Algorithmic improvements using the tree labeling polytope
Using the tree labeling polytope we derive a polynomial time linear programming algorithm for the small parsimony problem (STAR Methods). More importantly, however, using the tree labeling polytope we derive good mixed integer linear programming formulations of several constrained parsimony problems.
Classically, a mixed-integer programming formulation is easy to solve or good if it has ) a small number of integer variables and ii) a strong linear relaxation45. The linear relaxation of a mixed integer program is stronger than that of a mixed integer program if (for a minimization problem) the objective of the linear relaxation of is greater than or equal to that of . Typically, the strength is quantified via the integrality gap, which is the ratio of the optimal objective value for to the objective of the linear programming relaxation for . Integrality gaps close to 1 indicate strong formulations, while gaps significantly larger than 1 indicate weak formulations. The reason for desiring i) and ii) is because state-of-the-art solvers65 for mixed integer programming rely on two main techniques: cutting planes, dating back to Dantzig66, and branch-and-bound, originally due to Markowitz67. The effectiveness of both techniques, however, depends intimately upon i) and ii). Specifically, strong mixed integer programs with only a small number of integer variables require fewer cutting planes and fewer branches, making the formulation easier to solve.
It is in this preceding sense we obtain good mixed-integer programming formulations for the parsimonious migration history, softwired small parsimony, multi-cost small parsimony, and convex recoloring problems using the tree labeling polytope. Due to space constraints, these results are described in STAR Methods and summarized in Table 1.
Table 1: Mathematical programming formulations for ancestral reconstruction problems.
Comparison of the mixed-(integer) linear programming formulations derived using the tree labeling polytope in this work and existing integer (linear) programming formulations. Here, denotes the number of edges in or denotes the size of the label set , and is the number of reticulation vertices in the network .
| Problem | Number of Continuous Variables | Number of Binary Variables | Number of Constraints | Strong Linear Relaxation | Weighted Cost | Reference |
|---|---|---|---|---|---|---|
| Generalized Small Parsimony | None | N/A | Yes | This work | ||
| Parsimonious Migration History | Yes | Yes | This work | |||
| Parsimonious Migration History | None | Unknown | No | [35] | ||
| Softwired Small Parsimony | Yes | Yes | This work | |||
| Softwired Small Parsimony | None | No | No | [31, 37] | ||
| Multi-Cost Small Parsimony | None | Yes | Yes | This work | ||
| Convex Recoloring of Trees | None | Yes | Yes | This work | ||
| Convex Recoloring of Trees | None | Yes | Yes | [32, 91] |
Fast and accurate migration history inference on simulated data
Using the tree labeling polytope, we derive fastMACHINA, an efficient version of MACHINA, which is a mixed integer linear programming algorithm to infer the most parsimonious history of migrations between a primary tumor and multiple metastases in a cancer patient11. MACHINA’s mixed integer linear programming formulation of the parsimonious migration history problem encodes the ancestral labeling using binary variables recording if node is labeled by state in together with binary variables to represent the migration graph (Table 1). fastMACHINA accurately infers migration histories on large simulated instances containing thousands of cells and dozens of anatomical sites (STAR Methods).
We compared fastMACHINA to MACHINA on simulated tumor evolution and metastasis data using a fitness based model from El-Kebir et al.11 under two different constraints on the migration graph. In particular, we constructed 256 tumor evolution and metastasis scenarios with extant cells and lineage tree errors across 16 random seeds, assuming that the migration graph – describing the migrations between different metastatic sites – was either a tree or a directed acyclic graph. The result of each simulated instance was a cellular phylogeny , a true migration graph , and a vertex labeling which describes the anatomical location of every cell. Simulation and evaluation details are provided in STAR Methods.
fastMACHINA solved all 256 simulated instances in under 15 minutes, while MACHINA failed to terminate within 24 hours on one of the instances containing extant cells, half of the instances containing extant cells, and all of the instances with or more extant cells (Figure 2a). MACHINA’s runtime was also quite prohibitive, taking a median of over 2 hours to terminate on instances containing only extant cells (Figure 2a). In contrast, fastMACHINA easily scaled to instances containing thousands of extant cells, while exhibiting only a slight increase in runtime (Figure 2a). When MACHINA did terminate, fastMACHINA and MACHINA inferred identical migration graphs and parsimony scores.
Figure 2: The tree labeling polytope reduces the time required to solve ancestral reconstruction problems.

a) The runtime of fastMACHINA and MACHINA as a function of the number of extant cells. Each boxplot contains 64 simulated instances and the success frequency of MACHINA within a 24 hour time limit is reported. fastMACHINA terminated on all instances. b) The time to solve the mixed integer linear programming formulations of the softwired small parsimony problem versus the number of taxa and reticulation vertices for the tree labeling polytope formulation and the method of Fischer et al.31.
We compared fastMACHINA to Fitch parsimony, which places no constraints on the inferred migration graph , on 256 larger tumor evolution and metastasis scenarios containing extant cells where we were unable to apply MACHINA. These tumor evolution and metastasis scenarios contained anywhere from 3 to 71 (median 12) anatomical sites, representing a diversity of scenarios (Supplementary Figure 1). In the absence of any lineage tree error, both fastMACHINA and Fitch parsimony performed well, identifying the ground truth migration graph (Supplementary Figures 2a, 3a). In the presence of even a small amount of lineage tree error, however, fastMACHINA more accurately recovered the true migration graph in terms of the F1 score between the edges of the true and inferred migration graphs (Supplementary Figures 2b, 3b). In particular, fastMACHINA had far fewer false positive migration relationships than Fitch parsimony, though had slightly more false negative relationships (Supplementary Figures 2b, 3b). Finally, fastMACHINA and Fitch parsimony had slightly better performance in identifcation of DAG migration graphs compared to tree migration graphs. We hypothesize this is due the tendency of the parsimony criterion to infer overly complex migration histories35, and these overly complex histories are more likely to be DAGs.
Fast softwired small parsimony for simulated phylogenetic networks
We compared our tree labeling polytope based mixed integer programming formulation of the softwired small parsimony problem (STAR Methods) on phylogenetic networks to the formulation of Fischer et al.31 further studied in37. The Fischer et al. formulation31,37 encodes the ancestral labeling using binary variables to record if is labeled by state in the network and uses binary variables to record the presence of a transition across edge .
In contrast to Fischer et al. formulation, our tree labeling polytope formulation blends the power of mixed integer programming with the tree structure exploited by specialized dynamic programming algorithms27,28,30,63, a combination that – to our knowledge – is not exploited by any existing algorithm.
We compared our formulation to the Fischer et al. formulation on 198 simulated phylogenetic networks with extant taxa and reticulations across random seeds using an amino acid alphabet (i.e. ). To construct each network, we first simulated phylogenetic trees with taxa using the simulator Ngesh68 and uniformly at random constructed reticulation vertices. Then, we uniformly at random sampled the character-state of each extant site from the amino acid alphabet to obtain the sequences at the leaves. While the procedure for simulating sequences is not biologically realistic, it was selected to match the simulation procedure used in Fischer et al.31. To ensure a fair comparison, we benchmarked both our formulation and the Fischer et al. formulation using the mixed-integer programming software Gurobi69. Simulation details are further described in STAR Methods.
The tree labeling polytope based formulation was substantially faster than the Fischer et al. formulation on all 198/198 instances, with the Fisher et al. formulation terminating within an 8 hour time limit on only 171/198 instances (Figure 2b). Even in the absence of any reticulation in the network – where the problem reduces to small parsimony on trees – the Fischer et al. formulation struggled, taking a mean of 250 times longer to terminate compared to the tree labeling polytope formulation (Figure 2b). Furthermore, while the time required to solve our tree labeling polytope formulation was stable in the size of the network, the time required to solve the Fischer formulation increased considerably in the size of the network (Figure 2b). This is probably, in part, due to the fact that the number of binary variables in our formulation is independent of the size of the network, which is not the case with the Fischer et al. formulation. To quantify the strength of each formulation, we computed the integrality gap across all instances, where is the true objective and is the value of the linear programming relaxation. While the mean integrality gap of the tree labeling polytope formulation was 1.02, the mean integrality gap for the Fischer et al. formulation was 1.18, demonstrating the improved strength of the formulation obtained using the tree labeling polytope (Supplementary Figure 4).
Large-scale migration history inference on lineage tracing data
We evaluated fastMACHINA on a large single-cell sequencing dataset modeling metastatic dissemination in mice70. Using recently developed lineage tracing technology57,71,72, Yang et al.70 equipped 5,000 human lung adenocarcinoma cells (A549) with a lineage tracer and surgically implanted the cells into the left lung of the immunodeficient mouse “M5k”. Fifty-four days post-surgery, the mouse was sacrificed and tumor samples were collected from the six anatomical sites (Figure 3a), undergoing single-cell sequencing. The result of the experiment was then a set of 41,847 single-cell profiles measured across the six anatomical locations, which were used to reconstruct the cellular lineages of 100 distinct tumor clones. Using the resultant cellular lineages, a key goal of70 was to infer the routes of metastasis, or in our terminology, the migration graph associated with the lineage tree . The existing analysis, however, found by selecting a most parsimonious ancestral labeling and taking the induced migration graph . It is known that migration graphs inferred this way can be misleading11, and that additional constraints are necessary. To resolve this issue, MACHINA11 imposes additional constraints on the induced migration graph . Unfortunately, MACHINA is unable to scale to these large lineage trees, which contain upwards of 5, 616 cells.
Figure 3: Inferred migration histories in a mouse model of lung adenocarcinoma.

a) The 41,847 sequenced cells of mouse “M5k”15 are located in the left lung (LL), liver (LV), mediastinal lymph tissue (M1, M2), and right lung (RW). b) The distribution of the anatomical locations of the 5,616 cells in the largest clone CP3. c-e) The migration graphs and parsimony scores induced by the most parsimonious ancestral labeling such that is c) unconstrained, d) a directed acyclic graph, and e) a tree for the lineage tree constructed on clone CP3. f) The cell lineage tree constructed by LAML74 for clone CP28. g-i) The migration graphs and parsimony scores induced by the most parsimonious ancestral labeling for clone CP28.
Following15, we selected the 83/100 clones from the mouse “M5k” which passed quality control checks and were labeled CP1 through CP100. For each of the 83 clones, we obtained pre-processed character matrices and the anatomical labelings of the cells from the original publication15. To infer the cellular lineage trees, we first applied Startle73, a specialized tool for inferring cellular lineages from CRISPR-Cas9 based lineage tracing data. Next, we inferred branch lengths on these trees and further optimized the topologies using LAML74.
We applied fastMACHINA (STAR Methods) to infer migration graphs for the 83 lineage trees under three topological constraints on the induced migration graphs. In particular, we inferred the most parsimonious ancestral labelings such that the induced migration graph was i) unconstrained, ii) a directed acyclic graph, and iii) a tree. From this, we obtained three ancestral labelings and migration graphs for each of the 83 lineage trees, corresponding to a nested set of constraints on . For a fixed tree, we denote the parsimony scores and migration graphs inferred by fastMACHINA under the three constraints i), ii), and iii) as and respectively.
For the largest clone CP3, which contained 5,616 cells drawn from 6 anatomical locations, we noticed that the parsimony scores increased substantially as more constraints were added (Figure 3c–e). In particular, an additional 148 metastatic migrations were required to explain the anatomical locations of the cells when no reseeding was allowed to occur. Examination of the inferred migration graphs (Figure 3c–e) shows that the majority (118/148) of these additional migrations occurred from the left lung to the mediastinal lymph tissue. Since we know the tumor originated in the left lung (LL), a possible explanation is that several cells metastasized to the lymph tissue (M1-M2), upon which a clonal expansion occurred. This hypothesis would explain both the large number of tumor cells in the lymph tissue (Figure 3b) and the reseeding events back to the left lung. Further, multiple migrations to the lymph tissue would explain the increase in the parsimony score upon requiring that each site is seeded by a single parent, as it contradicts the hypothesis that both the left lung and the mediastianal tissue act as primary seeding sites.
For the smaller clone CP28, which contained 180 cells drawn from 6 anatomical sites (Figure 3f–i), migrations were required to explain the anatomical locations of the cells when reseeding was not allowed compared to , and thus the evidence for reseeding is not strong. Further, one of the reseedings inferred in occurred from the right lung back to the mediastinal tissue, a surprise given that most of the right lung cells form a single clade in (Figure 3f). Upon enforcing the constraint that each site is seeded by a single parent, however, many more migrations are required and all migrations occur from the left lung. Given the reported role of lymph tissue as a transit hub for metastasis75,76 and the large increase in migrations, it seems implausible that each parent was seeded by only a single parent in clone CP28.
A quantitative measure for the monoclonality of metastasis via convex recolorings
We applied our tree labeling polytope based algorithm for the convex recoloring problem (STAR Methods) to measure the monoclonality of metastasis13 on 83 lineage trees from Yang et al.57. The monoclonal theory of metastasis states that each metastasis is founded by a single-cell13. Unfortunately, until recently it has been challenging to quantitatively measure monoclonality on real data, as bulk and single-cell DNA sequencing data typically do not provide the necessary phylogenetic resolution.
We construct a quantitative measure for the monoclonality of metastasis by answering the following question: what is the minimum number of deletions of cells (taxa in phylogenetic terminology) required to obtain a monoclonal explanation of the cellular lineage? Recall that metastasis is monoclonal if each metastasis is founded by a single cell. Thus, in the lineage tree of a monoclonal tumor, the number of migrations between anatomical sites is one less than the number of anatomical sites. Mathematically, we write that metastasis is monoclonal if and only if the total number of migrations in the true ancestral labeling is . This is equivalent to the labeling being convex4 on . We measure the monoclonality of metastasis by determining the minimum number of leaves to delete from such that the leaf labeling on the resultant tree is convex. This quantity is computed by solving the convex recoloring problem on trees Moran & Snir77.
We computed the monoclonality measure on the 83 lineage trees constructed in Yang et al.57 (STAR Methods). Thus, for each lineage tree we obtained the minimum number of deletions of cells required for a monoclonal explanation along with the deleted cells. Across all 83 lineage trees, a mean of 19.85% of the cells were required to be deleted in order to obtain a monoclonal migration history for the observed lineage tree (Supplementary Figure 8). Consequently, unless a large fraction of the cells in the inferred lineage trees are incorrectly placed, there is little support for the monoclonal theory of metastasis across the 83 lineage trees. This conclusion is concordant with an increasingly large body of work on the polyclonality of tumors58 as well as the notion of metastatic potential described in Yang et al.57.
Discussion
We introduced the tree labeling polytope, a geometric object to evaluate ancestral labelings of phylogenetic trees. The tree labeling gives a geometric description of Sankoff’s algorithm with similarly efficient optimization over ancestral labelings. The tree labeling polytope provides a new approach to solve structured ancestral labeling problems found in phylogenetics when the label set is finite and there is a simple notion for scoring an ancestral labeling. This encompasses both parsimony models and probabilistic models of sequence evolution that are widely used in phylogenetics. For example, for the joint maximum-likelihood reconstruction problem described in Pupko et al.60, the tree labeling polytope implies an efficient linear programming algorithm.
There are some limitations of our combinatorial approach. In particular, the tree labeling polytope is less applicable for inferring continuous traits, such as ancestral transcriptomic states. Moreover, while the tree labeling polytope can be used to find the most probable ancestral labeling, maximum likelihood estimation marginalizes over all ancestral states using Felsenstein’s pruning algorithm78. An interesting open question is whether polyhedral techniques can be useful in this setting. Finally, we proposed a quantitative measure for the monoclonal theory of metastasis. An interesting future extension would be to place such a measure under an explicit statistical model; e.g. by formulating a hypothesis test.
We anticipate applications of the tree labeling polytope to a larger array of biological questions, such as to estimating the extent of hybridization in bacteria79,80 or to inferring cell fate differentiation maps in developing systems26.
RESOURCE AVAILABILITY
Lead Contact
Further information and requests for resources should be directed to and will be fulfilled by the Lead Contact, Benjamin J. Raphael (braphael@princeton.edu).
Materials Availability
This study did not generate new materials.
Data and Code Availability
This paper analyzes existing, publicly available data. These accession numbers for the datasets are listed in the key resources table.
All original code has been deposited at github.com/raphael-group/tree-labeling-polytope and archived on Zenodo (doi: 10.5281/zenodo.18701953)
Any additional information required to reanalyze the data reported in this paper is available from the lead contact upon request.
KEY RESOURCES TABLE
| REAGENT or RESOURCE | SOURCE | IDENTIFIER |
|---|---|---|
| Deposited data | ||
| Mouse metastasis in cancer xenografts | Quinn et al.70 | doi: 10.5281/zenodo.4243161 |
| Software and algorithms | ||
| Tree labeling polytope | This work | github.com/raphael-group/tree-labeling-polytope |
| Tree labeling polytope software repository | This work | doi: 10.5281/zenodo.18701953 |
STAR Methods
METHOD DETAILS
The tree labeling polytope
In a series of three papers53–55, Erdős and Székely provided a linear programming formulation of the small parsimony problem as a corollary to a combinatorial duality theorem. However, their formulation only worked for unrooted trees and a restricted class of cost functions. Further, the proposed formulation required as opposed to linear inequalities. In this section, we develop a linear programming formulation of the small parsimony problem with linear inequalities. To obtain this result, we prove that the tree labeling polytope is described by a small set of linear inequalities, which we call the tree labeling system. Proofs of all propositions, theorems, and corollaries without attached references are found at the end of STAR Methods.
Preliminaries
We introduce basic notation, definitions, and results from polyhedral theory, using the notation of Schrijver81. A vector is integral (resp. rational) if (resp. ). Similarly, a matrix is integral (resp. rational) if (resp. ). A polyhedron is a set of the form , where is a matrix and is a vector. A polyhedron is integral if every face of contains an integral vector. A polytope is the convex hull of a finite set of vectors. Equivalently, a polytope is a bounded polyhedron. The convex hull of a finite set of vectors is denoted by . A vector is an extreme point of a polyhedron if it cannot be written as a convex combination of any distinct set of points in . A linear system is totally dual integral if for every integral vector , any finite solution to the dual problem is attained by an integral vector.
The following result from polyhedral theory, originally due to Edmonds82, reduces a proof of integrality of the primal problem to a proof of integrality for the dual problem.
Proposition 1 (Edmonds & Giles82). Let be a rational linear system with integral that is totally dual integral. Then, the polyhedron is integral.
This result follows from the fact that for a totally dual integral system, the optimal solution to the linear program always takes an integral value. This is because, for a totally dual integral system, the optimal dual vector is integral and the product must be an integer.
Results
To derive a polynomial-sized description of the tree labeling polytope, our starting point is a set of necessary linear inequalities satisfied by all vectors . All vertices have if and only if there is a transition between labels and across edge . Consequently, we define the following system of linear inequalities satisfied by all vertices of the tree labeling polytope.
Definition 2. Let be a rooted tree and be a label set. The tree labeling system corresponding to is the following system of linear (in)equalities:
| (5) |
| (6) |
| (7) |
We denote the system of linear equalities (5)–(6) by and call the tree labeling matrix.
The intuition behind the above set of inequalities is the following. In the case where , equation (5) requires that each (non-root) vertex has only a single label, while equations (6)–(7) enforce that for exactly one pair . This set of necessary linear inequalities exactly describes the tree labeling polytope, in the sense of the following two results.
Theorem 1. Given a rooted tree and a label set , the corresponding tree labeling system is totally dual integral. Consequently, all vertices of the polytope are integral.
To formally state the second result, define the augmented tree of as the rooted tree obtained by appending the root and the edge to . For a subset of edges, let be the subvector of consisting only of entries with . The following result then states that the tree labeling polytope is the projection of the feasible region of the tree labeling system for the augmented tree .
Theorem 2. Given a rooted tree and a label set , let be the tree labeling system corresponding to . Then, the tree labeling polytope is
| (8) |
The reason for using an extended formulation83 (i.e. defining as the projection of a higher-dimensional polytope) in the preceding theorem is to ensure that the root vertex has only a single label without appending additional constraints specific to the root vertex. Specifically, the tree labeling system (5)–(7) does not enforce a label constraint on the root vertex as all nodes are treated identically and the root has no parent. To ensure that the root vertex has a label constraint, we add an outgroup by constructing . This has the virtue of simplifying both the definition of the tree labeling system and our proofs of integrality, but requires the additional projection step.
To recover a description of the tree labeling polytope which avoids augmenting with an outgroup, we apply Fourier-Motzkin elimination81 to the set of variables associated with the augmented edge . Applying Fourier-Motzkin elimination to the tree labeling system corresponding to and removing redundant (i.e. linearly dependent) constraints results in the following corollary to Theorem 2.
Theorem 3. Given a rooted tree and a label set , the tree labeling polytope is the feasible set of the following system of linear (in)equalities:
| (9) |
| (10) |
| (11) |
| (12) |
In the preceding, is an arbitrary ordering of vertices and is an arbitrary ordering of edges off the root. The linear equalities (9)–(11) are linearly independent.
Since the above linear system consists of linearly independent equalities, we see that the tree labeling polytope is the intersection of an affine subspace of dimension with the non-negative orthant. As there exists a strictly positive feasible solution (i.e. ) this proves that the dimension of the tree labeling polytope is also , leading to the following two propositions.
Proposition 2. The tree labeling polytope has vertices.
Proposition 3. The tree labeling polytope has dimension .
Finally, we provide a combinatorial description of the adjacency relation between two vertices on the tree labeling polytope. As the simplex algorithm45 follows adjacent vertices, this description shows that the simplex algorithm applied to the small parsimony problem sequentially alters a connected component of the current labeling of until optimality.
Proposition 4. Two vertices and are adjacent on the tree labeling polytope if and only if the set of vertices upon which they differ, , forms a connected component in .
Proposition 5. The diameter of the tree labeling polytope is at most .
Algorithms
In this section, we provide (integer) linear programming algorithms for the generalized small parsimony, the parsimonious migration history, softwired small parsimony, multi-cost small parsimony, and convex recoloring problems using the tree labeling polytope. We discuss the strength of the resultant mathematical programming formulations as well as the number of binary variables.
The generalized small parsimony problem
The classical algorithm for the small parsimony problem is based on the Sankoff-Rousseau recurrence3–5. The algorithm, also known as Sankoff’s algorithm, is an bottom-up dynamic programming algorithm based off this recurrence which we briefly describe. Let denote the minimum cost labeling of the subtree of rooted at vertex such that is labeled by . Then,
Filling in the table , bottom-up leads to the dynamic programming algorithm, where the small parsimony score of the labeling is . The dynamic programming table has size and each entry takes an average of operations to fill in, leading to a total time complexity of . When both the tree and cost function are provided as input, this runtime is optimal, as it takes time to read off the cost function .
The polynomial time algorithm we propose for solving the small parsimony problem is similarly simple. Let be the tree obtained by appending a root to and adding the edge . Let be the tree labeling system corresponding to . Using this notation, we obtain the following theorem as a corollary of Theorem 1, which states that the small parsimony problem is solved with a polynomial-sized linear program.
Corollary 1. The small parsimony problem is solved with the linear program (P) containing variables and constraints:
| (P) |
Proof. The proof of correctness follows as a corollary from Theorem 1. Specifically, Theorem 1 implies that the linear system , without the constraint if is totally dual integral. However, the additional constraint consists of replacing the inequality with the equality , an operation that preserves total dual integrality (see Proposition 2.3 in Cook84). Thus, the above linear program always attains an integral (and in particular, binary) solution (Proposition 1). ■
We note that in a series of three papers53–55, Erdős and Székely did provide a partial linear programming of the small parsimony problem via a combinatorial duality theorem. However, their formulation did not generalize to rooted trees, or the common case where the cost function is either edge dependent, label dependent, or non-integral. Further, the formulation used variables and constraints, which is larger by a factor of .
The parsimonious migration history problem
In the parsimonious migration history problem we possess the additional constraint that the induced migration graph . For simplicity of presentation, we will work with in the case where consists of the set of rooted trees, though our techniques also apply to the case where is the set of directed acyclic graphs or directed paths with only slight differences, described briefly at the end of the section. We also assume the inferred vertex labeling is required to be an extension of the leaf labeling , as this implies the weak connectivity of , stated as follows.
Lemma 1. If extends and , then the migration graph is weakly connected.
Proof. Let be the label of the root vertex . Consider any other label . Since range , there exists such that . Consider the path in from to . The path yields a walk in . Eliminating tours in yields a path from to in . Since there is a path from to any other vertex in , the migration graph is weakly connected, completing the proof. ■
To start, we model the edges of the migration graph with binary variables which denote the presence or absence, respectively, of an edge . To relate the migration graph to the labeling, we add a set of linking constraints for all , which connect the migration graph to the labeling associated with . Specifically, if there is a label change from to across edge then , which implies that . To ensure the migration graph defined by forms a tree, there are many options, such as using flow, power set, or spanning tree constraints. Because of the weak connectivity of (Lemma 1), however, we enforce that is a tree by simply setting . In this setting, it is easy to verify that the following integer linear program then solves the parsimonious migration history problem:
| (P) |
Interestingly, the integrality constraint in (P) need not be explicitly enforced and can be relaxed to . This is because for any fixed solution , the only constraint relating and is . If , then this turns into the equality constraint , which is well-known to preserve total dual integrality (see Proposition 2.3 in Cook84). Similarly, if , then since the constraints are is redundant. Consequently, for any fixed binary vector , the above linear system is totally dual integral, implying that the optimum is always achieved by an integral . Thus, we replace (P) with the (equivalent) mixed integer linear program:
| (Q) |
Of note, the number of integer variables in (Q) is of order which is independent of the size of . Consequently, we refer to the formulation as fixed parameter tractable in , since it can be solved in polynomial time by solving a linear program for each setting of . In this way, the formulation (Q) blends together the power of integer programming and Sankoff’s algorithm, resolving the trade-off between integer programming and fixed parameter tractability described in El-Kebir35.
However, as mentioned earlier, the above formulation (Q) has another nice property related to the strength of its linear programming relaxation, described as follows. We form the Lagrangian relaxation of the above integer program by “convexifying” the complicating constraint. In detail, we form the Lagrangian dual problem by relaxing the constraints associated with :
| (ℒλ,γ) |
Then, since (ℒλ,γ) is totally dual integral when restricted to , totally unimodular when restricted to (as is totally unimodular) and there are no constraints connecting and , the linear relaxation of (ℒλ,γ) always attains its optimum at an integer vector . Using the well-known fact that if there is always an integral solution to the linear relaxation of the Lagrangian relaxation, the value obtained by the linear programming relaxation matches that of the Lagrangian relaxation, we obtain the following result.
Corollary 2. The parsimonious migration history problem can be expressed as the mixed integer linear program (Q) with continuous variables and binary variables whose linear relaxation .
To extend the above formulation to the case where is the set of directed acyclic graphs, one could, instead of enforcing that , append the cycle elimination constraints for all directed cycles . This adds an exponential number of constraints, but these can be handled implicitly with a cutting plane approach as there is a polynomial time separation oracle for the cycle elimination constraints85. Other, polynomial size formulations for ensuring that induces a directed acyclic graph also exist, though we expect the exponential sized formulation together with a separation oracle to be preferable. The case when is a path is a bit easier: a directed graph is a path if and only if it is a tree where no vertex has out-degree greater than or equal to 2. Thus, appending the constraints to (Q) ensures that induces a path.
The softwired small parsimony problem on phylogenetic networks
In the softwired small parsimony problem, we no longer have a rooted tree , but rather a phylogenetic network . As before, we append a synthetic root to and add the edge to . Noting that the softwired small parsimony score is defined as the minimum over all trees displayed by , we need additional variables to select the displayed tree. We thus create a binary variable to take value 1 if and only if is in the tree displayed by . For all , we fix , ensuring that these edges are always included in the displayed tree. Then, the following integer linear program solves the softwired small parsimony problem on phylogenetic networks:
| (P) |
We note that, as opposed to the parsimonious migration history problem, it is less obvious that (P) solves the small parsimony problem on phylogenetic networks. To see that (P) is correct, first note that the last constraint in (P) implies that the selected edges form a rooted spanning tree of . For any fixed set of selected edges , the variables if . Further, the first two constraints of (P) are redundant if either and reduce to the matching constraints (5) of the tree labeling system otherwise.
Analyzing the above integer linear program more carefully, we observe that integrality on need not be explicitly enforced. Thus, we can replace (P) with the following (equivalent) mixed integer linear program.
| (Q) |
To see that this formulation is correct, we consider any fixing of the binary vector with . By the same reasoning as above, the first two constraints of (P) are redundant if either and reduce to the matching constraints (5) of the tree labeling system otherwise. Further, is set to 0 for all , not affecting the objective. Since for a fixed binary vector the above reduces to the tree labeling system with additional equality constraints, the resultant system is totally dual integral (Proposition 2.3 in Cook84). Consequently, it attains its solution at an integral vector, proving that integrality need not be explicitly enforced on the variables in (Q), leading to the following theorem.
Corollary 3. The softwired small parsimony problem can be expressed as the mixed integer linear program (Q) containing binary variables and continuous variables whose linear relaxation as .
The multi-cost small parsimony problem
Suppose we have two cost functions as well as a bound on the second cost . The multi-cost small parsimony problem is nearly a small parsimony problem with cost function , but possesses the additional linear constraint that . Because of this similarity, it is tempting to simply add this linear constraint to the linear program that solves the small parsimony problem, obtaining:
| (LP) |
Unfortunately, this additional constraint destroys the integrality of the linear program.
Instead, we suggest that one solves the following integer linear program, obtained by enforcing integrality on :
| (P) |
Of course, integer programs are in general difficult to solve – it seems we are back where we started. However, as mentioned earlier, the above formulation (P) has a neat property related to the strength of its linear programming relaxation, described as follows. We form the Lagrangian relaxation of the above integer program by “convexifying” the complicating constraint:
| (ℒλ) |
Then, for any is clearly a lower bound on . In fact, the relaxation (ℒλ) is the optimal solution to the small parsimony problem with weight function . Said another way, we have that where is defined as the weighted sum of and .
Thus, we can view the Lagrangian relaxation (ℒλ) as either i) replacing the hard constraint that with the soft linear penalty or ii) solving a perturbed small parsimony problem. The Lagrangian dual problem, then consists of finding the relaxation that maximizes the lower bound , namely solving the one-dimensional convex optimization problem
| (13) |
Intuitively, one expects that provides a quite reasonable lower bound , experiments will show this is indeed the case.
It is well known (see Corollary 10.145) that if there is always an integral solution to the linear relaxation of the Lagrangian relaxation, one obtains . Due to the tree labeling polytope, we know that there is always an integral solution to the Lagrangian relaxation, since the linear system in (ℒλ) is totally dual integral. Consequently, it follows that , or in other words, that the linear programming relaxation of is as strong as the Lagrangian relaxation, though in general we only have . This is summarized as the following corollary of Theorem 1.
Corollary 4. The multi-cost small parsimony problem can be expressed as the integer linear program (P) with binary variables and constraints whose linear relaxation .
The convex recoloring problem on trees
Originally motivated by applications in phylogenetics, the convex recoloring problem on trees77 aims to find the minimum number of leaf label changes such that the resultant labeling is convex. The convex recoloring problem is known to be NP-complete on paths, trees, and general graphs29,77,86, and has a long history in discrete mathematics, theoretical computer science, and operations research. Due to its computational intractability, a wide variety of approaches for solving the problem have been applied, spanning parameterized exact algorithms, approximation algorithms56,87,88, integer programming algorithms32,33,89–91, and heuristics92.
However, the convex recoloring problem on trees has another interpretation that has yet to be exploited. First, observe that a leaf labeling is convex if and only if there exists an extension of such that the small parsimony score under Wagner parsimony . Then, it follows that the convex recoloring problem finds the minimum number of leaf label changes such that the small parsimony score is . Following this reasoning further, define if is a pendant edge with and set otherwise. Let . Then, the convex recoloring problem is equivalent to the multi-cost small parsimony problem with cost functions and , as records the number of leaf label changes and records the Wagner parsimony score.
Total dual integrality of the tree labeling system
In this section, we provide a proof of Theorem 2 by demonstrating the total dual integrality of the tree labeling system. While for many polytopes, such as flow polytopes, it is simpler to prove integrality by demonstrating the total unimodularity of the corresponding constraint matrix, the tree labeling matrix is not totally unimodular. To prove total dual integrality, we develop a polynomial-time dynamic programming algorithm for solving the dual of the linear program . As a consequence of the analysis of our algorithm, we prove the total dual integrality of the tree labeling system.
We will make use of the following additional definitions and results from polyhedral theory81. A supporting hyperplane of a polyhedron is a set for some vector and . A face of a polyhedron is the intersection of with a supporting hyperplane. A facet of a polyhedron is a maximal face of not equal to . A vertex of a polyhedron is a face consisting of a single point. An integer matrix is totally unimodular if every submatrix of has determinant in {0, ±1}.
Proposition 6 (Schrijver81). A vector is a vertex of if and only if is an extreme point of .
Proposition 7 (Schrijver81). Let be a rational, totally unimodular matrix and be an integral vector. Then, the polyhedron is integral.
Proposition 8 (Schrijver81). Let be a rational matrix. Then, the polyhedron is integral if and only if all vertices of are integral.
To fix notation, let be a rooted tree with root , leaf set , and label set . Let be the tree labeling system corresponding to . Let be the tree labeling linear program where the cost vector is assumed to be integral.
To start, we derive an explicit form of the dual problem , as stated below.
Lemma 2. The dual linear program is equivalent, up to an additive integer constant, to the following optimization problem:
Further, is attained at an integral vector if the optimum of the above linear program is attained at an integral vector.
Proof. Associate the dual variables with the linear constraints (5) and the dual variables with the linear constraints (6). Taking linear combinations of the dual variables with the constraints (5)–(6) yields
The reasoning for the above equality is that appears positively with for all children , negatively with , and positively with if is a leaf. Further, if is the root vertex, does not appear negatively with any dual variable. Consequently, the dual linear program becomes:
Since we are maximizing with respect to and , in every optimal solution . If is a fixed integer constant with respect to the optimization objective and can be ignored. Consequently, we optimize out the dual variable to obtain the result. ■
Next, we state a simple algebraic identity needed in the subsequent analysis.
Lemma 3. For all real numbers and where and ,
| (14) |
Proof. Since the sum of minimums is upper bounded by the minimum of sums, we have that the right-hand side of (14) is an upper bound on the left-hand side of (14). To obtain equality, it then suffices to provide a solution where equality holds. Setting
for proves the claim. ■
We now provide a recursive procedure to compute the optimal value of the dual optimization problem. Then, after backtracking to obtain the dual variables, we observe that the optimal value of the dual linear program is attained at an integral vector.
Lemma 4. The optimal value of the dual linear program can be computed in time and is an integer. There exists an optimal dual vector that is integral and can be computed in time.
Proof. Let be the subtree of rooted at vertex . Consider the following linear program, parameterized by a vertex and an -dimensional vector :
| (Γℓ,α) |
Then, is the optimal value of the dual linear program for the subtree of rooted at vertex such that the dual vector . Consequently, it follows from Lemma 2 that is the value of the optimal solution to the dual linear program. Notice that is monotonically increasing in the coordinates : as increases, increases, which only makes it easier to satisfy the constraints in (Γℓ,α).
Now, we demonstrate how to compute recursively when provided for the children . From this recurrence, we will obtain a polynomial time dynamic programming algorithm to compute , upon which we perform backtracking to recover a set of optimal dual variables.
Let be the children of in . Then, satisfies the following recurrence relation at all non-root vertices with :
| (15) |
| (16) |
The first equality follows from the definition of (Γℓ,α). The second from the fact that is monotonically increasing in the coordinates of . The third follows from the equality constraint in the maximization.
Using this recurrence, we show how to compute inductively. We say that the inductive hypothesis holds at a vertex if for some .
For the base case, observe that if is a leaf with pendant edge , then . The inductive hypothesis then holds at leaf vertices by setting .
For the inductive step, let be a non-root vertex with and assume the inductive hypothesis holds at all descendants of . Plugging the inductive hypothesis into (16) yields,
| (17) |
| (18) |
The first equality follows from the induction hypothesis. The second from the algebraic identity provided by Lemma 3. The third from the definition of . The final equalities follow by algebraic manipulation and setting appropriately. Thus, the inductive claim holds at all internal (non-root) vertices.
The above proof that also provides a formula for computing that we turn into a dynamic programming algorithm, described as follows.
Visit the vertices in their post-order depth-first search traversal index order (bottom-up).
At a leaf vertex , set where is the unique edge into .
At an internal vertex , set where is the unique edge into .
Compute the optimal objective value .
The above algorithm takes time and space to compute and store all , since each value takes an average of time to compute. From this, we also see that takes an integer value, since it is a sum over values , all of which are integral.
The integrality of , however, is not enough to complete the proof. Indeed, we also need to find an integral set of dual variables that realizes this objective. Backtracking over the pre-computed values provides a solution, described as follows.
Visit the vertices in their pre-order breadth-first search traversal index (top-down).
At the root , set for all .
At an internal vertex , let . Then, set and set , where is the unique edge into .
To see feasibility of the resulting dual variables, note that the constraints are satisfied (and tight) for the dual problem by a straightforward calculation. To see optimality, observe that to obtain (16) from (15), we set and to obtain (18) from (17) we set (see proof of Lemma 3). Noting that play the role of and plays the role of , this corresponds exactly to the update in our backtracking algorithm. Consequently, the update is an optimal setting of the dual variables , provided we then optimally set the dual variables corresponding to the descendants of . Applying this reasoning recursively proves the optimality of our backtracking procedure.
Consequently, after performing backtracking, the dual variables are feasible and achieve the objective . Since is optimal, we have found an integral vector realizing the dual objective. This completes the proof. ■
As a corollary to the above theorem and Proposition 8, we obtain our first main result.
Theorem 1. Given a rooted tree and a label set , the corresponding tree labeling system is totally dual integral. Consequently, all vertices of the polytope are integral.
A few comments are now in order. First, we note the appearance of self-duality in our proof of the total dual integrality of the tree labeling system. In particular, interpret as the minimum cost labeling of the subtree rooted at such that the parent of is labeled by . Then, reasoning has that satisfies the recurrence relation . Interestingly, however, this is exactly how we compute the dual objective in the preceding proof. Thus, the dual is essentially solved by a modified version of Sankoff’s algorithm, leading us to refer to the tree labeling system as self-dual.
Theorem 2. Given a rooted tree and a label set , let be the tree labeling system corresponding to . Then, the tree labeling polytope is
| (8) |
Proof. To complete the proof, we need to show two inclusions hold. The first inclusion that
is straightforward. Consider a vertex labeling of and an arbitrary extension of to a vertex labeling of . Since satisfies all inequalities (5)–(7), it follows that . Since by definition , we know that . Since this holds for an arbitrary vertex labeling, it holds for all vertex labelings, completing this direction of the proof.
For the second inclusion, let be a vertex of the polytope . By the total dual integrality of the tree labeling system (Theorem 1) it follows that is an integral vector. Indeed, is also a binary vector. To see this, note that for all pendant edges , implying is binary. Propagating this constraint up the tree (using (5)–(6)), however, we also have for an arbitrary edge , allowing us to also conclude that is binary. Since is a binary vector satisfying (5), each vertex other than , which is not in , has a unique label. Thus, there exists a unique vertex labeling of with , completing the proof. ■
By applying Fourier-Motzkin elimination to the preceding linear system, we remove the need to describe the tree labeling polytope as the projection of a higher-dimensional polytope. Simultaneously, we also remove dependent linear (in)equalities from our description, providing the following result.
Theorem 3. Given a rooted tree and a label set , the tree labeling polytope is the feasible set of the following system of linear (in)equalities:
| (9) |
| (10) |
| (11) |
| (12) |
In the preceding, is an arbitrary ordering of vertices and is an arbitrary ordering of edges off the root. The linear equalities (9)-(11) are linearly independent.
Proof. Let be the augmented tree obtained by appending the root vertex and edge to . Suppose is the tree labeling system corresponding to . Then, applying Fourier-Motzkin elimination to the set of variables in the linear system results in the following linear system:
| (19) |
| (20) |
| (21) |
Since the linear system is totally dual integral by Theorem 1, it follows from Theorem 2.5 in Cook84 that the Fourier-Motzkin eliminated system given above is totally dual integral and describes . We now remove redundant constraints from the above system to obtain a linearly independent description of .
Suppose and for . Then, (19) holds if and only if
| (22) |
since equality is transitive. Further, (21) holds if and only if . To see this, observe that and (19) imply for all . Applying (20) inductively down the tree then proves that for all edges . This completes the first part of the theorem statement.
Next, we argue that the remaining equalities are linearly independent. To prove this, we perform a case analysis on the three types of equalities, showing that if we remove any equality, we obtain a feasible solution outside the tree labeling polytope .
First, observe that upon removing the constraint (11), becomes feasible but does not lie in the tree labeling polytope, proving that (11) is necessary.
Second, suppose we remove the constraint . Consider an arbitrary labeling and set . We will use the feasible labeling to construct another feasible labeling which does not lie in . To do this, let denote the set of edges in the subtrees rooted at vertices . For all and , we set . For all and , we set and for . Let denote the remaining set of edges. Following a preorder of the edges in , for all we set where and . Using this construction, it is straightforward to verify that is feasible, but since , we have shown that the constraint (9) is not redundant.
Finally, suppose we remove the constraint for a pair of edges and . Let denote the set of edges in the subtree rooted at and set . Then, we define the vector as follows. For all , we set if and otherwise. We set for all and set when . Following a preorder of the edges , we set where and . It is straightforward to verify that is feasible. However, since , we have shown that is not in and that (10) is not redundant. This completes the proof. ■
Proposition 4. Two vertices and are adjacent on the tree labeling polytope if and only if the set of vertices upon which they differ, , forms a connected component in .
Proof. Recall that two vertices and of a polytope are adjacent if and only if there exists a cost vector such that and are the unique vertices on the face where . To prove the adjacency relation for the tree labeling polytope , we follow the proof technique provided in Balinski & Russakoff93, which derives the adjacency relation along the assignment polytope.
Suppose the labelings and differ on multiple connected components of . Consider an (undirected) shortest path between distinct connected components on which the labelings and differ. By definition, we have that
Let be the vertices of the subtree containing obtained by removing edge from . Let be the vertices of the subtree containing obtained by removing the edge from . Consider the labelings and defined as
The constructed labelings and are not equal to and since each of and differ from and at either at or . However, we have that , contradicting the adjacency of and .
To see that , we perform a case analysis on the edges . Since and for all with , we have that for such all . By a similar argument, if and or , we have that . The only remaining cases are and . In the former case, we have that and since . Similarly, we have and , completing the first part of the proof.
For the other direction of the proof, suppose that the labelings and differ on a single connected component . Define the cost vector by,
| (23) |
Then, .
Consider a labeling distinct from and such that . If there exists such that and and , showing that , a contradiction.
Since is distinct from and , there exists such that or . By the preceding arguments, we assume without loss of generality that and . Since and agree outside of , we know that . Suppose that there exists an (undirected) neighbor of such that . Then, we have and , implying that , a contradiction. If there does not exist such a neighbor, we repeat the argument recursively until we find a vertex with a neighbor such that and . If no such vertex exists, however, the connectivity of the component implies that for all , a contradiction. However, if such a vertex does exist, we also obtain a contradiction.
Consequently, all vertices distinct from and must have , implying that and are the unique vertices on the face where . This completes the proof. ■
Proposition 5. The diameter of the tree labeling polytope is at most .
Proof. Any two vertices and differ on at most disjoint connected components. By the preceding proposition, is at most edges away from , proving the claim. The bound is tight in that it is achieved by a star tree on vertices. ■
Total unimodularity of the tree labeling matrix
A stronger sufficient condition for proving Theorem 2 would be to to show that the tree labeling matrix is totally unimodular, from which it follows by Proposition 7. Typically, this is simpler than proving total dual integrality, in fact, there is even a polynomial time algorithm for determining the total unimodularity of a matrix. Unsurprisingly, this is not the case, and we provide a simple counter-example to the total unimodularity of the tree labeling matrix.
Consider the rooted tree with vertex and edge set
where the root vertex is . The tree labeling matrix associated with also depends on the alphabet , which we set to . Then, consider the submatrix of formed by the subset of variables with indices
and the subset of constraints from (5) with indices
In particular,
where the columns correspond to the variables indexed by and the rows the in (5) constraints indexed by . It follows from a computation that det , a violation of the total unimodularity of .
Interestingly, our numerical experiments for the special case when the number of labels and the tree is binary suggest that that the matrix is totally unimodular in this special case. We state this as a conjecture formally below.
Conjecture 1. Let be a rooted, binary tree and let . Then, the tree labeling matrix corresponding to is totally unimodular.
QUANTIFICATION AND STATISTICAL ANALYSIS
Simulating tumor evolution and metastasis
We simulated tumor evolution and metastasis using the fitness-based model described in El-Kebir35 that is an extension of the agent model introduced in Reiter et al.94. The model describes the evolution of cells over a finite number of generations, where associated with each cell is a heritable fitness and a heritable anatomical location. To construct our simulations, we implemented the cell tree simulation procedure described in Supplementary Results A.1 of El-Kebir35. Regarding the model parameters, we fixed the driver fitness effect to 10−1, the passenger fitness effect to 0, the driver mutation probability to 2 × 10−7, the carrying capacity to 5,000, the mutation rate to 10−1, and the migration rate to 10−3. Additionally, upon a migration event we migrated to a new, as opposed to an existing, anatomical site with probability 1/3 as opposed to the 1/2 used in El-Kebir35.
With the parameters of the fitness-based model fixed as described above, each simulation was defined by four remaining parameters: the number of extant cells , the number of lineage tree errors , the migration graph class , and the random seed . To construct each instance, we simulated tumor evolution using the fitness-based model for 40 generations using the graph class and random seed to obtain a tree labeled by anatomical sites . We then took this tree, uniformly sampled leaves from , and took the tree induced on this subset of leaves to obtain . Next, we sequentially performed random subtree-prune-and-regraft operations (selected uniformly at random) to obtain a tree . The restriction of to the subset of vertices provided our vertex labeling and migration graph . Then our simulated instance was the cellular phylogeny , the migration graph , and the vertex labeling .
Simulating phylogenetic networks
Each simulation was described by the number of extant taxa , the number of reticulations , and the random seed . To construct each phylogentic network, we first simulated phylogenetic tree with taxa using the simulator Ngesh version 1.068 with default parameters. Then, we took the partial order induced by . To construct the network , we added reticulation nodes sequentially, resulting in a sequence of networks . To construct from , we uniformly at random sampled a pair of nodes and in such that , , and . Then, if we added the edge to to obtain and otherwise repeated the process until we found such a pair. Since all directed edges added during this process respected the tree order it is guaranteed that is acyclic, and thus a phylogenetic network with reticulation vertices of in-degree 2. To construct a leaf labeling , we followed the procedure in Fischer et al.31, which uniformly at random assigns leaf labels from to each leaf . In sum, our simulation procedure resulted in a phylogenetic network and a leaf labeling .
As future work, one could construct a leaf labeling using a model of sequence evolution. For example, one could simulate sequence evolution along tree edges using a Jukes-Cantor type model and at network nodes, randomly inherit the sequence from one of the two parents, as described in Nakhleh95.
Evaluating algorithms for the parsimonious migration history problem
To evaluate MACHINA, we first built and linked MACHINA against version 10.0.3 of Gurobi69 following the instructions on the GitHub repository github.com/raphael-group/machina. To run MACHINA, we applied the pmh mode of the software, which exactly solves the parsimonious migration history problem using mixed-integer linear programming. Using the pmh mode of the software, we passed in the cell lineage tree , the leaf labeling , and the root label. To evaluate fastMACHINA, we accessed Gurobi version 10.0.3 through the Python API gurobipy. To run fastMACHINA, we passed in the cell lineage tree and the leaf labeling to the tlp.py script available on the GitHub repository github.com/raphael-group/tree-labeling-polytope.
For both MACHINA and fastMACHINA, we used the Linux command line utility /usr/bin/time to measure the runtime of the software. Both methods were provided with a dedicated 16 core processor, 16 GB of memory, and a 24 hour time limit.
To evaluate the quality of the inferred reconstructions, we compared the inferred migration graph to the ground truth migration graph as follows. Let be the set of edges in the transitive closure of . Then, the number of false positives is defined as the number of ancestral relationships in the inferred migration graph not included in the ground truth migration graph :
Similarly, the number of false negatives is defined as the number of ancestral relationships in the ground truth migration graph not included in the inferred migration graph :
True positives (TP) and true negatives (TN) are defined analogously. The F1 score is defined using the standard formula:
Evaluating formulations for the softwired small parsimony problem
As no existing software was available for the Fischer et al.31,37 formulation of the softwired small parsimony problem, we implemented the Fischer et al. formulation of the problem using Gurobi. Specifically, we directly implemented the formulation as described in Fischer et al. using Gurobi version 10.0.3 accessed through the Python API gurobipy. For a fair comparison, we also implemented the tree labeling polytope formulation of the softwired small parsimony problem using Gurobi version 10.0.3 accessed through the Python API gurobipy.
For both formulations, we used the runtime reported by the Gurobi solver, which excludes the time required to build the models. We used the root relaxation objective emitted by the solver to measure the integrality gap of the formulations.
Evaluating algorithms for convex recoloring of trees
An advantage of viewing the convex recoloring problem from the perspective of small parsimony is that it enables us to apply the polyhedral tools we developed for the multi-cost small parsimony problem. To test our application of multi-cost small parsimony to the convex recoloring problem, we simulated 80 leaf labeled phylogenetic trees and applied the integer linear programming formulation developed for the multi-cost small parsimony problem (STAR Methods, Method Details). For comparison, we implemented and benchmarked against the mixed integer programmming formulation for the convex recoloring problem described in32, which is known to be state-of-the-art. Then, we simulated 80 random instances across 4 different conditions using our tumor evolution and metastasis simulator with errors and migration rate 10−4, containing leaves. For each simulated instance, we measured the strength of the linear programming relaxation, the solver’s runtime, and the minimum number of label changes required to solve the problem.
On all 80/80 simulated instances, the tree labeling polytope based mixed integer linear programming formulation outperformed the state-of-the-art formulation, terminating in under a minute on all instances (Supplementary Figure 5). In contrast, the Campelo formulation32 only terminated on 68/80 of the instances within a 2 hour time limit, and took around 1000 seconds to terminate on instances containing cells. While our formulation had slightly weaker linear relaxations than the Campelo formulation, the relaxation objective was always within a constant multiplicative factor of 3 from the true objective (Supplementary Figure 7). Further, the memory usage of the tree labeling polytope formulation was small (< 1 GB), whereas the Campelo formulation used up to 32 GB of memory on several instances (Supplementary Figure 6).
Supplementary Material
Box 1: Progress and Potential.
Biology is governed by inheritance: parents pass genes to their children, species inherit traits from their ancestors, and cells divide into nearly identical copies of themselves. Often, a feature or quantity of interest, e.g. a person’s eye color or a cell’s shape, is measured in individuals at the present time. However, since ancestral individuals are typically no longer available to measure, e.g. one’s great grandparents may have died, one must instead infer the states of a feature in ancestral individuals.
The task of inferring features in ancestral individuals, or ancestral reconstruction, is quite difficult in general. However, if one has information about the relationships between individuals – often represented in the form of a tree – this task is much simpler. For example, suppose that one wants to infer the eye color for a deceased great-great-grandfather. Using a family tree and the eye colors of all living descendants of the great-great-grandfather, one could derive a reasonable guess of the eye color of the great-great-grandfather. For example, if all living descendants have blue eyes, it is likely that the great-great-grandfather also possessed blue eyes.
Similar to family trees, phylogenetic trees – which describe the evolution of species – or cellular lineage trees – which describe the history of cell divisions – can be used to make inferences about ancestral species and cells. For example, phylogenetic trees can be used to infer the molecular sequences of extinct species, while cellular lineage trees can be used to infer ancestral cell types in developing organisms. The classic algorithms of Fitch-Hartigan or Sankoff infer ancestral states that minimize the number of changes on the tree. However, these algorithms do not extend well to structured ancestral reconstruction problems that arise in several recent applications. For example, cancer researchers are interested in when and where a tumor metastasized to distal anatomical locations and may want to evaluate hypotheses that exclude a cancer cell returning to the primary tumor.
To address these structured problems, we develop a flexible approach to ancestral reconstruction by introducing the tree labeling polytope, a geometric object whose vertices correspond to the ancestral reconstructions of a phylogenetic tree. This framework allows researchers to incorporate additional structure or constraints into ancestral reconstructions. Our approach is applicable to diverse problems such as inferring the routes of metastases in cancer, deriving the transmission history of viruses, and detecting horizontal gene transfer in phylogenetic networks.
Acknowledgements
This research is supported by National Cancer Institute (NCI) grants U24CA248453 and U24CA264027 to B.J.R.
Footnotes
Declaration of Interests
The authors declare no competing interests.
A linear program that solves a combinatorial optimization problem is called a polyhedral description for since the feasible region forms the convex polyhedron where each vertex of corresponds to a solution of .
While this may appear to only model the case of a single phylogenetic character, typically, one assumes phylogenetic characters evolve independently.
A difference between our formulation of the parsimonious migration history problem and the formulation in MACHINA11 is that we only consider migration graphs as opposed to migration multigraphs, which count the number of transitions between anatomical sites. We do this for simplicity of presentation, and our techniques apply to the case of migration multigraphs.
A leaf labeling is convex if there exists an extension of such that for any two labels , all vertices on the (unique) path from to are labeled by .
References
- 1.Fitch WM (1971). Toward defining the course of evolution: minimum change for a specific tree topology. Systematic Biology 20, 406–416. doi: 10.2307/2412116. [DOI] [Google Scholar]
- 2.Hartigan JA (1973). Minimum mutation fits to a given tree. Biometrics, 53–65. doi: 10.2307/2529676. [DOI] [Google Scholar]
- 3.Sankoff D (1975). Minimal mutation trees of sequences. SIAM Fournal on Applied Mathematics 28, 35–42. doi: 10.1137/0128004. [DOI] [Google Scholar]
- 4.Sankoff D & Rousseau P (1975). Locating the vertices of a Steiner tree in an arbitrary metric space. Mathematical Programming 9, 240–246. doi: 10.1007/bf01681346. [DOI] [Google Scholar]
- 5.Csűrös M in Comparative Genomics 72–86 (Springer, Berlin, Heidelberg, 2008). doi: 10.1007/978-3-540-87989-3_6. [DOI] [Google Scholar]
- 6.Zhang J & Nei M (1997). Accuracies of ancestral amino acid sequences inferred by the parsimony, likelihood, and distance methods. Journal of molecular evolution 44, S139–S146. doi: 10.1007/pl00000067. [DOI] [PubMed] [Google Scholar]
- 7.Thornton JW (2004). Resurrecting ancient genes: experimental analysis of extinct molecules. Nature Reviews Genetics 5, 366–375. doi: 10.1038/nrg1324. [DOI] [PubMed] [Google Scholar]
- 8.Randall RN, Radford CE, Roof KA, Natarajan DK & Gaucher EA (2016). An experimental phylogeny to benchmark ancestral sequence reconstruction. Nature communications 7, 12847. doi: 10.1038/ncomms12847. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 9.Dang H et al. (2017). ClonEvol: clonal ordering and visualization in cancer sequencing. Annals of oncology 28, 3076–3082. doi: 10.1093/annonc/mdx517. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 10.Reiter JG et al. (2017). Reconstructing metastatic seeding patterns of human cancers. Nature communications 8, 14114. doi: 10.1038/ncomms14114. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 11.El-Kebir M, Satas G & Raphael BJ (2018). Inferring parsimonious migration histories for metastatic cancers. Nature genetics 50, 718–726. doi: 10.1038/s41588-018-0106-z. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 12.Chroni A, Vu T, Miura S & Kumar S (2019). Delineation of tumor migration paths by using a bayesian biogeographic approach. Cancers 11, 1880. doi: 10.3390/cancers11121880. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 13.Birkbak NJ & McGranahan N (2020). Cancer genome evolutionary trajectories in metastasis. Cancer cell 37, 8–19. doi: 10.1016/j.ccell.2019.12.004. [DOI] [PubMed] [Google Scholar]
- 14.Koyyalagunta D, Ganesh K & Morris Q (2024). Inferring cancer type-specific patterns of metastatic spread. bioRxiv, 2024–07. doi: 10.1101/2024.07.09.602790. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 15.Quinn JJ et al. (Feb. 26, 2021). Single-cell lineages reveal the rates, routes, and drivers of metastasis in cancer xenografts. Science 371, eabc1944. doi: 10.1126/science.abc1944. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 16.Hall M, Woolhouse M & Rambaut A (Dec. 2015). Epidemic Reconstruction in a Phylogenetics Framework: Transmission Trees as Partitions of the Node Set. PLOS Computational Biology 11, e1004613. doi: 10.1371/journal.pcbi.1004613. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 17.Moshiri N, Ragonnet-Cronin M, Wertheim JO & Mirarab S (June 2019). FAVITES: simultaneous simulation of transmission networks, phylogenetic trees and sequences. Bioinformatics 35, 1852–1861. doi: 10.1093/bioinformatics/bty921. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 18.Romero-Severson EO, Bulla I & Leitner T (Mar. 2016). Phylogenetically resolving epidemiologic linkage. Proceedings of the National Academy of Sciences 113, 2690–2695. doi: 10.1073/pnas.1522930113. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 19.Wymant C et al. (Mar. 2018). PHYLOSCANNER: Inferring Transmission from Within- and Between-Host Pathogen Genetic Diversity. Molecular Biology and Evolution 35, 719–733. doi: 10.1093/molbev/msx304. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 20.Hall MD & Colijn C (June 2019). Transmission Trees on a Known Pathogen Phylogeny: Enumeration and Sampling. Molecular Biology and Evolution 36, 1333–1343. doi: 10.1093/molbev/msz058. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 21.Skums P et al. (Jan. 2018). QUENTIN: reconstruction of disease transmissions from viral quasispecies genomic data. Bioinformatics 34, 163–170. doi: 10.1093/bioinformatics/btx402. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 22.Sashittal P & El-Kebir M (2019). SharpTNI: Counting and Sampling Parsimonious Transmission Networks under a Weak Bottleneck. bioRxiv. doi: 10.1101/842237. [DOI] [Google Scholar]
- 23.Sashittal P & El-Kebir M (2020). Sampling and summarizing transmission trees with multi-strain infections. Bioinformatics 36, i362–i370. doi: 10.1093/bioinformatics/btaa438. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 24.Dhar S, Zhang C, Măndoiu II & Bansal MS (July 2021). TNet: Transmission Network Inference Using Within-Host Strain Diversity and its Application to Geographical Tracking of COVID-19 Spread. IEEE/ACM Transactions on Computational Biology and Bioinformatics 19, 230–242. doi: 10.1109/TCBB.2021.3096455. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 25.Skums P et al. (2022). SOPHIE: Viral outbreak investigation and transmission history reconstruction in a joint phylogenetic and network theory framework. Cell systems 13, 844–856. doi: 10.1016/j.cels.2022.07.005. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 26.Sashittal P et al. (2024). Inferring cell differentiation maps from lineage tracing data. bioRxiv. doi: 10.1101/2024.09.09.611835. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 27.Hein J (1990). Reconstructing evolution of sequences subject to recombination using parsimony. Mathematical biosciences 98, 185–200. doi: 10.1016/0025-5564(90)90123-g. [DOI] [PubMed] [Google Scholar]
- 28.Nakhleh L, Jin G, Zhao F & Mellor-Crummey J Reconstructing phylogenetic networks using maximum parsimony in 2005 IEEE Computational Systems Bioinformatics Conference (CSB’05) (2005), 93–102. doi: 10.1109/csb.2005.47. [DOI] [PubMed] [Google Scholar]
- 29.Kammer F & Tholey T (2012). The complexity of minimum convex coloring. Discrete Applied Mathematics 160, 810–833. doi: 10.1016/j.dam.2011.09.022. [DOI] [Google Scholar]
- 30.Scornavacca C & Weller M (2022). Treewidth-based algorithms for the small parsimony problem on networks. Algorithms for Molecular Biology 17, 15. doi: 10.1186/s13015-022-00216-w. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 31.Fischer M, Van Iersel L, Kelk S & Scornavacca C (2015). On computing the maximum parsimony score of a phylogenetic network. SIAM Fournal on Discrete Mathematics 29, 559–585. doi: 10.1137/140959948. [DOI] [Google Scholar]
- 32.Campêlo M, Freire AS, Lima KR, Moura PF & Wakabayashi Y (2016). The convex recoloring problem: polyhedra, facets and computational experiments. Mathematical Programming 156, 303–330. doi: 10.1007/s10107-015-0880-7. [DOI] [Google Scholar]
- 33.Campêlo M, Freire AS, Moura PF & Soares JC (2022). Strong inequalities and a branch-and-price algorithm for the convex recoloring problem. European fournal of Operational Research 303, 54–65. doi: 10.1016/j.ejor.2022.02.013. [DOI] [Google Scholar]
- 34.Roddur MS, Snir S & El-Kebir M (2024). Enforcing Temporal Consistency in Migration History Inference. Journal of Computational Biology 31, 396–415. doi: 10.1089/cmb.2023.0352. [DOI] [PubMed] [Google Scholar]
- 35.El-Kebir M Parsimonious Migration History Problem: Complexity and Algorithms in 18th International Workshop on Algorithms in Bioinformatics (WABI 2018) 113 (2018), 24:1–24:14. doi: 10.4230/LIPIcs.WABI.2018.24. [DOI] [Google Scholar]
- 36.Van Iersel L, Jones M & Scornavacca C (2018). Improved maximum parsimony models for phylogenetic networks. Systematic biology 67, 518–542. doi: 10.1093/sysbio/syx094. [DOI] [PubMed] [Google Scholar]
- 37.Frohn M & Kelk S (2025). A 2-approximation algorithm for the softwired parsimony problem on binary, tree-child phylogenetic networks. Annals of Operations Research 345, 125–145. doi: 10.1007/s10479-024-06452-0. [DOI] [Google Scholar]
- 38.Edmonds J (1971). Matroids and the greedy algorithm. Mathematical programming 1, 127–136. doi: 10.1007/bf01584082. [DOI] [Google Scholar]
- 39.Goemans MX Minimum bounded degree spanning trees in 2006 47th Annual IEEE Symposium on Foundations of Computer Science (FOCS’06) (2006), 273–282. doi: 10.1109/focs.2006.48. [DOI] [Google Scholar]
- 40.Singh M & Lau LC (2015). Approximating minimum bounded degree spanning trees to within one of optimal. Fournal of the ACM (FACM) 62, 1–19. doi: 10.1145/2629366. [DOI] [Google Scholar]
- 41.Zenklusen R Matroidal degree-bounded minimum spanning trees in Proceedings of the Twenty-Third Annual ACM-SIAM Symposium on Discrete Algorithms (2012), 1512–1521. doi: 10.1137/1.9781611973099.120. [DOI] [Google Scholar]
- 42.Volgenant A (1989). A Lagrangean approach to the degree-constrained minimum spanning tree problem. European Journal of Operational Research 39, 325–331. doi: 10.1016/0377-2217(89)90169-0. [DOI] [Google Scholar]
- 43.Bicalho LH, Da Cunha AS & Lucena A (2016). Branch-and-cut-and-price algorithms for the degree constrained minimum spanning tree problem. Computational Optimization and Applications 63, 755–792. doi: 10.1007/s10589-015-9788-7. [DOI] [Google Scholar]
- 44.Fisher ML (1981). The Lagrangian relaxation method for solving integer programming problems. Management science 27, 1–18. doi: 10.1287/mnsc.27.1.1. [DOI] [Google Scholar]
- 45.Wolsey LA Integer programming doi: 10.1002/9781119606475 (John Wiley & Sons, 2020). [DOI] [Google Scholar]
- 46.Ravi R & Goemans MX The constrained minimum spanning tree problem in Algorithm Theory—SWAT’96: 5th Scandinavian Workshop on Algorithm Theory Reykjavik, Iceland, July 3–5, 1996 Proceedings 5 (1996), 66–75. doi: 10.1007/3-540-61422-2_121. [DOI] [Google Scholar]
- 47.Könemann J & Ravi R A matter of degree: Improved approximation algorithms for degree-bounded minimum spanning trees in Proceedings of the thirty-second annual ACM symposium on Theory of computing (2000), 537–546. doi: 10.1145/335305.335371. [DOI] [Google Scholar]
- 48.Festa P Constrained shortest path problems: state-of-the-art and recent advances in 2015 17th International Conference on Transparent Optical Networks (ICTON) (2015), 1–17. doi: 10.1109/icton.2015.7193456. [DOI] [Google Scholar]
- 49.Pugliese LDP, Guerriero F & Poss M (2019). The resource constrained shortest path problem with uncertain data: a robust formulation and optimal solution approach. Computers & Operations Research 107, 140–155. doi: 10.1016/j.cor.2019.03.010. [DOI] [Google Scholar]
- 50.Plotkin SA, Shmoys DB & Tardos É (1995). Fast approximation algorithms for fractional packing and covering problems. Mathematics of Operations Research 20, 257–301. doi: 10.1287/moor.20.2.257. [DOI] [Google Scholar]
- 51.Leighton T & Rao S (1999). Multicommodity max-flow min-cut theorems and their use in designing approximation algorithms. Journal of the ACM (fACM) 46, 787–832. doi: 10.1145/331524.331526. [DOI] [Google Scholar]
- 52.Fleischer LK (2000). Approximating fractional multicommodity flow independent of the number of commodities. SIAM Journal on Discrete Mathematics 13, 505–520. doi: 10.1137/S0895480199355754. [DOI] [Google Scholar]
- 53.Erdös PL & Székely L (1992). Evolutionary trees: an integer multicommodity max-flow-min-cut theorem. Advances in Applied Mathematics 13, 375–389. doi: 10.1016/0196-8858(92)90017-q. [DOI] [Google Scholar]
- 54.Erdős PL & Szekely LA (1994). On weighted multiway cuts in trees. Mathematical programming 65, 93–105. doi: 10.1007/bf01581691. [DOI] [Google Scholar]
- 55.Erdős PL, Frank A & Székely L (1998). Minimum multiway cuts in trees. Discrete applied mathematics 87, 67–75. doi: 10.1016/s0166-218x(98)00049-3. [DOI] [Google Scholar]
- 56.Moran S & Snir S Efficient approximation of convex recolorings in International Workshop on Approximation Algorithms for Combinatorial Optimization (2005), 192–208. doi: 10.1007/11538462_17. [DOI] [Google Scholar]
- 57.Yang D et al. (2022). Lineage tracing reveals the phylodynamics, plasticity, and paths of tumor evolution. Cell 185, 1905–1923. doi: 10.1016/j.cell.2022.04.015. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 58.Parsons BL (2018). Multiclonal tumor origin: Evidence and implications. Mutation research/reviews in mutation research 777, 1–18. doi: 10.1016/j.mrrev.2018.05.001. [DOI] [PubMed] [Google Scholar]
- 59.Jones NC & Pevzner PA An introduction to bioinformatics algorithms (MIT press, 2004). [Google Scholar]
- 60.Pupko T, Pe I, Shamir R & Graur D (2000). A fast algorithm for joint reconstruction of ancestral amino acid sequences. Molecular biology and evolution 17, 890–896. doi: 10.1093/oxfordjournals.molbev.a026369. [DOI] [PubMed] [Google Scholar]
- 61.Yang Z Computational molecular evolution doi: 10.1093/acprof:oso/9780198567028.001.0001 (OUP Oxford, 2006). [DOI] [Google Scholar]
- 62.Gusfield D ReCombinatorics: the algorithmics of ancestral recombination graphs and explicit phylogenetic networks doi: 10.7551/mitpress/9432.001.0001 (MIT press, 2014). [DOI] [Google Scholar]
- 63.Kannan L & Wheeler WC (2012). Maximum parsimony on phylogenetic networks. Algorithms for molecular biology 7, 1–10. doi: 10.1186/1748-7188-7-9. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 64.Aggarwal V, Aneja YP & Nair K (1982). Minimal spanning tree subject to a side constraint. Computers & Operations Research 9, 287–296. doi: 10.1016/0305-0548(82)90026-0. [DOI] [Google Scholar]
- 65.Achterberg T & Wunderling R in Facets of combinatorial optimization: Festschrift for Martin Grötschel 449–481 (Springer, 2013). doi: 10.1007/978-3-642-38189-8_18. [DOI] [Google Scholar]
- 66.Dantzig G, Fulkerson R & Johnson S (1954). Solution of a large-scale traveling-salesman problem. Journal of the operations research society of America 2, 393–410. doi: 10.1287/opre.2.4.393. [DOI] [Google Scholar]
- 67.Markowitz HM & Manne AS (1957). On the solution of discrete programming problems. Econometrica: journal of the Econometric Society, 84–110. doi: 10.2307/1907744. [DOI] [Google Scholar]
- 68.Tresoldi T (2021). Ngesh: a Python library for synthetic phylogenetic data. Fournal of Open Source Software 6, 3173. doi: 10.21105/joss.03173. [DOI] [Google Scholar]
- 69.Gurobi Optimization LLC. Gurobi Optimizer Reference Manual 2023.
- 70.Quinn JJ et al. (2021). Single-cell lineages reveal the rates, routes, and drivers of metastasis in cancer xenografts. Science 371, eabc1944. doi: 10.1126/science.abc1944. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 71.Chan MM et al. (2019). Molecular recording of mammalian embryogenesis. Nature 570, 77–82. doi: 10.1038/s41586-019-1184-5. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 72.Simeonov KP et al. (2021). Single-cell lineage tracing of metastatic cancer reveals selection of hybrid EMT states. Cancer cell 39, 1150–1162. doi: 10.1016/j.ccell.2021.05.005. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 73.Sashittal P, Schmidt H, Chan M & Raphael BJ (2023). Startle: a star homoplasy approach for crispr-cas9 lineage tracing. Cell Systems 14, 1113–1121. doi: 10.1016/j.cels.2023.11.005. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 74.Mai U, Chu G & Raphael BJ Maximum Likelihood Inference of Time-scaled Cell Lineage Trees with Mixed-type Missing Data in International Conference on Research in Computational Molecular Biology (2024), 360–363. doi: 10.1007/978-1-0716-3989-4_31. [DOI] [Google Scholar]
- 75.Ji R-C (2016). Lymph nodes and cancer metastasis: new perspectives on the role of intranodal lymphatic sinuses. International journal of molecular sciences 18, 51. doi: 10.3390/ijms18010051. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 76.Ji H et al. (2023). Lymph node metastasis in cancer progression: molecular mechanisms, clinical significance and therapeutic interventions. Signal Transduction and Targeted Therapy 8, 367. doi: 10.1038/s41392-023-01576-4. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 77.Moran S & Snir S (2008). Convex recolorings of strings and trees: Definitions, hardness results and algorithms. Fournal of Computer and System Sciences 74, 850–869. doi: 10.1016/j.jcss.2007.10.003. [DOI] [Google Scholar]
- 78.Felsenstein J (1973). Maximum-likelihood estimation of evolutionary trees from continuous characters. American journal of human genetics 25, 471. [PMC free article] [PubMed] [Google Scholar]
- 79.Jin G, Nakhleh L, Snir S & Tuller T (2007). Efficient parsimony-based methods for phylogenetic network reconstruction. Bioinformatics 23, e123–e128. doi: 10.1093/bioinformatics/bt1313. [DOI] [PubMed] [Google Scholar]
- 80.Wheeler WC & Washburn AJ (2023). Parsimony optimization of phylogenetic networks. Cladistics 39, 456–474. doi: 10.1111/cla.12552. [DOI] [PubMed] [Google Scholar]
- 81.Schrijver A Theory of linear and integer programming doi: 10.1137/1030065 (John Wiley & Sons, 1998). [DOI] [Google Scholar]
- 82.Edmonds J & Giles R in Progress in combinatorial optimization 117–129 (Elsevier, 1984). doi: 10.1016/b978-0-12-566780-7.50013-1. [DOI] [Google Scholar]
- 83.Conforti M, Cornuéjols G & Zambelli G (2010). Extended formulations in combinatorial optimization. 4OR 8, 1–48. doi: 10.1007/s10288-010-0122-z. [DOI] [Google Scholar]
- 84.Cook W (1983). Operations that preserve total dual integrality. Operations Research Letters 2, 31–35. doi: 10.1016/0167-6377(83)90062-7. [DOI] [Google Scholar]
- 85.Grötschel M, Jünger M & Reinelt G (1985). On the acyclic subgraph polytope. Mathematical Programming 33, 28–42. doi: 10.1007/bf01582009. [DOI] [Google Scholar]
- 86.Kanj IA & Kratsch D Convex recoloring revisited: Complexity and exact algorithms in Computing and Combinatorics: 15th Annual International Conference, COCOON 2009 Niagara Falls, NY, USA, July 13–15, 2009 Proceedings 15 (2009), 388–397. doi: 10.1007/978-3-642-02882-3_39. [DOI] [Google Scholar]
- 87.Bar-Yehuda R, Feldman I & Rawitz D (2008). Improved approximation algorithm for convex recoloring of trees. Theory of Computing Systems 43, 3–18. doi: 10.1007/s00224-007-9069-7. [DOI] [Google Scholar]
- 88.Bar-Yehuda R, Kutiel G & Rawitz D 5-Approximation Algorithm for the 2-Convex Recoloring Problem in International Workshop on Combinatorial Algorithms (2015), 299–311. doi: 10.1007/978-3-319-29516-9_25. [DOI] [Google Scholar]
- 89.Lima KR & Wakabayashi Y (2011). Convex recoloring of paths. Electronic Notes in Discrete Mathematics 37, 165–170. doi: 10.1016/j.endm.2011.05.029. [DOI] [Google Scholar]
- 90.Chopra S, Erdem E, Kim E & Shim S Column generation approach to the convex recoloring problem on a tree in Modeling and Optimization: Theory and Applications: MOPTA, Bethlehem, PA, USA, August 2016 Selected Contributions 16 (2017), 39–53. doi: 10.1007/978-3-319-66616-7_3. [DOI] [Google Scholar]
- 91.Chopra S et al. (2017). An extended formulation of the convex recoloring problem on a tree. Mathematical Programming 165, 529–548. doi: 10.1007/s10107-016-1094-3. [DOI] [Google Scholar]
- 92.Dantas APS, de Souza CC & Dias Z (2022). A heuristic for the convex recoloring problem in graphs. International Transactions in Operational Research 29, 1454–1478. doi: 10.1111/itor.12896. [DOI] [Google Scholar]
- 93.Balinski M & Russakoff A (1974). On the assignment polytope. Siam Review 16, 516–525. doi: 10.1137/1016083. [DOI] [Google Scholar]
- 94.Reiter JG, Bozic I, Chatterjee K & Nowak MA TTP: tool for tumor progression in Computer Aided Verification: 25th International Conference, CAV 2013, Saint Petersburg, Russia, July 13–19, 2013. Proceedings 25 (2013), 101–106. doi: 10.1007/978-3-642-39799-8_6. [DOI] [Google Scholar]
- 95.Nakhleh L in Problem solving handbook in computational biology and bioinformatics 125–158 (Springer, 2010). doi: 10.1007/978-0-387-09760-2_7. [DOI] [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Supplementary Materials
Data Availability Statement
This paper analyzes existing, publicly available data. These accession numbers for the datasets are listed in the key resources table.
All original code has been deposited at github.com/raphael-group/tree-labeling-polytope and archived on Zenodo (doi: 10.5281/zenodo.18701953)
Any additional information required to reanalyze the data reported in this paper is available from the lead contact upon request.
KEY RESOURCES TABLE
| REAGENT or RESOURCE | SOURCE | IDENTIFIER |
|---|---|---|
| Deposited data | ||
| Mouse metastasis in cancer xenografts | Quinn et al.70 | doi: 10.5281/zenodo.4243161 |
| Software and algorithms | ||
| Tree labeling polytope | This work | github.com/raphael-group/tree-labeling-polytope |
| Tree labeling polytope software repository | This work | doi: 10.5281/zenodo.18701953 |
