TriNet: Metric for Level-1 Phylogenetics
- TriNet is a trinet-based metric for comparing binary level-1 phylogenetic networks by analyzing tidied three-leaf subnetworks.
- It encodes local reticulate structure uniquely, ensuring that zero trinet distance implies isomorphic network reconstructions.
- An optimal cubic-time algorithm computes trinets using precomputed binets and lsa tables, yielding finer resolution than traditional methods.
TriNet denotes a trinet-based metric and computational framework for comparing binary level-1 phylogenetic networks on a common leaf set. Its central principle is to replace direct comparison of large reticulate networks by comparison of all displayed labeled trinets, that is, the tidied three-leaf subnetworks induced by each taxon triple. In this setting, disagreement is measured by a symmetric set difference on trinet sets, and the key theoretical justification is that the full set of displayed trinets encodes a level-1 network, so the resulting distance is a proper discriminator of reticulate structure rather than a coarse tree-derived surrogate (Moulton et al., 2017).
1. Formal setting and basic objects
Let be a finite leaf set of size . A rooted phylogenetic network on is a simple acyclic digraph with a unique root, no degenerate vertices, and leaves bijectively labeled by . The binary restriction used by TriNet requires that each non-leaf vertex has indegree and outdegree at most two, and that each vertex with indegree two has outdegree one. A level- network is one in which every biconnected component contains at most reticulations; in particular, a level-1 network is binary and has the property that all cycles in its underlying graph are pairwise disjoint. This class is slightly more general than trees and includes networks often termed galled trees (Moulton et al., 2017).
Two ancestor notions govern trinet extraction. For a subset , the lowest common ancestor is the common ancestor not above any other common ancestor of . A stable ancestor of 0 is a vertex contained in every dipath from the root to some taxon in 1, and the lowest stable ancestor 2 is the unique vertex below all stable ancestors of 3. In level-1 networks, 4 exists and is unique, and either 5, or there is a unique dipath from 6 down to 7 that contains no cut arc. For pairs 8, the 9 table stores 0 and is the main auxiliary structure used by TriNet (Moulton et al., 2017).
Given a triple 1, the displayed trinet 2 is obtained by restricting 3 to the part reachable from 4 on dipaths to leaves in 5, then repeatedly suppressing degree-2 vertices and replacing parallel arcs by single arcs until no further tidying applies. Up to relabeling there are eight trinet types, but TriNet compares labeled trinets on the fixed leaf set by canonical encoding after suppression of degree-2 vertices and parallel edges. Equality is label-preserving isomorphism on the tidied three-taxon subnetworks (Moulton et al., 2017).
2. Trinets as an encoding device
TriNet is rooted in the observation that triplets and trinets play fundamentally different roles in reticulate phylogenetics. Triplets are rooted three-leaf trees and suffice to encode rooted phylogenetic trees, but they generally do not encode rooted phylogenetic networks. Distinct level-1 networks can share all triplets, so triplet distance can be zero even when the underlying networks are different. Trinets generalize triplets by retaining local reticulation structure, and for level-1 networks the set of displayed trinets 6 encodes 7 (Moulton et al., 2017).
This encoding perspective predates the cubic-time distance algorithm. For 1-nested networks, displayed trinets were shown to determine the network uniquely and to support a polynomial-time construction algorithm from dense trinet sets (Huber et al., 2011). Subsequent work extended identifiability beyond level-1: recoverable binary level-2 networks and binary tree-child networks are also encoded by their trinets, via decomposition theorems based on cut-arc sets and biconnected components (Iersel et al., 2012). These results place TriNet within a broader line of work in which three-taxon subnetworks are not merely local summaries but complete invariants for several important network classes.
A common misconception is that trinets are simply a network analogue of rooted triplets and therefore inherit the same limitations. The theory suggests the opposite for level-1 networks: triplets discard reticulation and cut-arc information, whereas trinets preserve enough local structure to determine the global network. A plausible implication is that TriNet’s discriminative power is a direct consequence of identifiability, not merely of using more local configurations.
3. Distance definition and metric properties
For a level-1 network 8 on leaf set 9, TriNet considers the set of displayed labeled trinets
0
For two level-1 networks 1 and 2 on the same leaf set, the trinet distance is
3
where 4 is symmetric difference (Moulton et al., 2017).
Because there are exactly 5 triples and each triple contributes at most one trinet to each network’s set, the diameter satisfies
6
Equality is achievable, for example when one network is a tree and the other is a saturated level-1 network in which every interior vertex lies in a 3-cycle. This cubic scaling is intrinsic to the comparison unit: TriNet counts local disagreements over all three-taxon views, not just over vertex-induced clusters (Moulton et al., 2017).
The metric interpretation is strengthened by the encoding theorem. Since the set of displayed trinets uniquely determines a level-1 network, zero trinet distance implies isomorphism of the compared networks. This is precisely the respect in which TriNet improves on triplet-based comparison: it is a proper metric on the target class rather than a pseudo-metric that can collapse distinct reticulate topologies.
A worked four-leaf example illustrates the counting mechanism. If 7 is the rooted binary tree with topology 8 and 9 is obtained by introducing a reticulation forming a reticulate cherry between 0 and 1, then the displayed trinets differ on 2 and 3 but agree on 4 and 5. Hence 6 (Moulton et al., 2017).
4. Cubic-time algorithm and implementation
The principal algorithmic contribution associated with TriNet is an optimal 7 procedure for computing 8, and hence the distance between two level-1 networks. The algorithm has two stages. First, it precomputes binets and the 9 table in 0 time. A binet is a displayed subnetwork on two taxa; up to relabeling there are two types, the cherry 1 and the reticulate cherry 2. The algorithm topologically orders tree vertices, computes clusters 3, and inspects the two child clusters 4 and 5 of each interior vertex. If 6 and 7, then 8 is displayed with splitting ancestor 9, and 0 is set to 1. If 2 and 3, then 4 is displayed with 5; if 6 has not been recorded previously, it is set to 7 (Moulton et al., 2017).
The structural facts behind this preprocessing are specific to level-1 networks. For any pair 8, the network has a unique 9. Moreover, 0 occurs if and only if 1, equivalently if there is no splitting ancestor of 2 and 3. By contrast, 4 occurs if and only if 5, equivalently if 6 is the unique splitting ancestor. These equivalences allow the algorithm to represent each pair by a binet type plus an 7 entry.
Second, the algorithm infers the displayed trinet for each unordered triple in 8 time per triple. For 9, it examines the three binets 0, counts the number 1 of cherries among them, orders the taxa so that 2, and checks whether 3 is 4 or 5. The resulting case analysis decides among the eight trinet types. When 6, the trinet is 7; when 8, it is 9; when 0, the outcome is one of 1, 2, 3, or 4 depending on 5 relations and whether 6; when 7, the outcome is 8 or 9 depending on the same binet membership test (Moulton et al., 2017).
The total runtime is therefore 00, with 01 preprocessing and constant-time inference for each of the 02 triples. Space usage is 03 for the 04 table plus 05 to store all trinet encodings or hashed signatures. The bound is optimal in the standard exact model because any exact algorithm must in general inspect all triples, which are 06 in number. Auxiliary size bounds for saturated level-1 networks, namely 07 and 08, support the preprocessing analysis (Moulton et al., 2017).
The algorithms were implemented in Java in the TriLoNet package. The implementation supports parsing level-1 networks with labeled leaves, computing 09 by the cubic procedure, evaluating 10 and the restricted Robinson–Foulds distance, and running simulation workflows akin to those used in the original empirical study (Moulton et al., 2017).
5. Comparison with the restricted Robinson–Foulds network metric
TriNet was evaluated against the Robinson–Foulds network metric restricted to level-1 networks. In that setting, 11 is defined as the size of the symmetric difference of the cluster multisets induced by interior vertices. Using the bound 12 and noting that root and leaf clusters are identical, one obtains
13
The contrast with TriNet is immediate: the trinet diameter scales as 14, whereas the restricted RF diameter scales as 15 (Moulton et al., 2017).
Conceptually, the two metrics summarize different structures. RF compares vertex-induced clusters, which can be coarse in reticulate regions. TriNet compares all displayed three-leaf subnetworks and is therefore sensitive to local reticulate arrangements such as reticulate cherries and their position relative to 16 and 17. This suggests why TriNet is typically more discriminative, though computationally more expensive.
The empirical comparison used three datasets of level-1 networks with 50 leaves. Lev(1) and Lev(10) were generated with the lev1athan model using one versus ten seeds, and Ran was generated by repeatedly attaching leaves to randomly chosen arcs via three operations. Distances were normalized to 18 using the diameters 19 for 20 and 21 for 22. Across datasets, the trinet metric exhibited a broader range and larger variance than RF, whereas the RF distributions were tighter (Moulton et al., 2017).
| Metric | Normalized diameter | Average time on 50-leaf datasets |
|---|---|---|
| 23 | 24 | 140, 145, and 231 minutes |
| 25 | 26 | 16, 21, and 58 minutes |
Timing measurements were obtained on a machine with an i7 CPU and 16 GB RAM. The results indicate a practical trade-off rather than a contradiction: RF is faster in practice, but TriNet captures more local reticulate disagreement and therefore yields a broader discriminatory range (Moulton et al., 2017).
6. Scope, limitations, and later developments
TriNet, as defined in the cubic-time algorithm, is restricted to binary level-1 networks. This is not an incidental technical choice: the existence and uniqueness of 27, the structure of splitting ancestors, and the fact that displayed trinets encode the network are all used directly in the algorithm and in the metric’s correctness arguments (Moulton et al., 2017).
Extensions beyond level-1 are nontrivial. Trinets determine recoverable binary level-2 networks and binary tree-child networks, which suggests that trinet-based comparison may remain meaningful on broader classes, but the general statement that higher-level networks are determined by their trinets is not available. Indeed, the data explicitly notes that general higher-level networks are not necessarily determined by their trinets (Iersel et al., 2012). A plausible implication is that the TriNet metric remains most principled when identifiability by displayed trinets is established for the class under study.
Related reconstruction results clarify the surrounding landscape. Dense trinet sets can be used to decide displayability by a 1-nested network and to construct that network in polynomial time (Huber et al., 2011). By contrast, for nondense collections of binets and trinets, deciding whether a binary level-1 network displays a given trinet set is NP-hard, although binet-only instances and certain restricted mixed instances remain polynomial-time solvable (Huber et al., 2014). These results underscore that TriNet occupies the comparison side of a broader program in which trinets serve both as local encodings and as algorithmic primitives.
From a practical perspective, exact TriNet computation is optimal but cubic, so it is feasible for moderate numbers of leaves rather than very large networks. The original study notes that the method is usable up to dozens of leaves, while RF may be preferable for rapid screening. The same study also leaves several directions open, including faster approximate trinet distances, normalization and diameter results for other network metrics, and better random generators for level-1 networks (Moulton et al., 2017).