---
title: Ordered Leaf Attachment in Phylogenetics
url: https://www.emergentmind.com/topics/ordered-leaf-attachment
type: topic
---

# Ordered Leaf Attachment in Phylogenetics

Searching arXiv for the cited Ordered Leaf Attachment papers to ground the article in current sources.
Ordered leaf attachment (OLA) is an order-dependent vector encoding of rooted phylogenetic trees in which a fixed ordering of the leaves determines a stepwise tree-growth or tree-deconstruction process, and each step records where the next leaf is attached. In the recent phylogenetics literature, OLA is studied primarily for rooted binary phylogenetic trees, where it provides a bijective integer-vector representation with linear-time encoding and decoding, and induces a Hamming-distance-based dissimilarity on tree space [2503.10169]. Subsequent work analyzes how strongly this induced dissimilarity depends on the chosen leaf ordering and relates it to rooted subtree prune and regraft distance, the hybrid number, the temporal tree-child hybrid number, and maximum acyclic agreement forests; it also extends the framework to reticulation detection and multifurcated trees [2507.11254], [2509.16405].

## 1. Definition and basic construction

OLA represents a rooted binary phylogenetic tree relative to a fixed linear order on its leaves. In one formulation, the leaves are labeled \(0,1,\dots,n-1\), and the tree is imagined as being constructed by adding leaves one by one in that order; the recorded datum at each step is the label of the node that was the sister of the newly inserted leaf [2503.10169]. In another formulation, one fixes a bijection \(\sigma:X\to\{1,\dots,n\}\) or equivalently an ordering \((l_0,l_1,\dots,l_{n-1})\), and processes leaves in increasing order of rank under \(\sigma\) [2507.11254], [2509.16405]. These are equivalent ordered-growth viewpoints with different indexing conventions.

A central technical feature is the use of persistent internal-node labels. In the formulation of "Vector encoding of phylogenetic trees by ordered leaf attachment" [2503.10169], OLA assigns canonical negative labels to internal nodes, \(-1,-2,\dots,-n+1\), through a two-pass labeling scheme based on clade-founder and clade-splitter values. In "Order-Dependent Dissimilarity Measures on Phylogenetic Trees" [2507.11254], the OLA labeling is a map
\[
f_{\mathrm{OLA}}:(V(T)-\{\rho\})\to \{1,2,\dots,n\}\cup\{-2,-3,\dots,-n\},
\]
with leaves labeled by their ranks under \(\sigma\) and each newly created internal vertex \(u_i\) labeled \(-i\). The common principle is that once an internal vertex receives its negative label, that label is not updated as later leaves are attached.

The encoding can be described either constructively or destructively. Constructively, one starts from the first one or two leaves and repeatedly adjoins the next leaf by subdividing an edge, creating a new internal node, and recording the sibling label of the new leaf [2507.11254], [2509.16405]. Destructively, one assigns canonical internal labels, deletes leaves in reverse order, records each deleted leaf’s sister label, and reconnects the remaining subtree [2503.10169]. These procedures are inverse to corresponding decoding procedures, yielding a bijection between trees and valid integer vectors [2503.10169].

## 2. Vector form, valid coordinates, and bijectivity

The OLA vector length depends on convention. In [2503.10169] and [2509.16405], an \(n\)-leaf tree is encoded by a vector of length \(n-1\), because there is one recorded placement for each leaf except the first. In [2507.11254], the vector is presented in length-\(n\) form with fixed initial coordinates:
\[
\mathbf{v}=[0,1,f_{\mathrm{OLA}}(s_3),f_{\mathrm{OLA}}(s_4),\dots,f_{\mathrm{OLA}}(s_n)].
\]
The difference is not substantive; it reflects indexing and initialization conventions.

