WorksComputer Science
Breaking the Binary-Lifting Barrier for DNA Minimizer Density: Exact Optimization of a Native 4-ary Order at (w, k) = (12, 5)
Abstract
Minimizer schemes sample at least one -mer from every window of consecutive -mers via a total order on . For DNA (), state-of-the-art lookup schemes such as GreedyMini and OptMini optimize a binary order ( ranks) and lift it to by ranking one bit-plane primarily and breaking -way ties lexicographically on the other bit-plane. At , this projection locks sets of DNA -mers into contiguous blocks and restricts the active universal hitting set (UHS) prefix to of -mers, giving exact expected DNA density for OptMini (k5-w12-13.txt) and for GreedyMini (w12_k5.gm). We bypass binary lifting and optimize directly over native -ary permutations () from scratch via: (i) an exact de Bruijn endpoint transfer-matrix dynamic program over ( states), (ii) a weighted set-cover ratio initializer (SetCover4) producing a compact UHS prefix, (iii) bitmask-sparse simulated annealing preserving the zero-cost -walk-free tail invariant, and (iv) two-pass exact best-insertion sweeps with large-neighborhood ruin-and-recreate search. The resulting explicit -ary order achieves exact expected DNA density (density factor ), cutting charged windows by contexts ( relative) below OrensteinLab/Minimizers and () below w12_k5.gm at -byte lookup storage ( bytes bit-packed). Warm-start relaxation stalls at (), whereas native -ary initialization breaks high-bit blocks across all nucleotide partitions.
Introduction
Minimizers [1] are a foundational local -mer sampling primitive in sequence alignment, sketching, and de novo assembly. Given an alphabet of size , window length , -mer length , and a total order , each window of consecutive -mers (spanning bases) selects the position of its minimum-rank -mer under leftmost tie-breaking. The expected density is the probability over an i.i.d. uniform random sequence in that consecutive windows select distinct positions. Lowering directly reduces index memory and downstream query cost.
In the DNA setting (, ), exact optimization faces a factorial state space of . Existing state-of-the-art table-based minimizers sidestep this scaling by first constructing low-density orders over the binary alphabet (, size ) using greedy selection (GreedyMini [3]) or branch-and-bound dynamic programming (OptMini [5]), whose exact solver covers binary and DNA , and then lifting the binary order to by ranking one bit-plane primarily and breaking ties lexicographically on the second bit-plane. Meanwhile, constant-space schemes such as mod-minimizers [4], decycling orders [2], and 10-minimizers/spacers [6] trade higher density at moderate for description length.
At , every precomputed binary-lifted order in OrensteinLab’s 10-minimizers [6] and Minimizers [3, 5] repositories groups DNA 5-mers into 32 rigid classes of size 32. Because remains compact enough for microsecond-scale exact transfer-matrix evaluation over the 4-ary de Bruijn graph ( vertices), we investigate direct optimization over native 4-ary permutations without binary projection or seeding from published tables.
Preliminaries and Exact De Bruijn Formulation
Definition 1 (Charged Context and Density). Encode as with the most-significant base first, identifying each -mer with . Let be a bijection. A DNA context specifies consecutive -mers spanning two adjacent windows and . Under leftmost tie-breaking,
The context is charged if and only if . The exact expected DNA density is , where is the number of charged contexts in , and the density factor is .
Theorem 1 (Disjoint Endpoint Decomposition on ). Let and . Identify each -mer with the directed edge in the de Bruijn graph , where and . For each rank , let and define (resp. ) as the subgraph of containing all edges with (resp. ). Then the exact charged context count satisfies
where is the number of length- directed walks in starting at , and is the number of length- directed walks in ending at .
Proof. A context fails to charge if and only if . Let be the leftmost occurrence of the global minimum rank in . If , then lies in both and , strictly beats every -mer to its left, and weakly beats every -mer to its right, forcing (uncharged). Conversely, if , then (charged, with and for all ), corresponding bijectively to length- walks from in . If , then (charged, with and for all , corresponding bijectively to length- walks into in ). Because and are mutually exclusive and partition every charged context uniquely by , summing over is exact.
Proposition 1 (Zero-Cost Tail Invariance and Active UHS Prefix). Define the active UHS cutoff . Then for all , and permuting among ranks leaves invariant. Moreover,
swapping any active element with any tail element via the rank-neutral tail swap followed by guarantees remains -walk-free, so only contributions for need recomputation.
Cold-Start Native 4-ary Optimization Pipeline
To avoid inheriting the structural bias of binary-lifted orders, we build our solution from scratch in pure C (-O3) with zero published seeds:
Weighted Set-Cover Ratio Initialization (
SetCover4). Starting from the complete graph (), placing edge at rank settles every -edge walk containing in the active graph . Let and denote length- walks starting/ending at in . The newly covered context volume through is approximately , while its boundary charge is bounded by . Greedily selecting the unplaced edge minimizing and sweeping stops as soon as everywhere, yielding an immediate -walk-free tail. At ,SetCover4produces an initial order in s with and exact density .
Bitmask-Sparse Compact-UHS Simulated Annealing (
opt_4ary_fast). Representing active vertices in as four 64-bit words withctzbit-scanning accelerates Theorem 1 to thousands of range evaluations per second. Four move operators run over four reheated annealing cycles: short/medium swaps in , critical-path tournament-selected insertions in , exact active-to-tail swaps leveraging Proposition 1, and tail promotions/ejections. Over 180 s (964,305 exact evaluations), this lowers the cold-start seed to .
Two-Pass Exact Best-Insertion Sweep + LNS (
exact_lns_insert). Evaluating relocating a single 5-mer to all candidate ranks requires only two linear DP sweeps over : Pass 1 evaluates and suffix elements without across (reusing for ), and Pass 2 evaluates prefix elements with inserted across (reusing for ). Each candidate rank is then scored in as . One exhaustive sweep over all 1,024 elements (1,048,576 candidate placements) executes in s. Coupled with gap-1...6 pairwise swaps and large-neighborhood ruin-and-recreate kicks (8–28 elements), this clears the bar within 11 s (2,234,607,526) and converges after an additional 150 s polish to ().
Results and Comparison Against Published Tables
Table 1 summarizes the exact expected DNA density over all contexts at across our cold-start order, an ablated warm-start relaxation from k5-w12-13.txt, and every published comparator from the 10-minimizers (commit 916daeab), GreedyMini (commit 0ea10d3), and Minimizers (commit 7b9430f) repositories of OrensteinLab. All binary orders are lifted to DNA under the repositories’ exact convention (primary rank on the odd/high bit-plane, secondary lexicographic tie-breaking on the even/low bit-plane, leftmost window tie-breaking); we verified exhaustively that both k5-w12-13.txt and w12_k5.gm are binary UHSs for and yield identical numerators across all six bit-plane tie-breaking variants, and that k5-w12-13.txt is strictly minimal across all 57 rows in best-orders.csv (Minimizers).
| Scheme / Order | Charged () | Density | Factor | Our Rel. |
| Native 4-ary cold-start (this work) | 2,234,289,615 | 0.1300527723 | 1.690686 | — |
| Native 4-ary warm-start () | 2,236,353,030 | 0.1301728789 | 1.692247 | −0.09227% |
| Minimisers k5-w12-13.txt (OptMini) | 2,246,214,544 | 0.1307468945 | 1.699710 | −0.530890% |
| 10-minimisers w12_k5.gm (GreedyMini) | 2,248,978,620 | 0.1309077849 | 1.701801 | −0.653141% |
| k_extension_k16_w12.csv (GreedyMini) | — | 0.130908 | 1.701804 | −0.653304% |
| angle-based (10-minimisers CSV) | — | 0.13622105 | 1.770874 | −4.528138% |
| one_zero_dna (WABI 2026 spacer) | 2,357,004,463 | 0.1371957166 | 1.783544 | −5.206391% |
| abb_plus_dna (WABI 2026 ABB+) | 2,359,463,963 | 0.1373388783 | 1.785405 | −5.305201% |
| double decycling (10-minimisers CSV) | — | 0.139662 | 1.815606 | −6.880345% |
| decycling (10-minimisers CSV) | — | 0.139725 | 1.816425 | −6.922332% |
| open-close-syncmer / miniception / mod | — | 0.153305 | 1.992965 | −15.167299% |
Table 1. Exact and table-listed expected DNA minimizer densities at over . Exact values denote integer charged contexts out of .
Structural Novelty vs. Binary Lifting. Our cold-start permutation w12_k5_4ary.gm achieves active 5-mers (307 non-zero charged ranks and 7 zero-charge prefix ranks: 272, 300, 304, 305, 307, 308, and 310, with all 710 ranks forming a 12-walk-free subgraph), shrinking the active UHS footprint by 29.91% compared to k5-w12-13.txt (). Across all three binary partitions of (AC|GT, AG|CT, AT|GC), 32/32 high-bit blocks are broken (0/32 contiguous intervals). Minimizing Hamming distance across all 48 density-preserving DNA 5-mer symmetries ( base relabelings string orientations), at least 1,020/1,024 ranks differ from k5-w12-13.txt and 1,021/1,024 differ from w12_k5.gm, with near-zero Kendall correlations ( and ).
Independent Verification, Storage Cost, and Limitations
All results were independently reproduced by a standalone Python 3 standard-library verifier (check_w12_k5.py) implementing two independent exact transfer-matrix DPs: the -vertex endpoint DP of Theorem 1 yielding 1,110,221,817 prefix plus 1,124,067,798 suffix equals 2,234,289,615 total charged contexts, and an -edge sparse DP matching bit-for-bit; window-change splitting alternatively yields 1,197,205,696 + 1,037,083,919 = 2,234,289,615. Direct sliding-window Monte Carlo simulation using the OrensteinLab/10-minimizers evaluator (n_samples = , seed = 0) yields 0.13004324 vs. 0.13076974 for k5-w12-13.txt (−0.55555%) and 0.13089784 for w12_k5.gm (−0.65287%); an independent 20,000,001-window simulation yields 2,601,023/20,000,001 = 0.13005114 ().
Artifact Checksums, Ancillary Files, and Scope. The explicit order is released in standard .gm format (w12_k5_4ary.gm, 8,200 bytes) and companion CSV (w12_k5_4ary.csv, 15,205 bytes), requiring 1,280 bytes when bit-packed at 10 bits/rank:
w12_k5_4ary.gm (8,200 bytes, SHA-256): 4a65f48881e7c16ac855f558f4420cef5bce1deee6d5416c71faecda0482e2cf
w12_k5_4ary.csv (15,205 bytes, SHA-256): 384f44080f7a777b84a7eb8398e1939571288368d57abbf0a43a888db55e41b1
Both rank tables (w12_k5_4ary.gm, w12_k5_4ary.csv; CC BY 4.0), the Python 3 standard-library verifier (check_w12_k5.py), the cold-start C99 optimizer sources (setcover_4ary.c, opt_4ary_fast.c, exact_lns_insert.c; MIT), and documentation (README.txt) are included as ancillary files with this submission. This is not a constant-space scheme, and global optimality over all permutations is not claimed; claims are restricted strictly to expected i.i.d. uniform DNA density under leftmost tie-breaking at .
References
- [1]M. Roberts, W. Hayes, B. R. Hunt, S. M. Mount, and J. A. Yorke. Reducing storage requirements for biological sequence comparison. Bioinformatics, 20(18):3363–3369, 2004.pubmed.ncbi.nlm.nih.gov/15256412
- [2]G. Marçais, D. Pellow, D. Bork, Y. Orenstein, R. Shamir, and C. Kingsford. Improving the performance of minimizers and winnowing schemes. Bioinformatics, 33(14):i110–i117, 2017.DOI
- [3]S. Golan, I. Tziony, M. Kraus, Y. Orenstein, and A. Shur. GreedyMini: Generating low-density DNA minimizers. Bioinformatics, 41(Supplement_1):i275–i283, 2025.DOI
- [4]R. Groot Koerkamp, Y. Liu, and G. E. Pibiri. The open-closed mod-minimizer: an asymptotically optimal minimizer scheme. Algorithms for Molecular Biology, 2025.
- [5]A. Shur, I. Tziony, and Y. Orenstein. Generating minimum-density minimizers. bioRxiv, doi:10.64898/2026.01.25.701585v1, 2026. Exact solver and regular-language formulation in A. Shur, On minimizers of minimum density, arXiv:2506.05277, 2025.
- [6]A. Shur, I. Tziony, and Y. Orenstein. 10-Minimizers: A promising class of constant-space minimizers. In Workshop on Algorithms in Bioinformatics (WABI 2026), LIPIcs, 2026.DOI