Deleting Outliers to Reach Fully Labeled Trees

Many datasets describe things that should form a tree in which every observed item is itself a node. Cancer clones in single-cell sequencing, cells in lineage tracing, and versions in a document history all work this way: sampled ancestors sit inside the tree, and there are no hidden branch points. Hayamizu, Endo and Fukumizu showed that a distance matrix has this shape exactly when two local tests pass (A characterization of minimum spanning tree-like metric spaces). The first is the classical four-point condition on every set of four items. The second is their fourth-point condition, which requires every three items to have an observed "median" item lying on all three paths between them. Real data never passes both tests exactly, because a few corrupted measurements break them. This note proposes the matching repair problem. Delete as few items as possible so that the rest passes both tests, then read off the tree, which is the minimum spanning tree of what remains.

The central observation is that this target property is not hereditary. Deleting an ancestor can create a new violation, since the ancestor may have been the median of three other items. The standard forbidden-subgraph argument therefore looks inapplicable at first, because it needs "every subset of a good set is good." We argue that a weaker invariant still holds and is enough for exact search with a bounded number of branches. On top of that we build an exact solver, a tolerance version for noisy distances, and data-reduction rules in the style that made cluster-editing solvers practical. We then test the claim on simulated and real mutation trees against minimum-spanning-tree pruning and integer programming.

Core Claim

Write $d$ for the distance matrix on items $X$ and $Y \subseteq X$ for the items that survive so far. The fourth-point condition on $Y$ asks that for every triple $x,y,z \in Y$ there is some $m \in Y$ with

$$d(m,x)+d(m,y)+d(m,z) \;=\; \tfrac12\big(d(x,y)+d(y,z)+d(z,x)\big),$$

so that $m$ sits at the junction of the three paths. Call a triple with no such $m$ in $Y$ a missing-median triple. Call a quadruple whose two largest pairwise sums $d(x,y)+d(z,w)$, $d(x,z)+d(y,w)$, $d(x,w)+d(y,z)$ are unequal a four-point violation.

Let $S^*$ be any valid deletion set, so $X \setminus S^* \subseteq Y$ at every stage of the search. Suppose a triple has no median in the current $Y$. It then has none in the smaller surviving set either, so $S^*$ must contain one of its three items. Four-point violations are inherited by supersets, so $S^*$ must also contain one of the four items of any violating quadruple. Both conditions are therefore enforced by obstructions of size at most four, even though removing a point can create new missing-median triples. The search proceeds by finding any obstruction in the current $Y$, branching on which of its at most four points to delete, and recursing with budget $k-1$. This takes $4^k \cdot \mathrm{poly}(n)$ time.

When all distances are distinct, Hayamizu and Fukumizu's Theorem 3.1 says the fourth-point condition alone suffices (On minimum spanning tree-like metric spaces). In that case only triples matter and the bound drops to $3^k$. The same argument goes through unchanged if both equalities are relaxed to hold within a tolerance $\varepsilon$. This is the form we need for noisy data.

What is new here is a statement of the editing problem, the observation that a non-hereditary tree property still admits obstruction branching, and a practical solver evaluated on lineage data. The research file reports no prior work on modification problems toward these metric spaces. Hayamizu et al. list this as an open direction (see their verification cost of $O(n^4)$ and their open questions on noise and ties).

Relation to Prior Work

The work that motivates this proposal is the Hayamizu–Fukumizu characterization pair. It gives the exact tests, the equivalence with minimum spanning trees under distinct distances, and Corollary 5.2, which says a graph is a tree exactly when its distance metric is both a block graph and a median graph. Those papers verify the conditions; they do not repair violations. We supply the repair.

The closest bridge between the two directions is k-Leaf Powers Cannot be Characterized by a Finite Set of Forbidden Induced Subgraphs for k ≥ 5. It uses the four-point condition as a proof tool to build an infinite family of minimal obstructions, which is a negative result for graph modification. We read it as a constraint that also suggests a lens. Leaf powers keep only the thresholded adjacency $d_T(u,v)\le k$, and the obstructions become infinite once that information is discarded. When the full distances are available, as they are in our setting, the obstructions have at most four points. We do not claim anything about leaf powers themselves. The contrast just explains why our problem stays tractable.

The method comes from the forbidden-subgraph toolkit. That includes obstruction branching as in A Fast Branching Algorithm for Cluster Vertex Deletion, which beats naive branching by analyzing the local structure of obstructions. It also includes modulator-plus-reduction kernels as in A Polynomial Kernel for 3-Leaf Power Deletion and A Polynomial Kernel for Deletion to the Scattered Class of Cliques and Trees. Both of those rely on hereditary targets, and our median constraint breaks that assumption. A median $m$ of a surviving triple behaves like an implication: "if $x,y,z$ survive then $m$ survives." This is not a set to hit. Adapting their sunflower and expansion arguments to such implications is the theoretical core of the project. The practical lesson from PACE 2021: Cluster Editing and KaPoCE is that winning exact solvers rely on reduction rules rather than raw integer programming. That lesson shapes our engineering.

Research Program

The theory strand has three goals. First, prove the branching invariant formally, including uniqueness of the median under the four-point condition and the tolerance version. Second, improve the $4^k$ bound by studying how obstructions overlap, in the spirit of the $1.9102^k$ analysis for cluster vertex deletion. Third, settle whether a polynomial kernel exists. If only four-point violations are present, the problem is 4-Hitting Set and has a polynomial kernel by a sunflower argument. The open question is whether the median implications, which can cascade (delete $m$, which forces deleting one of $x,y,z$, which may be the median of another triple), keep a polynomial kernel or break it. Through Corollary 5.2 we also specialize to unweighted graph metrics, where the obstructions become small block-graph and median-graph violations. There we work out how the tie-heavy regime, outside Theorem 3.1, changes the branching.

