Skip to content

Constant-Time Inverse Suffix Array Queries in Compact Space and Sublinear-Time Construction of Suffix Array Indexes

Dominik Kempa, Tomasz Kociumaka

cs.DSarXiv:2608.19123

Abstract

For a text T∈[0..σ)n with 2≤σ≤ n, its suffix array orders the suffix starting positions lexicographically, while its inverse suffix array maps each position to its suffix's rank. Since compressed suffix arrays and FM-indexes appeared in 2000, a central goal has been to support both queries in O(nσ) bits. Thankachan recently reduced inverse suffix array query time to O( n/σ), but constant time remained open. We give the first inverse suffix array structure with optimal space and query time: O(nσ) bits and O(1) time. For binary texts, this unconditionally separates the two queries for deterministic structures, since every O(n)-bit suffix array structure in the cell-probe model with Θ( n)-bit cells has worst-case query time Ω( n/ n). Construction is a second challenge: linear time can take Θ(σ n) times as long as reading the input or writing a compact index. Previously, sublinear construction was known for only one such index supporting both queries. In the word RAM with Θ( n)-bit words, we deterministically construct the new structure and two suffix array families from the packed text in O(n(1,σ/ n)) time. For B≥2, the first family uses O(nσ(1+Bσn)) bits and has query time O(B(1+Bσn)), whereas the second uses O(Bnσ(1+Bσn)) bits and has query time O(1+Bσn). Each has peak preprocessing space bounded by its index size. For binary texts, the second family matches the deterministic cell-probe time-space lower bound whenever B≥( n)Ω(1), and, outside the slowest-query regimes, improving the deterministic construction time to o(n/ n) would yield an equally fast Dictionary Matching algorithm.

Create a lesson