---
title: Deterministic Wheeler Graphs
url: https://www.emergentmind.com/topics/deterministic-wheeler-graphs
type: topic
---

# Deterministic Wheeler Graphs

Searching arXiv for recent papers on deterministic Wheeler graphs and Wheeler DFAs.
Deterministic Wheeler graphs are edge-labeled directed graphs whose vertices admit a total order compatible with edge labels in a Burrows–Wheeler–like manner. In automata-theoretic form, they are deterministic finite automata whose transition graph satisfies the Wheeler axioms, yielding a co-lexicographic organization of states and intervals that behave analogously to suffix-array intervals on strings. This structure places deterministic Wheeler graphs at the intersection of formal language theory, compressed indexing, and graph-based pattern matching, and underlies a body of work on exact search, matching statistics, minimization, pangenome indexing, and combinatorial problems such as \(k\)-mer counting [2002.10303], [2301.05338], [2607.02113].

## 1. Definition and ordering structure

Let \(\Sigma\) be a finite alphabet equipped with a total order. A Wheeler graph is a finite directed edge-labeled graph \(G=(V,E,\lambda)\) for which there exists a total order \(<\) on \(V\) satisfying the Wheeler conditions: if two edges have labels \(a\prec a'\), then their target vertices are ordered accordingly; if the labels are equal and the source of one edge precedes the source of the other, then the same monotonicity is inherited by the targets. In one standard formulation, if \(e_1=(u_1\to v_1,\text{ label }a)\) and \(e_2=(u_2\to v_2,\text{ label }a')\), then \(a\prec a'\Rightarrow v_1<v_2\), and \(a=a'\) with \(u_1<u_2\Rightarrow v_1\le v_2\) [2606.29405], [2002.10303].

A deterministic Wheeler graph is a Wheeler graph in which no vertex has two outgoing edges carrying the same label. Equivalently, the underlying automaton is a DFA with a partial transition function \(\delta:Q\times\Sigma\to Q\cup\{\bot\}\), a unique start state with no incoming edges, and a total order on states satisfying the same axioms. In state-labeled presentations, every non-start state has a unique incoming label \(\lambda(v)\), a property often called input-consistency and implied by the Wheeler axioms [2002.10303], [2607.07563].

Several equivalent viewpoints coexist. One may define Wheelerness directly on the graph; one may define it on a deterministic automaton; or one may characterize it via co-lexicographic ordering of strings reaching states. In the transducer-oriented treatment, a DFA \(A\) is Wheeler iff the partial order
\[
p <_A q \iff \text{for all } \alpha\in\Sigma^* \text{ reaching } p \text{ and all } \beta\in\Sigma^* \text{ reaching } q,\ \alpha \prec \beta
\]
is in fact a total order [2606.29405]. In deterministic settings this order is particularly rigid: the order is unique whenever it exists, because the sets of strings reaching distinct states are disjoint [2602.07964]. This uniqueness is one of the key structural simplifications distinguishing deterministic Wheeler graphs from the nondeterministic setting.

A central consequence is interval behavior. For every string \(\alpha\), the set of states reachable by \(\alpha\) forms a contiguous interval in Wheeler order; this is the path-coherence property attributed to Gagie et al. 2017 and used throughout the indexing literature [2607.02113]. This interval property is the graph analogue of suffix-array intervals for strings and is the combinatorial basis for FM-index-style search.

## 2. Relation to the Burrows–Wheeler transform

Deterministic Wheeler graphs generalize the Burrows–Wheeler transform from a single text to labeled graphs. In the classical string case, an FM-index relies on the suffix array, the Burrows–Wheeler transform \(\mathrm{BWT}\), a count array \(C\), and rank queries. Backward search maintains an interval \((\ell,r]\) such that after processing a pattern suffix the interval corresponds exactly to the suffixes prefixed by that suffix. The recurrence is
\[
(\ell_{i},r_{i}]
=
\bigl(C[P[i]]+\mathrm{rank}_{P[i]}(\ell_{i-1}),\;
       C[P[i]]+\mathrm{rank}_{P[i]}(r_{i-1})\bigr]
\]
from the initial interval \((0,N]\) [2607.02113].

