Papers
Topics
Authors
Recent
Search
2000 character limit reached

De Bruijn Sequences: Theory and Applications

Updated 29 May 2026
  • De Bruijn sequences are cyclic words over an alphabet where every possible n-length substring appears exactly once, serving as a key combinatorial construct.
  • They are constructed using methods such as Eulerian circuits in de Bruijn graphs, shift-register techniques, greedy algorithms, and Lyndon word concatenation.
  • These sequences have significant applications in coding theory, cryptography, pseudorandomness, and experimental design, with ongoing research into balanced and multi de Bruijn generalizations.

A de Bruijn sequence of order nn over an alphabet Σ\Sigma of size kk is a cyclic word of length knk^n that contains every possible length-nn word over Σ\Sigma exactly once as a contiguous block. De Bruijn sequences possess deep combinatorial, graph-theoretic, and algorithmic structure, with ramifications in coding, cryptography, pseudorandomness, combinatorial design, and experimental pattern generation. This article provides a comprehensive treatment of de Bruijn sequences, encompassing definitions, enumeration, constructions, algorithmic generation, and significant generalizations.

1. Formal Definitions and Basic Properties

A cyclic sequence B=(b0,b1,,bkn1)B = (b_0, b_1, \ldots, b_{k^n-1}) over an alphabet Σ\Sigma of size kk is a de Bruijn sequence of order nn (denoted Σ\Sigma0) if, for every Σ\Sigma1, there exists exactly one Σ\Sigma2 (indices modulo Σ\Sigma3) such that Σ\Sigma4 (Sawada et al., 18 Oct 2025).

De Bruijn sequences can be realized as Eulerian circuits in the de Bruijn graph Σ\Sigma5, whose Σ\Sigma6 vertices correspond to Σ\Sigma7-tuples, and where Σ\Sigma8 is an arc whenever the last Σ\Sigma9 symbols of kk0 match the first kk1 of kk2 (Chen et al., 22 Jan 2025). Each Eulerian cycle spells out a de Bruijn sequence via its sequence of traversed edge labels.

2. Enumeration and Graph Theoretic Viewpoint

The total number of cyclic de Bruijn sequences of order kk3 over a kk4-letter alphabet (up to rotation) is given by

kk5

which is derived via the BEST theorem for Eulerian circuits, combining the number of arborescences and permutations of outgoing arcs at each vertex (Tesler, 2017, Sawada et al., 18 Oct 2025).

Table: de Bruijn Sequence Counts for Selected Parameters

Alphabet Size kk6 Order kk7 Number of Cyclic de Bruijn Sequences
2 3 kk8
2 4 kk9
3 3 knk^n0

This enumeration is central for combinatorial studies and is a touchstone in the intersection of algebraic and graphical approaches.

3. Explicit and Algorithmic Constructions

Graph-Based (Eulerian Tour)

Classic algorithms for de Bruijn sequence generation construct the de Bruijn graph on knk^n1-tuples and generate an Eulerian tour; for practical and random generation, Las Vegas algorithms based on random arborescences are used, achieving expected linear time per symbol after setup (Sawada et al., 18 Oct 2025).

Shift-Register (LFSR) Constructions

Over finite fields, primitive linear feedback shift registers (LFSRs) can generate de Bruijn sequences. For binary alphabets and order knk^n2, a suitable primitive polynomial knk^n3 generates an LFSR with period knk^n4. Appending a knk^n5 symbol yields a sequence of length knk^n6 covering all knk^n7-tuples (Chen et al., 22 Jan 2025).

Greedy Algorithms (Prefer-One, Prefer-Min, Prefer-Max)

The "prefer-one" algorithm (for binary) or its nonbinary generalization (Ford sequence) appends the largest available symbol that does not create a repeated knk^n8-block (Alhakim, 2010). Theoretical advances have established that any preference function of span knk^n9 can generate a de Bruijn sequence if and only if its associated least-preference transition function is acyclic outside a fixed point at nn0, unifying earlier greedy constructions (Alhakim, 2010).

Lyndon Word Concatenation

The Fredricksen-Maiorana construction concatenates all Lyndon words of length dividing nn1 (ordered lexicographically) to form a de Bruijn sequence. This elegant link to Lyndon words underpins efficient enumeration and provides bijections between such sequences and primitive necklaces (Amram et al., 2018).

4. Generalizations and Structural Variants

Balanced and Fixed-Weight

Balanced de Bruijn sequences of even length and order nn2 achieve optimal or near-optimal symbol balance (equal number of nn3's and nn4's); necessary and sufficient conditions for existence are known (Baker et al., 2022). Fixed-weight and weight-range de Bruijn sequences cover constrained subsets of nn5 with precise combinatorial and algorithmic frameworks (Chen et al., 22 Jan 2025).