A notable property of OLA is that the set of valid vectors has a simple explicit description. In [2503.10169], the valid codes are exactly
\[
C_{n-1}=\{(a_1,a_2,\ldots,a_{n-1}) : -i<a_i<i\},
\]
so each coordinate satisfies \(a_i\in\{-i+1,\dots,-1,0,1,\dots,i-1\}\). In [2509.16405], the coordinate bounds are written as
\[
-(i-1)\le OLA(T,\sigma)_i\le i-1,\qquad i=1,\dots,n-1,
\]
and the corresponding vector set is
\[
\mathcal{C}_{n-1}:=\{(a_1,\dots,a_{n-1})\in \mathbb{Z}^{n-1}\mid -(i-1)\le a_i\le i-1\}.
\]
These formulations are compatible after adjusting for whether indexing starts at \(1\) or \(0\) and how the first fixed coordinate is handled.

The bijective character of OLA is emphasized in both foundational and later work. "Vector encoding of phylogenetic trees by ordered leaf attachment" proves that the tree-to-vector map \(\Phi\) and the vector-to-tree map \(\Psi\) are inverse bijections [2503.10169]. "Ordered Leaf Attachment (OLA) Vectors can Identify Reticulation Events even in Multifurcated Trees" states that every integer vector in \(\mathcal{C}_{n-1}\) corresponds to a unique rooted binary phylogenetic tree [2509.16405]. This explicit characterization distinguishes OLA from other encodings whose valid-vector sets are more intricate.

## 3. Algorithms and computational complexity

OLA was introduced in part to provide a representation that is both structurally simple and computationally efficient. The 2025 encoding paper states that both encoding and decoding are \(O(n)\) in the number of leaves [2503.10169]. The linear-time bound is achieved because canonical internal labeling uses two traversals, and the subsequent encoding or decoding loop processes each leaf once while relying on constant-time label-to-node or label-to-leaf access structures.

The constructive decoding procedure in [2503.10169] is especially transparent. Starting from a single leaf \(0\), one scans the vector \((a_1,\dots,a_{n-1})\); for each \(i\), one finds the node currently carrying label \(a_i\), subdivides its parent edge, labels the new internal node \(-i\), and attaches a new leaf \(i\). The inverse encoding deletes leaves in reverse order and records the sister label of each deleted leaf. A stability property under restriction is crucial: if \(T\) has OLA vector \((a_0,a_1,\dots,a_{n-1})\), then \(T|_k\) has OLA vector \((a_0,a_1,\dots,a_{k-1})\) for any \(k<n\) [2503.10169].

The linear-time perspective is preserved in later generalizations. For fixed ordering \(\sigma\), [2509.16405] states that both encoding and decoding are \(O(n)\), and that the corrected OLA distance for a fixed set of \(k\) trees can be computed in linear time by a single scan of the vectors. For multifurcated trees, the paper introduces an \(O(kn\cdot m\log m)\) resolution algorithm, where \(m\) is the size of a largest multifurcation [2509.16405]. This places OLA in a regime where vectorization, comparison, and some downstream combinatorial reconstructions remain polynomial-time even when the associated phylogenetic optimization problems are otherwise difficult.

## 4. The induced OLA distance and ordering dependence

