Biology · open
The most ambiguous pair of DNA sequences.
Best known value: 917147 (maximize), held by Quantavane (Arhan Canli) since 9 November 2026.
The problem
Two DNA sequences x and y of length n over A, C, G, T are aligned globally with unit costs: a mismatch costs 1, a gap (one letter inserted or deleted) costs 1, a match costs 0. An alignment is a path from (0, 0) to (n, n) in the edit graph with diagonal, horizontal and vertical steps, and the optimal alignments are the paths of least total cost (the edit distance). Let A(n) be the largest number of optimal alignments of a pair of sequences of length n. We find A(n) exactly for n <= 7 (1, 3, 5, 12, 24, 53, 114). The headline cell is n = 20: find a pair of DNA sequences of length 20 with more than 917,147 optimal alignments (ours).
Why it is interesting
Alignments underlie almost every comparison of biological sequences, and when several alignments have the same optimal score the one a program reports is an arbitrary choice: the positions of gaps, and the mutations and indels read off them, can change from one co-optimal alignment to another. Counting the co-optimal alignments of two given sequences is a textbook dynamic program (Gusfield 1997; the Rosalind exercise 'Counting optimal alignments'). How ambiguous can it get? For the longest common subsequence, Greenberg (2003) bounded the number of optimal embeddings and of distinct common subsequences, and for parametric alignment the number of distinct optimal alignment summaries is of order n^(2/3) (Gusfield et al.; Vinzant). Here the scoring is fixed (unit edit costs), the alphabet is DNA, and the question is the pair with the most optimal alignments. The exact values grow roughly by a factor of two per letter: A(7) = 114. The first six values 1, 3, 5, 12, 24, 53 coincide with OEIS A026786 (the middle column of a path-counting triangle of Kimberling), but the next term there is 117, not 114, so the coincidence ends. The growth rate of A(n) and the shape of the extremal pairs are open.
Is it new?
New question: counting the optimal alignments of given sequences is standard, but no result was found on the pair of sequences of a given length with the most optimal alignments under unit costs. Our first values match an unrelated OEIS sequence for six terms and differ at the seventh.
Checked 9 November 2026, before the problem was added: 8 arXiv searches, 4 OEIS searches, 2 web searches, and the keeper tables of the Open Problems Benchmark. Every search, with its address and first results, is in the novelty record.
First values
| n | most optimal alignments A(n) | an extremal pair x / y | how |
|---|---|---|---|
| 1 | 1 | A / A | exact (every pair) |
| 2 | 3 | AC / CA | exact (every pair) |
| 3 | 5 | ACC / CAA | exact (every pair) |
| 4 | 12 | ACGA / GAAC | exact (every pair) |
| 5 | 24 | ACCGG / CGACA | exact (every pair) |
| 6 | 53 | ACCGGT / CGTACG | exact (every pair) |
| 7 | 114 | ACCGGTT / CGTACGA | exact (every pair) |
| 8 | 249 | ACTAGCTG / GGCCTTAA | best known (ours, local search) |
| 10 | 1081 | AAGGGCCCTT / TGCCTAGGCA | best known (ours, local search) |
| 12 | 4334 | TTGGGCCCCAAA / CGCCAATGGCCG | best known (ours, local search) |
| 16 | 52567 | GTCGGCCTTTGGTTGG / AATTTAGGGGCCCACC | best known (ours, local search) |
| 20 | 917147 | TCGCTTCCAGAAAAACAGCG / AAAGGGGTTTTCCCTGGTTT | best known (ours, local search) |
Exact values by trying every pair (x with its letters in order of first appearance; tools/src/alignamb.c, mode exact). Larger n: local search, lower bounds only. Rows improved on 10 November 2026 show the value of the cell (see Cells).
Cells
The same question at each value of its parameter (n, the length of the two sequences): 18 cells, 5 exact (an exhaustive search finished) and 13 best known (ours). Each cell has its certificate in the benchmark and is checked with the same checker.
| Cell | n | Value | Status |
|---|---|---|---|
| align-ambiguity-3 | 3 | 5 | exact |
| align-ambiguity-4 | 4 | 12 | exact |
| align-ambiguity-5 | 5 | 24 | exact |
| align-ambiguity-6 | 6 | 53 | exact |
| align-ambiguity-7 | 7 | 114 | exact |
| align-ambiguity-8 | 8 | 249 | best known |
| align-ambiguity-9 | 9 | 491 | best known |
| align-ambiguity-10 | 10 | 1081 | best known |
| align-ambiguity-11 | 11 | 2144 | best known |
| align-ambiguity-12 | 12 | 4334 | best known |
| align-ambiguity-13 | 13 | 8763 | best known |
| align-ambiguity-14 | 14 | 14221 | best known |
| align-ambiguity-15 | 15 | 26031 | best known |
| align-ambiguity-16 | 16 | 52567 | best known |
| align-ambiguity-17 | 17 | 124107 | best known |
| align-ambiguity-18 | 18 | 206133 | best known |
| align-ambiguity-19 | 19 | 401341 | best known |
| align-ambiguity-20 | 20 | 917147 | best known (headline) |
Exact cells: every pair of sequences, up to renaming letters, reversal and swapping (tools/src/alignamb.c, mode exact). Best known cells: local search changing one letter at a time (tools/src/alignamb.c, mode ls); a lower bound.
Best known value
917,147 optimal alignments, held by Quantavane (Arhan Canli), 9 November 2026: the pair in `refs/align-ambiguity.txt` (TCGCTTCCAGAAAAACAGCG / AAAGGGGTTTTCCCTGGTTT).
Check a solution
Text file: two lines, the DNA sequences x and y, each of 20 letters A, C, G, T. Score: the number of optimal alignments, an integer (larger is better).
git clone https://github.com/arhancanli/quantavane-benchmark
cd quantavane-benchmark
python3 -I obb.py check align-ambiguity FILE
The checker is ours, uses only the Python standard library, prints the exact value and accepts only valid certificates. A better value is credited by name here and in the benchmark's leaderboard; write to [email protected] or open an issue on the benchmark repository.
The problem file on GitHub All Originals