Abstract
String synchronizing sets are a fundamental tool for achieving local consistency in string processing. We present a time-optimal algorithm for constructing these sets in the word RAM model. By employing sublinear restricted recompression and a novel framework for processing sparse integer sequences, we achieve $O(n \log \sigma / \log n)$ preprocessing time and $O((n \log \tau) / (\tau \log n))$ construction time for any $\tau \in [1..n]$. Our construction yields a compact, fully indexable dictionary supporting optimal rank and select queries.
Introduction
In modern string algorithms, such as those used in bioinformatics or data compression, "local consistency" is a vital principle. It involves selecting a small set of representative positions—anchors—based on their short surrounding contexts. This ensures that identical substrings are handled consistently across a larger text. String synchronizing sets, introduced by Kempa and Kociumaka (STOC 2019), provide a robust mechanism for this: a $\tau$-synchronizing set ensures that at least one anchor is selected in every window of length $\tau$, resulting in $O(n/\tau)$ anchors.
While influential, previous construction methods were limited by linear-time preprocessing or were only efficient for very small $\tau$. This paper addresses the challenge of achieving information-theoretic optimality in the word RAM model, where multiple characters can be packed into a single machine word.
Methodology: Achieving Sublinear Efficiency
To surpass the $O(n)$ bottleneck, the algorithm integrates advanced parsing techniques with computation on compressed data.
Sublinear Restricted Recompression
The core of the approach is "restricted recompression," a parsing scheme that iteratively groups characters. In the word RAM model with word size $w = \Theta(\log n)$, the algorithm packs multiple characters into machine words. This allows the initial rounds of parsing, which examine short contexts, to be simulated in sublinear time.
As shown in the figure above, individual characters are merged into larger blocks (e.g., AB, AC), effectively reducing the number of elements to process in subsequent steps. This iterative factorization is key to maintaining efficiency.
Sparse Encodings and Transducers
A major innovation is the use of a custom variable-length encoding (based on Elias-$\gamma$ codes) to represent the sparse synchronizing set. Standard bitmasks are inefficient because writing out long runs of zeros takes time proportional to the string length $n$. Instead, the authors design finite-state transducers that operate directly on the compressed sequences. These transducers use precomputed lookup tables to "jump" over zeros, ensuring the construction time scales with the information-theoretic size of the output, $O((n \log \tau) / (\tau \log n))$, rather than $n$.
Deterministic van Emde Boas Trees
To ensure the compressed output is queryable, the authors provide a deterministic, linear-time construction for an optimal variant of van Emde Boas trees. This replaces the randomized components typically found in such structures, providing guaranteed performance for rank and select queries.
Key Results
The proposed framework achieves several theoretical milestones:
- Optimal Preprocessing: Preprocessing any string $T \in [0..\sigma)^n$ takes $O(n \log \sigma / \log n)$ time.
- Optimal Construction: For any $\tau$, the synchronizing set is built in $O((n \log \tau) / (\tau \log n))$ time.
- High-Performance Queries: The resulting data structure supports
selectqueries in $O(1)$ time andrankqueries in $O(\log(\frac{\log \tau}{\log \log n}))$ time, matching unconditional cell-probe lower bounds.
Conclusion
This work establishes the theoretical limits for constructing string synchronizing sets. By treating short strings as packed integers and computing directly on sparse encodings, the authors provide a framework that is both time- and space-optimal. While the complexity of the bitwise operations and lookup tables may pose implementation challenges, the general techniques for processing sparse sequences are likely to find broad application in other areas of string processing and data structures.
Summary updated