On a Wheeler DFA, Gagie et al. and later Conte et al. observed that one can define graph analogues of the same ingredients. The ordered state set plays the role of the suffix array; the extremal strings entering each state induce a sequence \(\mathcal K\) of infimum and supremum strings; the \(C\)-array counts how many infimum/supremum blocks begin with letters smaller than a given symbol; and rank/select structures over edge labels support interval refinement [2607.02113]. In the formulation used for deterministic Wheeler automata, the recurrence becomes
\[
(\ell_{0},r_{0}]= (1,n), \qquad
(\ell_{i},r_{i}]
=
\bigl(C[a_i]+\mathrm{rank}_{a_i}(\ell_{i-1}-1),\;
       C[a_i]+\mathrm{rank}_{a_i}(r_{i-1})\bigr].
\]
This is a left-to-right “forward-search” on the pattern, but formally it mirrors string backward search [2607.02113].

The importance of this correspondence is algorithmic rather than merely notational. It means that exact path queries in the graph can be answered by repeatedly updating a state interval, just as exact substring queries are answered by updating a suffix-array interval in an FM-index. The data structure thus inherits the two defining features that made BWT-based indexes effective on strings: compactness and direct search on the compressed representation [2607.02113], [2002.10303].

The I/O behavior, however, also carries over. The classical forward-search/backward-search strategy performs a rank query per pattern character, and in the I/O model this yields \(\Omega(m)\) cache misses in the worst case for a pattern of length \(m\). The recent cache-efficient literature on deterministic Wheeler pangenome graphs addresses precisely this inherited bottleneck [2607.02113].

## 3. Exact pattern matching and matching statistics

The interval structure of deterministic Wheeler graphs supports exact pattern matching in much the same style as the FM-index. Given an interval \([\ell,r]\) of states and a character \(a\), one can compute the interval of all states reachable by an outgoing \(a\)-edge from some state in \([\ell,r]\). In the framework described for Wheeler DFAs, this takes \(O(\log|\Sigma|)\), or \(O(1)\) for constant alphabet, and the interval structure “plays the role of SA-intervals for strings” [2301.05338].

A further extension is the introduction of an LCP array for Wheeler automata. For each state \(u_i\), let \(I_{u_i}\) be the set of backward-read infinite strings reaching it, and define \(\min_i\) and \(\max_i\) as the lexicographically minimum and maximum strings in \(I_{u_i}\). The Wheeler-automaton LCP array has length \(2n-1\) and alternates comparisons \((\min_i,\max_i)\) and \((\max_i,\min_{i+1})\). By Fine–Wilf, each finite LCP value is \(<3n\) or is infinite, and with a succinct RMQ structure one supports \(O(1)\)-time RMQ and \(O(\log n)\) prev-smaller/next-smaller queries [2301.05338].

This LCP array enables a generalization of matching statistics from strings to deterministic Wheeler automata. For a pattern \(P[1..m]\), the objective is to find, for each \(i\), the longest suffix \(P[j..i]\) that labels a path in the automaton together with the corresponding interval of states. The algorithm proceeds exactly as in the string setting of Ohlebusch–Gog–Kügell, but replaces suffix-tree components with forward-search on states and uses the Wheeler-automaton LCP array to jump when extension by the next character fails. The resulting complexity is \(O(m\log n+|\Sigma|)\subseteq O(m\log|\mathcal A|)\) time and \(O(|\mathcal A|)\) words of space, with the LCP/RMQ/PSV/NSV structures taking \(4n+o(n)\) bits [2301.05338].

The significance of this development is that it establishes a first clear step toward suffix-tree-like functionality on labeled graphs. The ingredients listed explicitly in the literature are the state order as an analogue of the suffix array, the Wheeler LCP array as an analogue of string LCP, and constant-time RMQ together with \(O(\log n)\) PSV/NSV [2301.05338]. This suggests that a substantial part of compressed suffix-tree methodology may be transportable to the deterministic Wheeler setting, although full navigation primitives remain outside the present corpus.

