Covering Sequences by Selective Cycle Joining

A de Bruijn sequence is a circular binary string of length $2^n$ in which every $n$-bit pattern appears exactly once as a window. A covering sequence relaxes this. Every $n$-bit pattern only needs to lie within a few errors of some window, so the sequence can be far shorter. Such strings are useful as compact universal probe sets: any query pattern has a near match somewhere in a short, cheaply generated string.

The proposal is to build covering sequences from shift registers instead of from linear codes. A shift register with a non-primitive feedback polynomial splits its states into many disjoint cycles, and existing cycle-joining machinery shows how to merge cycles into one sequence. Prior work merges all of them. We propose to merge only a well-chosen subset. Merging leaves the set of states unchanged, so the resulting sequence's windows are exactly the states of the chosen cycles. Its length is the total size of those cycles. The design problem therefore becomes a combinatorial optimization: pick a connected set of cycles whose states form a covering code of radius $R$, at minimum total size.

Approximate string matching plays two roles here. It supplies the coverage objective, and it does the verification. That second role becomes essential once coverage is measured in edit distance rather than Hamming distance. Edit distance allows insertions and deletions, and no prior covering-sequence work handles it.

Background and Gap

The cycle adjacency graph is the mechanism. A linear feedback shift register (LFSR) updates an $n$-bit state by shifting and appending a linear function of the bits. When its characteristic polynomial is composite, the state space breaks into disjoint cycles. The cycle adjacency graph has one vertex per cycle. Two cycles are linked by an edge when they contain a conjugate pair: two states that differ only in one designated bit. Swapping the two states' successors splices the cycles into one.

Chang and coauthors give the tools for computing these cycles and the graph's edges without brute force:

All of these use a spanning tree, one that touches every cycle, because they want full de Bruijn sequences. We reuse their machinery but replace the spanning tree with a covering-constrained connected subgraph.

The motivating work is On de Bruijn Covering Sequences and Arrays. It builds Hamming-radius covering sequences from maximum-length sequences, their complements, cyclic covering codes, and interleaving. It reports length 1430 for $n=13$, $R=1$, down from the previous 2937. That paper also leaves several things open:

  • Its best bounds are non-constructive.
  • Its constructions are tuned to the binary alphabet.
  • It does not treat insertions or deletions.
  • It never uses cycle structures of composite polynomials.

Linear-code constructions are restricted to window sets that are subspaces or a few cosets. Selective cycle joining allows any union of register cycles, including unions that are not subspaces, while keeping a compact successor rule for generation.

Core Claim

Let $f$ be a degree-$n$ polynomial with distinct irreducible factors, and let $\mathcal{C}=\{C_1,\dots,C_m\}$ be its cycles. A connected set $S\subseteq\mathcal{C}$ in the cycle adjacency graph yields, by successive conjugate swaps inside $S$, a single cycle whose window set is $\bigcup_{C\in S} C$. We therefore solve

$$ \min_{S \text{ connected}} \sum_{C\in S}|C| \quad \text{s.t.}\quad \forall x\in\{0,1\}^n\ \exists\, y\in \textstyle\bigcup_{C\in S} C:\ d(x,y)\le R, $$

where $d$ is either Hamming distance or the parameterized edit distance $ED_a$. In $ED_a$, substitutions cost $1/a$ and insertions or deletions cost 1, following An Algorithmic Bridge Between Hamming and Levenshtein Distances. Under edit distance, the windows checked against $x$ may have lengths in $[n-R, n+R]$.

The claim has two parts:

  1. For binary $n\le 20$, optimizing over a family of composite polynomials matches or beats the interleaving and cyclic-code lengths.
  2. The edit-distance version gives strictly shorter sequences than the Hamming version. For equal-length strings, edit distance never exceeds Hamming distance, so the Hamming optimum is always feasible; the open question is the size of the gap.

The sphere-covering bound, a lower bound we compute directly, is $2^{13}/14$. So no Hamming $R=1$ covering sequence of order 13 can be shorter than 586. This leaves room between 586 and 1430.

Research Program

Exact solver for small orders. For orders up to about 16, we enumerate cycles using the factor decomposition, staying with products of distinct irreducibles because repeated roots are expensive by Chang et al.'s own account. We then solve the problem above as an integer program. It combines set-cover constraints with single-commodity flow constraints that enforce connectivity, and the objective is total cycle size, so it is a covering Steiner tree problem. Hamming coverage is precomputed by enumerating balls. Edit coverage is precomputed by running an exact bounded edit-distance matcher of each pattern against each cycle's cyclic string. For this we use the $O(n+k\min(n,ka))$ algorithm of An Algorithmic Bridge Between Hamming and Levenshtein Distances or bit-parallel dynamic programming.