For a fixed leaf ordering, the OLA distance between two rooted phylogenetic trees is the Hamming distance between their OLA vectors. In [2503.10169], if \(\Phi(T)=(a_1,\ldots,a_{n-1})\) and \(\Phi(T')=(a'_1,\ldots,a'_{n-1})\), then
\[
d_{\mathrm{OLA}}(T,T')=\#\{i:a_i\neq a'_i\}.
\]
In [2507.11254], the same idea is written as
\[
d^\sigma_{\mathrm{OLA}}(T,T')=\#\{i:u_i\neq v_i\},
\]
for OLA vectors \(\mathbf{u}\) and \(\mathbf{v}\) computed under the same ordering \(\sigma\). For fixed \(\sigma\), this is stated to be a genuine distance satisfying the triangle inequality [2507.11254].

The defining limitation of OLA is that it is highly order-dependent. The same tree can have substantially different OLA vectors under different orderings, and the dissimilarity between two fixed trees can vary strongly with \(\sigma\). "Order-Dependent Dissimilarity Measures on Phylogenetic Trees" proves that for certain pairs of trees on \(n+1\) leaves, the difference
\[
\left|d^\sigma_{\mathrm{OLA}}(T,T')-d^{\sigma'}_{\mathrm{OLA}}(T,T')\right|
\]
can be as large as \(n-2\), and that this bound is sharp [2507.11254]. The order-minimized version
\[
d^*_{\mathrm{OLA}}(T,T')=\min_\sigma d^\sigma_{\mathrm{OLA}}(T,T')
\]
is therefore natural, but after minimizing over all orderings it is no longer guaranteed to satisfy the triangle inequality [2507.11254].

This order sensitivity is not merely a technical nuisance. The papers treat it as the central mechanism through which OLA can either obscure or expose structural discordance. A plausible implication is that OLA should be understood less as an intrinsic coordinate system on unlabeled tree space than as a family of order-conditioned encodings whose informativeness depends on how well the ordering aligns with the combinatorial or biological process of interest. This interpretation is explicit in the later connections to cherry-picking sequences and temporally ordered samples [2507.11254], [2509.16405].

## 5. Relations to other tree distances and encodings

OLA is repeatedly compared with Phylo2Vec and HOP, two other recent order-dependent vector encodings of rooted phylogenetic trees. The principal contrast with Phylo2Vec is that OLA uses persistent negative labels for internal nodes, whereas Phylo2Vec relabels interior vertices repeatedly as leaves are added [2507.11254], [2503.10169]. Under a cherry-picking-sequence ordering, OLA and Phylo2Vec vectors coincide [2507.11254]. HOP, by contrast, uses a longer vector of length \(2n\) and encodes root-to-leaf path structure more richly [2507.11254].

The relationship between OLA distance and classical rearrangement distances is nuanced. The original OLA paper shows that a single NNI move can alter as many as \(n-2\) OLA entries, so no worst-case constant-factor comparison with NNI distance is possible [2503.10169]. Nevertheless, if \(T'\) is a uniformly random NNI neighbor of a fixed tree \(T\), then
\[
\mathbb{E}[d_{\mathrm{OLA}}(T,T')]\le 4
\]
for \(n\ge 4\) [2503.10169]. For SPR, the paper provides examples where a single SPR move also yields large OLA distance and states the conjecture
\[
\mathbb{E}[d_{\mathrm{OLA}}(T,T')] = O(\theight(T)),
\]
where \(T'\) is a uniformly random SPR neighbor of fixed \(T\) [2503.10169].

Later work gives stronger comparison results with rooted subtree prune and regraft distance and hybridization parameters. For OLA, [2507.11254] proves that there exists an ordering \(\sigma\) such that
\[
d^\sigma_{\mathrm{OLA}}(T,T') \le 28\cdot d_{\mathrm{rSPR}}(T,T'),
\]
hence
\[
d^*_{\mathrm{OLA}}(T,T')\le 28\cdot d_{\mathrm{rSPR}}(T,T').
\]
At the same time, the paper shows there are pairs with
\[
d^*_{\mathrm{OLA}}(T,T') > d_{\mathrm{rSPR}}(T,T'),
\]
so OLA does not characterize rSPR exactly [2507.11254]. It also proves the more general upper bound
\[
d^*_{\Theta}(T,T')\le h(T,T') \qquad \text{for each } \Theta\in\{\mathrm{HOP},\mathrm{OLA},\mathrm{P2V}\},
\]
where \(h(T,T')\) is the hybrid number, while noting that strict inequality can occur for OLA [2507.11254].

## 6. Cherry-picking sequences, agreement forests, and reticulation

OLA acquires sharper combinatorial meaning when the leaf ordering is constrained by a common cherry-picking sequence. If \(S=(x_1,\dots,x_n)\) is a common cherry-picking sequence for two trees \(T\) and \(T'\), and \(\sigma\) is the induced ordering given by the reverse order of the sequence, then [2507.11254] states that
\[
d^\sigma_{\mathrm{OLA}}(T,T') = d^\sigma_{\mathrm{P2V}}(T,T') = d^\sigma_{\mathrm{HOP}}(T,T') = wt(S).
\]
After minimizing over all such induced orderings, one obtains
\[
d^{CPS}_{\mathrm{OLA}}(T,T') = d^{CPS}_{\mathrm{P2V}}(T,T') = d^{CPS}_{\mathrm{HOP}}(T,T') = h_t(T,T'),
\]
where \(h_t(T,T')\) is the temporal tree-child hybrid number [2507.11254]. In this regime, OLA is not merely a proxy but an exact representation of the same quantity.

The 2025 reticulation paper refines the distance notion by defining a corrected OLA distance \(\hat d_\sigma\) that propagates mismatches when both trees attach a leaf above a placement already known to differ [2509.16405]. For two trees, the mismatch set \(M\) includes index \(i\) either when the corresponding OLA entries differ, or when both entries are the same negative index \(-j\) with \(j\in M\). The corrected distance is then \(\hat d_\sigma(T,T')=|M|\); the construction extends to sets of \(k>1\) trees [2509.16405].

The central theorem of [2509.16405] states that if \(\sigma^*=\arg\min_\sigma \hat d_\sigma(\mathcal T)\) for a set \(\mathcal T\) of rooted binary trees on the same leaf set, then
\[
\hat d_{\sigma^*}(\mathcal T)=m(\mathcal T)=|\maaf(\mathcal T)|-1,
\]
where \(\maaf(\mathcal T)\) is a maximum acyclic agreement forest. The paper proves both directions: an acyclic agreement forest yields an ordering with small corrected OLA distance, and conversely a mismatch structure in optimal OLA vectors yields an acyclic agreement forest of corresponding size [2509.16405]. It also states that a MAAF can be reconstructed directly from optimal OLA vectors by identifying mismatch indices, forming initial blocks, assigning consensus leaves by span, and taking induced subtrees on those leaf blocks.

## 7. Extensions, applications, and scope

The most substantial extension beyond binary trees appears in [2509.16405], which adapts OLA to multifurcated trees by preprocessing each tree into a placement vector \(OLA(T)\) together with a Boolean vector \(multi(T)\) indicating whether a given leaf creates a multifurcation in the partial tree. The paper’s resolution algorithm then constructs binary refinements that preserve the corrected-distance/MAAF correspondence under a fixed ordering. The resulting theorem states that if \(\sigma^*\) minimizes the corrected OLA distance on trees resolved by this algorithm, and \(\mathcal T^*\) is a set of optimal resolutions minimizing \(|\maaf(\mathcal T^*)|\), then
\[
\hat d_{\sigma^*}(\mathcal T)=|\maaf(\mathcal T^*)|-1=m(\mathcal T)
\]
for possibly nonbinary trees as well [2509.16405].

These results motivate applications to fast phylogenetic network computation, reticulation-number estimation, and agreement-forest reconstruction. When no distinguished leaf order is available, [2509.16405] proposes sampling many random leaf permutations, computing \(\hat d_\sigma(\mathcal T)\) for each, and retaining the minimum as a practical heuristic upper bound. When a natural temporal order exists, the paper argues that the sample collection date often provides such an ordering for pathogens and fast-evolving microbes; under the stated mild assumption that ancestors are rarely sampled after descendants, reticulation events can then be identified in polynomial time [2509.16405].

A common misconception would be to regard OLA as an order-invariant summary of tree topology or as an exact substitute for rSPR or hybrid number in unrestricted settings. The cited results do not support that interpretation. Instead, OLA is a compact, bijective, and computationally efficient encoding whose explanatory power depends critically on ordering. In unrestricted form it is an order-dependent Hamming-space representation; under special orderings, especially those induced by common cherry-picking sequences or agreement-forest structure, it becomes tightly coupled to reticulation-aware phylogenetic invariants [2507.11254], [2509.16405].

Source: https://www.emergentmind.com/topics/ordered-leaf-attachment