Optimal Wheeler Language Recognition

Ruben Becker, Davide Cenzato, Sung-Hwan Kim, Bojana Kodric, Alberto Policriti, Nicola Prezza · DOI

Introduction

In the fields of string processing and bioinformatics, Wheeler automata represent a powerful generalization of the Burrows-Wheeler Transform (BWT) to complex graphs. These automata are highly valued for their ability to support extremely efficient indexing and pattern matching. A regular language is classified as a "Wheeler language" if it can be recognized by at least one Wheeler automaton.

Despite their utility, identifying whether a given regular language—represented by its deterministic finite automaton (DFA)—is a Wheeler language has historically been a significant computational challenge. The primary difficulty arises because the minimum DFA of a language may not satisfy Wheeler properties even if the language itself is Wheeler. Prior to this research, the best known polynomial-time algorithm for this recognition problem had a complexity of $O(n^{13} + m \log n)$, a bound that rendered the approach impractical for any real-world application.

The Algorithmic Breakthrough

This paper introduces a novel, optimal algorithm that reduces the complexity of Wheeler language recognition to $O(mn)$. The authors achieve this by shifting the focus to a structural property they term "entanglement."

The proposed method follows a streamlined three-step process:

  1. Square Automaton Construction: The algorithm constructs a "square automaton" ($A_{min} \times A_{min}$), representing pairs of states from the language's minimum DFA.
  2. Interval-Based Pruning: The researchers utilize "co-lexicographic intervals"—ranges representing the sorted order of all strings reaching a specific state. The square automaton is then pruned to include only pairs of distinct states whose string intervals intersect.
  3. Acyclicity Testing: The authors prove a fundamental new characterization: a language is Wheeler if and only if this pruned square automaton is acyclic.

By parameterizing the complexity with the co-lex width ($p$), the running time is refined to $O(mp + m \log n)$. Given that $p \le n$, the algorithm maintains a worst-case quadratic bound of $O(mn)$.

Theoretical Optimality and SETH

A key contribution of this work is the proof of optimality. By providing a lower bound based on the Strong Exponential Time Hypothesis (SETH), the authors demonstrate that no "strongly subquadratic" algorithm (faster than $O(m^{2-\eta})$) is likely to exist for this problem. This effectively "closes" the algorithmic challenge for DFAs, providing a rare instance of a problem where the upper and lower bounds are tightly matched.

Empirical Validation

The authors validated their theoretical findings through extensive testing on synthetic datasets:

  • Random DFAs: Tests on DFAs with varying states ($n$) and transitions ($m$) confirmed the quadratic growth of the algorithm's execution time.
  • Variable Width Analysis: By testing DFAs with fixed transitions but varying co-lex widths ($p$), the researchers verified the parameterized efficiency of the $O(mp)$ approach.

The results showed that the algorithm is fast enough to process DFAs with tens of thousands of states, a massive leap from the previous $O(n^{13})$ state-of-the-art. The authors have released a proof-of-concept implementation to the public to facilitate further research and practical application.

Limitations and Future Directions

While the recognition problem is now solved for DFAs, the authors note a significant complexity gap when dealing with Non-deterministic Finite Automata (NFAs). The problem remains PSPACE-complete in the NFA case, suggesting that the initial representation of the language is critical to the feasibility of recognition.

Future work may explore whether similar "Wheeler-like" properties can be identified in more expressive language classes, such as context-free languages, which could have broader implications for computational linguistics and advanced data compression.

Summary updated

BibTeX
@inproceedings{becker2023optimal,
  author = {Ruben Becker and Davide Cenzato and Sung-Hwan Kim and Bojana Kodric and Alberto Policriti and Nicola Prezza},
  title = {{Optimal Wheeler Language Recognition}},
  booktitle = {SPIRE},
  year = {2023},
  doi = {10.1007/978-3-031-43980-3\_6},
}
Figure