arXiv:2610.35543cs.DSOct 2026

Manuscript Offprint

arXiv:2610.35543

Tiny Suffix Arrays

Sharma V. Thankachan

Abstract

Suffix array and inverse suffix array queries on a text of length nn can be answered in O~(τ3)\widetilde{O}(\tau^{3}) time using an auxiliary data structure occupying O(n/τ)O(n/\tau) words, for any τ∈[1,n]\tau \in [1, n].

1 Introduction

Let T[0…n)T[0 \ldots n) be a text over an ordered alphabet of size σ≤n\sigma \leq n. Without loss of generality, we assume that the alphabet is {0,1,…,σ−1}\{0,1,\ldots,\sigma-1\} and that TT is terminated by a unique sentinel character \(corresponding to 0), which is lexicographically smaller than all other characters. The suffix array (SA) of TT is a permutation of [0…n)[0 \ldots n) that lists the starting positions of all suffixes of TT in lexicographic order. The inverse suffix array (ISA) is the inverse permutation of SA, i.e., SA[i]=jSA[i] = j if and only if ISA[j]=iISA[j] = i. For example, for T[0…7)=bananaT[0 \ldots 7) = \text{banana}, we have SA=[6,5,3,1,0,4,2]SA = [6,5,3,1,0,4,2] and ISA=[4,3,6,2,5,1,0]ISA = [4,3,6,2,5,1,0]. These fundamental data structures form the basis of numerous algorithms in string processing, data compression, bioinformatics, and full-text indexing [19, 24, 31].

Storing SA and ISA explicitly requires Θ(nlog⁡n)\Theta(n \log n) bits each, whereas the text itself can be represented in only n⌈log⁡σ⌉n \lceil \log \sigma \rceil bits. This difference is particularly significant for small alphabets (e.g., DNA sequences), where the space occupied by these structures can be substantially larger than that of the text. A major breakthrough in addressing this problem came with the introduction of the Compressed Suffix Array (CSA) [18] and the FM-index [12], which showed that SA and ISA queries can be supported in O~(1)\tilde{O}(1) time using only O(nlog⁡σ)O(n \log \sigma) bits, where O~\tilde{O} hides polylogarithmic factors in nn. These foundational results initiated an extensive line of research, leading to several breakthroughs, including compressed suffix trees, entropy-compressed representations, and repetitiveness-aware representations [3, 11, 17, 15, 20, 22, 26, 21, 28, 27] of these fundamental data structures. Despite these remarkable advances, all such representations require Ω(nlog⁡σ)\Omega(n \log \sigma) bits in the worst case. In fact, this is an information-theoretic lower bound for representing either SA or ISA, since the text can be reconstructed from either permutation together with the frequency of each character. Thus, the space occupied by the text itself represents a fundamental barrier to space-efficient encodings of the SA and ISA. When the text is available, however, we can focus exclusively on the auxiliary space required to encode these arrays. This leads to the following natural problem:

Design a data structure within a prescribed space budget that efficiently supports SA and ISA queries, given read-only access to the underlying text.

Several related problems have been studied under a bounded auxiliary-space budget of O(n/τ)O(n/\tau) words, for a tradeoff parameter τ≥1\tau \geq 1. In particular, Bille et al. [6] showed that longest common extension (LCE) queries can be supported deterministically in O(τ2)O(\tau^2) time using O(n/τ)O(n/\tau) words of auxiliary space. Subsequently, Bille et al. [5] improved the query time to O(τ)O(\tau) while retaining the same space bound. Further results on LCE queries and their efficient construction were obtained by Tanimura et al. [29], Birenzwige et al. [7], and Kosolobov and Sivukhin [23]. Related results on sparse suffix-tree construction under small space constraints were obtained by Gawrychowski and Kociumaka [16] and Kosolobov and Sivukhin [23]. Meanwhile, significant progress has been made in text indexing under small auxiliary-space budgets. Bathie et al. [2] developed a data structure for internal pattern matching using O~(n/τ)\tilde{O}(n/\tau) words of auxiliary space, supporting queries in O(τ+log⁡nlog⁡3log⁡n)O(\tau + \log n \log^3 \log n) time. In a breakthrough result, Bibbens, Borevitz, and McCauley [4] developed a text index based on function inversion [13] that occupies O(n/τ)O(n/\tau) words of auxiliary space and reports all occ occurrences of a pattern of length mm in O~(m+τ4+τ3⋅occ)\tilde{O}(m + \tau^4 + \tau^3 \cdot occ) time. Subsequently, Charalampopoulos et al. [8] improved the query time to O~(m+τ3/m2+(1+τ2/m)⋅occ)\tilde{O}(m + \tau^3/m^2 + (1 + \tau^2/m) \cdot occ) while retaining the same space bound. 1^1

A step toward supporting SA and ISA queries in small auxiliary space was taken in recent work by Thankachan [30], where it was shown that SA, ISA, and several fundamental suffix-tree operations can be supported in polylogarithmic time using O(nlog⁡log⁡log⁡σ)O(n \log \log \log \sigma) bits of auxiliary space, where σ\sigma is the alphabet size. However, this bound remains linear in nn up to an alphabet-dependent factor. To the best of our knowledge, no prior work establishes a general time-space tradeoff for supporting both SA and ISA queries using O(n/τ)O(n/\tau) words of auxiliary space for an arbitrary parameter τ≥1\tau \geq 1. We obtain the following result.

Theorem 1.1. Let T[0..n)T[0..n) be a text over an ordered alphabet of size σ≤n\sigma \leq n, accessible through a read-only oracle supporting character access in constant time. For any integer 1≤τ≤n1 \leq \tau \leq n, there exists an auxiliary data structure occupying O(n/τ)O(n/\tau) words that supports both suffix array (SA) and inverse suffix array (ISA) queries in O~(τ3)\tilde{O}(\tau^3) time.

References (25)