The tolerance strand addresses a real gap. A set passing both tests within $\varepsilon$ need not be close to a tree metric. We will measure, and try to bound, how far the minimum spanning tree's path distances can drift from $d$ as a function of $\varepsilon$ and tree depth. The working hypothesis is that error accumulates additively along paths, so distortion grows at most linearly with depth. The engineering strand builds the solver. It finds obstructions incrementally, keeping for each triple its candidate medians so that a deletion triggers rechecks only of the triples that used the deleted point. It adds reduction rules: a point in no obstruction and the median of no live triple can be committed as kept. It caps per-instance time following the PACE track conventions.

Baselines

The do-nothing reference builds the minimum spanning tree on all items and reports its path-distance distortion and its tree distance to ground truth. Hayamizu et al. stress that a spanning tree is always produced but carries no guarantee of matching $d$, so this baseline measures how much repair matters at all.

The strongest practical competitor is greedy spanning-tree pruning. It repeatedly removes the item whose spanning-tree distances deviate most from $d$ and recomputes, until distortion falls below the same $\varepsilon$ or $k$ items are gone. It is cheap, intuitive, and exactly what a practitioner would try first.

The strongest exact competitor is a 0-1 integer program. It has keep variables per item, a covering constraint per four-point violation, and an implication constraint per triple and median. It is solved by a commercial solver under the same wall-clock limit and the same tolerance. No reported result found on Lacuna for any method on this deletion problem. The closest reported numbers concern a general solver against specialized local repair on the related triangle-inequality problem. There, triangle fixing was "up to 30x" faster than CPLEX under $\ell_2$, on matrices of 25×25 up to 225×225 (The Metric Nearness Problem). In PACE 2021 the top exact cluster-editing solver solved 171 of 200 instances within 30 minutes. We use those figures only as context, not as targets.

Two ablations isolate the key ingredient. The first enforces only the four-point condition, which amounts to fitting a tree with hidden branch points; this tests whether the ancestor condition actually changes which items are flagged. The second precomputes missing-median triples once on the full $X$ and hits them, ignoring cascades; this tests whether the non-hereditary bookkeeping matters. All methods see identical matrices, tolerance, budget and time cap. Each $\varepsilon$ is chosen once on held-out simulated trees, and no method gets per-instance tuning.

We count the proposal as winning if it meets the following bars. Against greedy pruning, it should recover planted outliers with higher precision at matched deletion count, and give a smaller Bourque distance to the true tree. Against integer programming, it should solve more instances to optimality within the cap, or reach the same optimum faster on instances with $n \ge 100$.

Why not just…?

Why not just compute the minimum spanning tree and drop the worst-fitting points? This is the real threat. On trees with a few gross outliers it may match our solver. Its weakness is predictable: removing an internal ancestor that happens to fit poorly orphans its descendants' junction, and greedy pruning cannot see that a single noisy leaf is causing many violations. The planted-outlier experiments, in which outliers are placed at internal versus leaf positions, are designed to show where greedy pruning fails. If greedy pruning ties our method across the board, we will report that and recast the contribution as the certificate the exact method provides.

Why not just solve it as an integer program? For small $n$ this may well win. The number of constraints is cubic in $n$ for triples and quartic for quadruples, and the file reports that general solvers lose badly to local repair once the constraint set reaches that size (The Metric Nearness Problem). The scaling sweep below locates the crossover point rather than assuming one.

Why not just repair the distances continuously, as in metric nearness, instead of deleting points? Continuous repair suits small spread-out noise, while deletion suits a few corrupted items such as doublet cells. Spreading a gross error across all entries distorts the tree everywhere. We test this directly by running both noise regimes. We also compare a tolerance-only variant (deletion budget zero) against deletion, to show that each wins in its own regime.

Why not just fit a tree with hidden branch points and ignore the fourth-point condition? That answers a different question: it hides ancestors inside unlabeled nodes. The first ablation measures how often this misplaces sampled ancestors.

Proposed Experiments

The synthetic study generates random fully labeled weighted trees with 25 to 225 items, matching the size range used in the metric nearness experiments. It adds Gaussian noise to the distances and plants $k$ outliers by scrambling their rows. It compares the cases with distinct distances and with integer weights to probe Theorem 3.1's tie-breaking assumption. The metrics are outlier precision and recall, the path-distance distortion of the recovered tree, runtime, and the fraction of instances solved exactly within 30 minutes.

The biological study uses the four simulated OncoLib mutation trees and the three leukemia single-cell mutation trees described in The Bourque distances for mutation trees of cancers. We derive distance matrices from the tree paths, inject doublet-like and dropout-like corrupted items, and score recovered trees with the Bourque distance. The Bourque distance is the right score because it compares trees whose label sets differ, as ours will after deletion, and it runs in linear time. That paper reports Pearson correlations of 0.38 to 0.543 between the Bourque distance and three other tree distances (AD, DISC and TD) on simulated trees. To check robustness, we also report the subset of those distances that is defined when label sets differ, and we flag disagreement among them.

Three checks are decisive. First, the cascade-aware solver must never return a set that fails verification, while the no-cascade ablation should fail on instances where an outlier sits at an internal position; this confirms the invariant matters in practice. Second, when internal outliers are planted, the exact method should beat greedy pruning on Bourque distance; if it does not, the method's practical case collapses. Third, on unweighted graph metrics our solver should agree with brute-force checks of the block-graph and median-graph conditions from Corollary 5.2. That agreement would tie the metric obstructions back to forbidden induced subgraphs.