Heuristic for orders 17–20. Here we use greedy weighted set cover over cycles, followed by Steiner repair along cheapest cycle-graph paths and swap-based local search. Candidate covers are pruned with $q$-gram count filtering in the style of Fast Algorithms for Top-k Approximate String Matching.

Polynomial family as a design variable. Different factorizations yield different cycle-size spectra, and the spectrum determines how finely length can be traded for coverage. We also run the same pipeline over $\mathbb{F}_3$ and $\mathbb{F}_4$, with the conjugate-pair definition adjusted. The DNA alphabet of size 4 is the practically relevant case.

Output form. Each solution is emitted as a successor rule: the LFSR feedback plus a short list of swapped conjugate states. A sequence can then be generated with memory proportional to the number of joins rather than to its length.

Baselines

The naive reference point is the full de Bruijn sequence of length $2^n$, which trivially covers at any radius. For $n=13$ its length is 8192, and every method must clear this by a wide margin.

The strongest existing method is the construction set in On de Bruijn Covering Sequences and Arrays: interleaving, cyclic covering codes, and maximum-length sequences with complements. It reports length 1430 at $n=13$, $R=1$. We reimplement it for every $(n, R)$ we test, using the same verification code, so that lengths are compared on equal footing. Beating it means a strictly shorter verified covering sequence at the same $(n,R,q)$. At $n=13$, $R=1$, that means fewer than 1430. For other parameters, no reported result was found on Lacuna, so we report the reimplementation's numbers. For $q>2$ it is the only principled baseline, though that paper does not optimize for $q>2$.

A generic graph-search competitor is also run. It finds a short closed walk in the de Bruijn graph, the graph whose vertices are $n$-bit patterns with an edge for each one-bit shift, that visits a precomputed covering code. The code comes from greedy covering, and the walk comes from a traveling-salesman solver with the same wall-clock budget as our integer program and local search.

Two ablations isolate the key ingredient:

  1. Subspace-only. Restrict $S$ to cycles whose union is an LFSR subspace, approximating the cyclic-code idea inside our pipeline. This tests whether non-subspace unions matter.
  2. Free bridging. Drop the conjugate-pair connectivity constraint and allow arbitrary connecting walks. This measures how much length the cycle-joining structure costs.

Why not just…?

Why not just use the interleaving and cyclic-code constructions? They are the reference to beat. By the original paper's own account, they are tuned to $q=2$ and Hamming distance, and their tightest bounds are non-constructive. Our search contains the subspace case through the subspace-only ablation, so it should never do worse on the polynomials it explores. If it cannot get below 1430 at $n=13$, the honest conclusion is that cycle selection adds nothing for binary Hamming covering, and the contribution narrows to edit distance and larger alphabets.

Why not just find a short covering walk directly in the de Bruijn graph? This is the real threat. It searches a strictly larger space than unions of register cycles, so with unlimited compute it is at least as short. Our bet is practical. Cycle structure shrinks the search from $2^n$ states to $m$ cycles, which keeps exact optimization feasible to roughly order 16. It also yields a compact successor rule rather than a stored string. The free-bridging ablation and the walk baseline, run under the same time budget, measure the length price of this structure. If that price is large at every order, we would recommend the walk method and keep cycles only for generation.

Why not just reuse the Hamming solution, since Hamming covering implies edit covering? It is a valid upper bound, and we report it. Whether insertions and deletions buy real length savings is exactly the edit-distance question no prior covering work addresses. SimSem: Fast Approximate String Matching in Relation to Semantic Category Disambiguation is a cautionary example from a different setting: there, fuzzy matching gave little gain once simpler character features were added to a classifier. A negligible gap between Hamming and edit covering would be the analogous outcome here, and it is a publishable negative result in its own right.

Proposed Experiments

Binary Hamming. For $q=2$, $R\in\{1,2\}$, and $n$ from 8 to 20, we report verified covering length for each method. Alongside, we report the sphere-covering lower bound and solver time. The decisive check is $n=13$, $R=1$ against 1430. Every reported sequence is checked by exhaustive approximate matching of all $q^n$ patterns.

Edit distance. We repeat the experiment under $ED_a$ for $a\in\{1,2\}$. Here the decisive quantity is the ratio of edit-optimal to Hamming-optimal length from the same solver.

Larger alphabets. For $q\in\{3,4\}$ and $n\le 10$, we test whether cycle selection beats the reimplemented cyclic-code constructions. Their source paper concedes that they are least optimized in this setting.

Generation cost. We report successor-rule size, measured as the number of swapped conjugate pairs, against stored sequence length. This tests the compactness argument that justifies preferring cycles over free walks.