Colinear Chaining in Sequence Alignment
- Colinear chaining is an optimization framework that selects order-consistent fragments or anchors to serve as a one-dimensional backbone in sequence alignment.
- It employs both dynamic programming and line-sweep algorithms, with hybrid methods offering efficient runtime and space trade-offs critical for genomic applications.
- Modern formulations integrate gap and overlap costs, establishing a tight connection with anchored edit distance and markedly improving mapping sensitivity.
Colinear chaining is a classical optimization problem in sequence comparison and sequence alignment in which one selects an ordered subset of fragments or anchors between two sequences so that their order is consistent in both sequences and an objective is optimized. In the classical fragment-chaining formulation, compatibility requires non-overlap in both sequences; in modern overlap-aware formulations, anchors may overlap provided they satisfy a precedence relation that does not move backward in the edit graph. The problem is a standard backbone step in whole-genome comparison, cDNA/EST mapping, conserved synteny detection, alignment of genomic regions, and a main component of many state-of-the-art read mappers based on seed-chain-extend (Allali et al., 2015, Rizzo et al., 2 Jun 2026).
1. Formal problem setting
A classical formulation uses two sequences and of lengths and , together with a set of fragments. A fragment is represented by five fields,
where and are the corresponding substrings and is the fragment score. Geometrically, each fragment is viewed as a rectangle in the quarter plane, with 0-coordinates in 1, 2-coordinates in 3, and borders 4 and 5. A chain is a set of fragments 6 such that
7
so fragments are ordered and non-overlapping in both sequences. The score of the chain is 8, and the computational objective is the maximum chain score (Allali et al., 2015).
Modern formulations usually replace fragments by anchors, that is, exact matches between a query 9 and a target 0. One presentation uses
1
with
2
and studies chains under strict precedence, weak precedence, or a stricter “ChainX precedence” in which all start and end coordinates are strictly increasing (Rizzo et al., 13 Jun 2025). Another presentation uses 0-indexed, right-open intervals,
3
with startpoint 4, endpoint 5, and diagonal
6
equivalently 7 because the anchor is an exact match (Rizzo et al., 2 Jun 2026).
These formalisms encode the same central idea: a chain is an increasing sequence of local exact correspondences that serves as a one-dimensional backbone for a global comparison. This suggests that “colinear” refers not to Euclidean colinearity, but to compatibility with a common left-to-right order in both sequences.
2. Objective functions and the anchored edit-distance connection
In the classical fragment model, the optimization target is additive reward: one maximizes the sum of fragment scores subject to compatibility. This is the formulation treated by the dynamic programming and line-sweep algorithms in the fragment-chaining literature (Allali et al., 2015).
In overlap-aware chaining for alignment, the objective is instead a minimum total connection cost. For a chain 8, one presentation introduces sentinels
9
and defines
0
where
1
Here
2
measures the insertion/deletion-like gap between consecutive anchors, while
3
penalizes inconsistent overlaps (Rizzo et al., 13 Jun 2025).
A second presentation, tailored to anchored edit distance, decomposes the same phenomenon into gap and diagonal terms. For anchors 4,
5
6
and
7
The connection cost is then
8
equivalently
9
This formulation distinguishes true inter-anchor gaps from overlap configurations, in which cost is driven by diagonal mismatch rather than by a simple spatial separation (Rizzo et al., 2 Jun 2026).
The key theoretical link is that optimal overlap-aware colinear chaining is not merely heuristic. The 2025 paper restates the result of Jain et al. that
0
and adds that if the anchors are all maximal exact matches, then the optimal chaining cost is exactly the ordinary unit-cost edit distance between the two strings (Rizzo et al., 13 Jun 2025). The 2026 paper formulates the same point for global and semi-global variants: the minimum-cost chain under the 1/2 model equals anchored edit distance, and the semi-global analogue equals semi-global anchored edit distance (Rizzo et al., 2 Jun 2026).
A frequent misconception is that colinear chaining is intrinsically a non-overlap problem. The overlap-aware literature shows otherwise: allowing overlaps is essential in current chaining formulations, and in long-read mapping overlaps improve sensitivity and avoid restrictions on the fragment class considered (Rizzo et al., 2 Jun 2026).
3. Classical algorithmic foundations
The standard dynamic programming formulation for fragment chaining defines
3
together with a fragment-local state
4
When the begin border 5 of a fragment is reached,
6
where 7 is the best score strictly before the fragment in both dimensions. When the end border 8 is reached, the algorithm updates
9
and the current column by
0
The worst-case running time is 1 (Allali et al., 2015).
The line-sweep alternative is asymptotically better on sparse instances. It processes fragment borders in increasing order along sequence 2 and maintains a data structure 3 storing pairs 4, where 5 is the best chaining score among partial chains in the rectangle from 6 to 7, and the chain ends at a fragment whose top border is exactly 8. At a begin event for fragment 9,
0
where 1 is the best score in 2 with 3. At the end event, if 4 improves the frontier, one inserts 5 and deletes dominated entries. With a balanced-tree-like structure supporting search, insertion, and deletions in logarithmic time, this yields 6 time (Allali et al., 2015).
The hybrid dynamic programming/line-sweep algorithm combines both principles. It first reduces the input to a compact instance 7, in which every position of 8 and every position of 9 contains at least one fragment border. This reduction preserves the chaining problem and can be computed in
0
time and
1
space. The decision to use dynamic programming or line sweep is then made per column using the border density
2
Positions with
3
belong to a dense set 4, and the remainder to a sparse set 5. The data structure 6 consists of an array 7 of size 8, augmented with a balanced binary tree 9, and supports 0 and 1 in 2 time. The resulting running time is
3
with space 4. The paper argues that this hybrid is asymptotically never worse than either pure dynamic programming or pure line sweep (Allali et al., 2015).
4. Practical optimal chaining in modern aligners
Jain et al. gave an exact overlap-aware algorithm running in
5
time for colinear chaining with overlap and gap costs, and proposed a practical implementation, 6, intended to run in
7
average-case time, where 8 is the cost of the output chain. The practical idea is to guess an upper bound 9 on the optimal cost and only consider predecessor anchors that are close enough to the current anchor under a sparse and uniform anchor model (Rizzo et al., 13 Jun 2025).
The 2025 revisit shows that 0 is not guaranteed to be optimal. Its pruning rule requires only
1
and this does not ensure that every pair with 2 is considered. The paper exhibits a counterexample with anchors 3, where the optimal chain is 4 with cost 5, but 6 with 7 skips that transition and instead considers suboptimal chains of cost 8. A modified condition such as
9
still fails because it misses overlapping-anchor cases (Rizzo et al., 13 Jun 2025).
The proposed correction introduces the anchor diagonal
00
Its central lemma states that if two anchors are in a gap-gap configuration, then
01
whereas in all other overlap cases,
02
This yields a revised recurrence
03
where 04 handles non-overlapping predecessors in 05 and 06 scans only diagonals within distance 07 of 08. The implementation uses sorting by positions in 09, bucketing by diagonal, and an active-anchor array 10. It assumes, after preprocessing by merging perfect chains, that if two anchors have the same diagonal, then they do not overlap in 11 or in 12; this preprocessing can be done in
13
time (Rizzo et al., 13 Jun 2025).
The resulting algorithm is optimal and runs in
14
average-case time, where 15 is the optimal chaining cost. Empirically, the paper reports minimal computational slowdown relative to 16. On a real long-read dataset consisting of the T2T-CHM13 reference and 100k PacBio HiFi reads, 17 took about 18 seconds, 19-opt20 took about 21 seconds, memory usage was about 22 GB for both, the average number of iterations was reduced from 23 to 24, and 25-opt26 improved the chaining cost for
27
of the reads, with an average improvement ratio of 28 on those improved cases (Rizzo et al., 13 Jun 2025). This directly refutes the assumption that practical pruning is automatically harmless on realistic data.
5. Near-linear and sublogarithmic-time developments
The 2026 work revisits a different algorithmic lineage, beginning with the 29 algorithms of Eppstein et al. for fragment chaining without overlaps. Those classical methods minimized a gap cost based on diagonal distance between consecutive fragments, but they forbade fragment overlaps. The paper argues that overlaps are essential in current chaining formulations because, in long-read mapping, overlaps improve sensitivity and avoid restrictions on the fragment class considered (Rizzo et al., 2 Jun 2026).
Its main result is an asymptotic improvement for the overlap-aware anchored edit-distance model: the earlier
30
exact algorithm is reduced to
31
time in
32
space. The method combines the gap-cost computation of Chao and Miller with the overlap-cost computation of Baker and Giancarlo. The dynamic program is
33
and the recurrence is partitioned into four mutually exclusive cases:
- overlap, bigger 34-overlap;
- overlap, bigger 35-overlap;
- gap-gap, bigger 36-gap;
- gap-gap, bigger 37-gap (Rizzo et al., 2 Jun 2026).
The difficult case is the fourth, handled by adapting the Eppstein et al. space-partitioning idea. Each anchor defines a triangular region of influence, and the best predecessor for a point on the sweep line is stored in an owner array 38. The owner array is compressed as a doubly linked list of dividing lines, consisting of horizontal lines and diagonal lines; changes in ownership occur only at those lines, the total number of lines is 39, and delayed intersection updates preserve 40 space and 41 time (Rizzo et al., 2 Jun 2026).
The same paper also presents a simpler 42-time implementation, llchain, which replaces specialized 43-time predecessor structures with a standard ordered map. Despite the weaker asymptotic bound, llchain is reported to scale competitively to millions of fragments and large genomes: on average it is 44 faster than other methods on instances with 45 anchors, over 46 faster on MEMs between HiFi reads and a reference human genome, and about 47 faster overall on the tested dataset. Reported average timings are seeding 48s, ChainX 49s, ChainX-opt 50s, and llchain 51s (Rizzo et al., 2 Jun 2026). A plausible implication is that older chaining machinery, once adapted to overlap-aware cost models, remains highly competitive for modern genomics workloads.
6. Related chain formalisms and terminological scope
Outside sequence alignment, the word “chaining” denotes distinct technical constructions. In high-dimensional probability and Banach-space geometry, "Chaining, Interpolation, and Convexity" develops an interpolation-based chaining principle in which multiscale approximation is generated by Peetre’s 52-functional rather than by Talagrand’s adaptive net construction. For a penalty 53 and metric 54,
55
with minimizer 56, and 57. Proposition 2.3 states that for every 58,
59
For symmetric compact convex 60, the thin subsets
61
replace entropy numbers of the whole set by entropy numbers of smaller subsets. The paper does not use the term “colinear chaining,” but it explicitly describes the mechanism as chaining along a structured one-parameter family 62 produced by interpolation (Handel, 2015).
In discrete geometry, "Chains, Koch Chains, and Point Sets with many Triangulations" defines a chain as an 63-ordered sequence of points
64
such that every consecutive segment 65 is unavoidable in every triangulation. The visibility triangle
66
fully determines the order type of the chain. The paper proves a unique algebra of convex sums, concave sums, and flips; derives a quadratic-time dynamic program for the number of triangulations; and uses recursively defined Koch chains to obtain
67
triangulations, improving the previous lower bound 68 (Rutschmann et al., 2022). The authors explicitly note that this notion of chain is analogous to ordering constraints in colinear chaining problems, but it is a different subject.
Taken together, these works delimit the technical scope of colinear chaining. In sequence algorithms, it is the optimization of an order-consistent backbone of fragments or anchors, with modern formulations tightly linked to anchored edit distance. In other areas, “chaining” refers either to multiscale approximation generated by interpolation or to combinatorial structures defined by unavoidable edges. The shared theme is a constrained, scale- or order-respecting decomposition, but the objects, objectives, and algorithms are domain-specific.