Adjacency-Hopping (No-Repetition)

Adjacency-hopping de Bruijn sequences (Hnn6) enforce that consecutive symbols differ, and every length-nn7 word with no adjacent repeats appears exactly once. These are realized as Eulerian circuits in a constrained subgraph, and explicit enumeration formulas are known: nn8 Such sequences have unique applications in structured-light vision, providing robust, nonrepetitive coding (Chen et al., 2023).

Multi-Shift and Multi de Bruijn

Multi-shift de Bruijn sequences nn9 generalize window positions, requiring every length-Σ\Sigma0 word to appear at positions congruent to Σ\Sigma1. Enumeration formulas sharply distinguish cases Σ\Sigma2 and Σ\Sigma3 (Xu, 2010). Multi-de Bruijn sequences allow each Σ\Sigma4-mer to appear exactly Σ\Sigma5 times per cycle, with enumeration via extended Burrows–Wheeler transform and Eulerian arguments (Tesler, 2017).

Cut-Down

Cut-down de Bruijn sequences of arbitrary length Σ\Sigma6 contain no repeated length-Σ\Sigma7 cyclic substrings. Recent work provides Σ\Sigma8-time, Σ\Sigma9-space constructions for both binary and B=(b0,b1,,bkn1)B = (b_0, b_1, \ldots, b_{k^n-1})0-ary cut-down sequences (Cameron et al., 2022).

5. Orthogonality, Applications, and Extensions

Orthogonal de Bruijn Sequences

A set of order-B=(b0,b1,,bkn1)B = (b_0, b_1, \ldots, b_{k^n-1})1 de Bruijn sequences is orthogonal if no length-B=(b0,b1,,bkn1)B = (b_0, b_1, \ldots, b_{k^n-1})2 word occurs in more than one member. Tight upper and lower bounds for set size are established, and generalizations to B=(b0,b1,,bkn1)B = (b_0, b_1, \ldots, b_{k^n-1})3-orthogonality and fixed-weight constructions enable applications in synthetic biology and code design (Chen et al., 22 Jan 2025).

Kautz Sequences

Kautz sequences enforce maximal local diversity by requiring no adjacent repeats (run-length one), and are enumerated by

B=(b0,b1,,bkn1)B = (b_0, b_1, \ldots, b_{k^n-1})4

They are essential for coding and network address design with run-length constraints (Chen et al., 22 Jan 2025).

Pseudorandomness, Uniform Distribution, and Experimental Design

De Bruijn sequences with increasing alphabet/order can be used to produce completely uniformly distributed sequences of reals in B=(b0,b1,,bkn1)B = (b_0, b_1, \ldots, b_{k^n-1})5, using Knuth-style constructions or similar schemes with simpler growth conditions (Almansi et al., 2019). In color-encoded structured light systems for vision, de Bruijn sequences and their variants enable window-based indexing and robust error correction (Chen et al., 2023).

6. Algorithmic Efficiency, Discrepancy, and Combinatorial Complexity

Recent advances have produced B=(b0,b1,,bkn1)B = (b_0, b_1, \ldots, b_{k^n-1})6-time, B=(b0,b1,,bkn1)B = (b_0, b_1, \ldots, b_{k^n-1})7-space successor rules even for highly nontrivial constructions (e.g., Prefer-same, Prefer-opposite) (Sala et al., 2020), and random uniform generation with favorable cover-time constants in practical settings (Sawada et al., 18 Oct 2025).

The discrepancy of a binary de Bruijn sequence—maximum imbalance of B=(b0,b1,,bkn1)B = (b_0, b_1, \ldots, b_{k^n-1})8's and B=(b0,b1,,bkn1)B = (b_0, b_1, \ldots, b_{k^n-1})9's in any window—has a tight bound. Any such sequence must have discrepancy at least Σ\Sigma0, and an explicit Σ\Sigma1 algorithm produces sequences exactly achieving this bound; for general Σ\Sigma2 the bound is Σ\Sigma3 (Álvarez et al., 2024).

Preference-function complexity classifies a de Bruijn sequence by the minimal span of memory needed to encode its construction; closed-form formulas yield the number of sequences of each complexity level (Alhakim, 2010).

7. Research Directions and Open Problems

Current research explores further generalizations:

Alternative sequence constructions (e.g., via Zech's logarithms, cycle-joining guided by group or field structure) deepen connectivity between algebraic and combinatorial perspectives (Chang et al., 2017, Zhu et al., 2020).

De Bruijn sequences remain a rich axis for combinatorial, algorithmic, and applied research, with diverse generalizations and efficient realization methods supporting applications from coding theory and cryptography to robotics, vision, and experimental design.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to De Bruijn Sequence.