## 4. Minimization, canonical forms, and language-theoretic characterization

Deterministic Wheeler graphs are not only indexable objects but also a language-theoretic subclass of DFAs. A language is Wheeler if it is recognized by some Wheeler graph, and the foundational characterization is a Wheeler version of Myhill–Nerode. For a language \(L\subseteq\Sigma^*\), one refines the usual right congruence \(\equiv_L\) on prefixes into a convex, input-consistent relation \(\equiv_L^c\) by requiring that equivalent prefixes end in the same letter and that every prefix between them in co-lex order belongs to the same equivalence class. The Wheeler Myhill–Nerode theorem states that the following are equivalent: \(L\) is recognized by some WNFA; \(\equiv_L^c\) has finite index; \(L\) is a union of classes of some finite-index convex, input-consistent, right-invariant equivalence; and \(L\) is recognized by a WDFA [2002.10303].

This theorem gives both a recognition criterion for Wheeler languages and a route to construction. It also shows that determinization behaves unusually well: if \(A\) is a WNFA with \(n\) states, then its determinization \(A^d\), whose states are intervals \(I_\alpha=\delta(s,\alpha)\), is a WDFA with at most \(2n-1-|\Sigma|\) states [2002.10303]. In the deterministic hierarchy, minimization is further sharpened by convexity constraints.

Two complementary minimization theories appear in the recent literature. The first is phrased in terms of convex refinements of Myhill–Nerode classes. For a Wheeler language \(L\), the quotient automaton on the classes of \(\equiv_L^c\) is a deterministic Wheeler DFA recognizing \(L\) and minimal among Wheeler DFAs for \(L\) [2606.29405]. The second is phrased through Wheeler bisimulations. Standard bisimulation does not preserve the relevant convex order structure, so Wheeler bisimulations impose additional convexity-preservation conditions: images and preimages of convex sets must remain convex. The largest reflexive Wheeler autobisimulation induces a quotient \(G/\!\equiv\) that is again a Wheeler DFA, and any two minimal Wheeler DFAs for the same language are isomorphic [2602.07964]. In the deterministic case, this retrieves the minimum Wheeler deterministic automaton of a given language [2602.07964].

Algorithmically, the deterministic case supports particularly strong results. Given a Wheeler DFA with \(n\) states and \(m\) edges, its quotient by the largest Wheeler autobisimulation can be constructed in \(O(m)\) time, assuming edge labels can be radix-sorted from an integer range \(\le m\) [2602.07964]. The algorithm marks equivalence-class boundaries via a bit-vector \(B\), initializes boundaries using local tests on outgoing labels and finality, and then propagates distinctions along carefully selected predecessor positions. A matching \(\Omega(m\log m)\) lower bound holds in the pure comparison model [2602.07964].

A distinct but related problem is to compute the minimum Wheeler DFA from an ordinary minimum DFA recognizing a Wheeler language. For general DFAs, a recent algorithm builds the minimum equivalent Wheeler DFA in \(O(m_w\log m_w)\) time, where \(m_w\) is the number of transitions of the output automaton [2607.07563]. The method starts from a spanning tree, co-lex sorts root-to-node paths to obtain an initial Wheeler subgraph, and then incrementally inserts the remaining transitions by redirecting, splitting, or cloning states while maintaining the Wheeler order and language equivalence. When the input language is not Wheeler, the process does not terminate with an empty pending set, thereby witnessing non-Wheelerness [2607.07563].

Closure properties differentiate Wheeler languages from regular languages in familiar ways. Deterministic Wheeler languages are closed under intersection, but not under arbitrary union or complement; they are not closed under general concatenation or Kleene star; and they are closed under certain inverse images preserving co-lex monotonicity, such as inverse images of deterministic Wheeler transductions in the transducer setting [2002.10303], [2606.29405]. The literature repeatedly emphasizes that the complexity of deciding whether an arbitrary regular language is equivalent to some Wheeler DFA remains open [2606.29405].

