English

Time-Optimal Construction of String Synchronizing Sets

Data Structures and Algorithms 2026-02-13 v1

Abstract

A key principle in string processing is local consistency: using short contexts to handle matching fragments of a string consistently. String synchronizing sets [Kempa, Kociumaka; STOC 2019] are an influential instantiation of this principle. A τ\tau-synchronizing set of a length-nn string is a set of O(n/τ)O(n/\tau) positions, chosen via their length-2τ2\tau contexts, such that (outside highly periodic regions) at least one position in every length-τ\tau window is selected. Among their applications are faster algorithms for data compression, text indexing, and string similarity in the word RAM model. We show how to preprocess any string T[0..σ)nT \in [0..\sigma)^n in O(nlogσ/logn)O(n\log\sigma/\log n) time so that, for any τ[1..n]\tau\in[1..n], a τ\tau-synchronizing set of TT can be constructed in O((nlogτ)/(τlogn))O((n\log\tau)/(\tau\log n)) time. Both bounds are optimal in the word RAM model with word size w=Θ(logn)w=\Theta(\log n). Previously, the construction time was O(n/τ)O(n/\tau), either after an O(n)O(n)-time preprocessing [Kociumaka, Radoszewski, Rytter, Wale\'n; SICOMP 2024], or without preprocessing if τ<0.2logσn\tau<0.2\log_\sigma n [Kempa, Kociumaka; STOC 2019]. A simple version of our method outputs the set as a sorted list in O(n/τ)O(n/\tau) time, or as a bitmask in O(n/logn)O(n/\log n) time. Our optimal construction produces a compact fully indexable dictionary, supporting select queries in O(1)O(1) time and rank queries in O(log(logτloglogn))O(\log(\tfrac{\log\tau}{\log\log n})) time, matching unconditional cell-probe lower bounds for τn1Ω(1)\tau\le n^{1-\Omega(1)}. We achieve this via a new framework for processing sparse integer sequences in a custom variable-length encoding. For rank and select queries, we augment the optimal variant of van Emde Boas trees [P\u{a}tra\c{s}cu, Thorup; STOC 2006] with a deterministic linear-time construction. The above query-time guarantees hold after preprocessing time proportional to the encoding size (in words).

Keywords

Cite

@article{arxiv.2602.11324,
  title  = {Time-Optimal Construction of String Synchronizing Sets},
  author = {Jonas Ellert and Tomasz Kociumaka},
  journal= {arXiv preprint arXiv:2602.11324},
  year   = {2026}
}

Comments

Full version of a work to appear in the proceedings of STACS 2026. The abstract has been abridged to comply with arXiv format requirements

R2 v1 2026-07-01T10:32:38.331Z