## 5. Cache-efficient indexing and pangenome pattern matching

The most recent algorithmic development for deterministic Wheeler graphs addresses the high cache-miss rate of FM-style forward search on Wheeler DFAs. The Graph Suffix Array (Gr-SA) is designed specifically for deterministic Wheeler automata and mimics suffix-array pattern location by combining binary search with sequential scans [2607.02113].

The key primitive is the suffix-match oracle
\[
SM(\alpha)\longrightarrow ]i,j[
\subseteq \{0,1,\dots,2n+1\},
\]
which locates in co-lex order the maximal open interval of the implicit sequence \(\mathcal K\) whose entries are all suffixed by \(\alpha\). Since \(\mathcal K\) is represented implicitly by two pseudoforests, one for all \(\inf I_u\) and one for all \(\sup I_u\), a comparison between \(\alpha\) and one of these extremal strings is implemented by walking backward along a heavy-light decomposition of the corresponding pseudotree, costing
\[
O\Bigl(\tfrac{|\alpha|}{B}+\log n\Bigr)
\]
cache misses per walk. A binary search over \([1,2n]\) adds another \(\log n\) factor, so a call to \(SM(\alpha)\) costs
\[
O\bigl((\tfrac{|\alpha|}{B}+\log n)\log n\bigr)
\]
I/Os [2607.02113].

Pattern location in Gr-SA is organized in three phases for an input \(\alpha=\beta\,a\,\gamma\). Phase 1 uses \(\log m\) calls to \(SM\) to find the longest prefix \(\beta\) such that \(\widetilde T(\beta)\neq\emptyset\). Phase 2 checks whether \(\widetilde T(\beta a)\neq\emptyset\), identifies the unique candidate state \(u\), and verifies via rank/select on the Wheeler-NFA representation whether some state in \(T(\beta)\) has an \(a\)-transition. Phase 3 decomposes the automaton into maximal unary paths and traverses the remaining suffix \(\gamma\) by sequentially scanning those paths in memory, costing \(|\gamma|/B\) plus \(d\) random jumps between paths [2607.02113].

The resulting I/O bound is explicit. For a WDFA \(\mathcal D\) with \(n\) states and a pattern \(\alpha\) of length \(m\), there is a data structure of \(O(|\mathcal D|)\) RAM words supporting locate/count in
\[
O\bigl((\tfrac{m}{B}+\log n)\log n\log m + d\bigr)
\]
I/Os, where \(d\) is the number of unary paths traversed in the sequential-scan phase. If one only needs to know whether \(\alpha\) occurs at least twice, a single suffix-match call suffices, giving
\[
O\bigl((\tfrac{m}{B}+\log n)\log n\bigr)
\]
I/Os using \(O(n)\) words of space [2607.02113].

The empirical evaluation was carried out on real-world Wheeler pangenome graphs derived from Finnish-subset human chromosomes 21 and 14. The WDFA for chromosome 21 has \(n=3.85\times 10^7\) states and \(|\delta|=3.88\times 10^7\) transitions; chromosome 14 has \(n=9.44\times 10^7\) states and \(|\delta|=9.47\times 10^7\) transitions. Both are extremely sparse, with average out-degree \(\lesssim 1.01\) [2607.02113].

| Graph | Forward-search space | Gr-SA space |
|---|---:|---:|
| Chr 21 | \(\approx 38\) MB | \(\approx 529\) MB |
| Chr 14 | \(\approx 93\) MB | \(\approx 1\,375\) MB |

The space blow-up is approximately \(13.9\times\) on chromosome 21 and \(14.8\times\) on chromosome 14. The performance gain, however, is much larger. Over \(10^4\) random patterns of length \(10^3\) or \(10^4\) drawn from the graph, average time per character was \(968\) ns/char for forward search versus \(9.4\) ns/char for Gr-SA on chromosome 21 when \(m=10^3\), and \(977\) ns/char versus \(2.4\) ns/char when \(m=10^4\). On chromosome 14 the corresponding numbers were \(1199\) ns/char versus \(10.0\) ns/char for \(m=10^3\), and \(1193\) ns/char versus \(2.4\) ns/char for \(m=10^4\), reaching a reported speedup of \(501\times\) in the latter case. The implementation was also able to process a single character of the pattern in less than \(3\) ns [2607.02113].

These results do not change the asymptotic compactness frontier of FM-style WDFA indexes, but they show that a different memory-access regime can dominate in practice on sparse pangenome graphs. The paper reports that empirically \(d\ll m\), typically by two orders of magnitude on the tested graphs, so the sequential scans are dominant yet highly cache-friendly [2607.02113].

## 6. Applications, extensions, and open directions

A recurrent application domain is computational pangenomics. Variation graphs built from populations of haplotypes, including graphs formed from all recorded SNPs in dbSNP within a single chromosome, can be prefixed-sorted into a Wheeler order and thereby become WDFAs [2607.02113]. This enables exact graph indexing, construction of minimum Wheeler DFAs from graph-derived DFAs, and direct application of FM-style or cache-efficient search. In experiments on 23 pangenome graphs from the Finnish subset of dbSNP variations for human chromosomes, a recent implementation for constructing minimum Wheeler DFAs from general DFAs achieved throughput of over \(10^5\) transitions per second on a standard workstation; on chromosomes where GCSA terminated, it produced identical WDFA sizes while additionally guaranteeing minimality [2607.07563].

Deterministic Wheeler graphs also support graph-combinatorial tasks that are hard in general graphs. Counting distinct \(k\)-mers is \(\#\)P-hard even on connected deterministic DAGs, but in deterministic Wheeler graphs distinct \(k\)-mers can be counted using \(O(|W|k)\) or \(O(n^4\log k)\) arithmetic operations [2509.22885]. The linear-in-\(k\) method uses dynamic programming over lengths together with the fact that in a deterministic Wheeler graph two consecutive in-neighbors of a vertex can share at most one \((\ell-1)\)-mer, detected via an LCS/RMQ structure on infimum and supremum strings. The same work shows how to represent the de Bruijn graph of the \(k\)-mers in time \(O(|dBg|+|W|k)\) and space
\[
O\bigl(|dBg| + |W|k\log(\max_{1\le \ell \le k}(n_\ell))\bigr)
\]
bits [2509.22885].

Beyond pure automata, the Wheeler paradigm has been extended to sequential transducers. Sequential Wheeler transducers combine a Wheeler automaton with a monotonicity requirement on outputs; they are closed under composition, and Wheeler languages are closed under inverse images of Wheeler transductions [2606.29405]. For the automaton-only setting, this places deterministic Wheeler graphs inside a broader structural theory rather than treating them solely as indexes.

Several limitations and open problems remain explicit in the literature. Arbitrary union does not preserve Wheelerness, nor do complement, unrestricted concatenation, factors, suffixes, or inversion in general [2002.10303]. The Wheeler-realizability problem for regular languages remains open in the formulations summarized in the transducer paper, while for arbitrary NFAs the corresponding decision and construction problems are substantially harder, including PSPACE-hardness for building a minimum Wheeler automaton from a nondeterministic input [2606.29405], [2607.07563]. The transducer-oriented literature also identifies open directions concerning logical characterizations, bounded co-lex width, and nondeterministic extensions [2606.29405].

Taken together, these results situate deterministic Wheeler graphs as a robust subclass of labeled deterministic automata with three simultaneous properties: a canonical state order, strong interval regularity for pattern matching, and a nontrivial minimization theory. This suggests a unifying role for deterministic Wheeler graphs in compressed indexing and formal-language structure, particularly where graph-shaped references must support exact search at scale.

Source: https://www.emergentmind.com/topics/deterministic-wheeler-graphs