Space-Efficient Text Indexing for Advanced Counting Queries
Solon P. Pissis, Sharma V. Thankachan
Key points
From the paper's conclusion- We change this situation by proposing a general framework that supports advanced counting queries, denoted by $\phi_T(P)$, provided that $\phi_T$ satisfies two mild conditions: (1) $\phi_T(P)$ is an integer in $[0..|\mathsf{Occ}_T(P)|]$ that can be computed from $\mathsf{Occ}_T(P)$ via sorting; and (2) $\phi_T(Q)\geq\phi_T(P)$ for every prefix $Q$ of $P$.
Abstract
In the classical problem of text indexing, the objective is to preprocess a text $T=T[1..n]$ over an integer alphabet $[0..\sigma)$ into a data structure that supports efficient pattern matching queries. Given a pattern $P=P[1..m]$, a reporting query lists the set $\mathsf{Occ}_T(P)$ of occurrences of $P$ in $T$, whereas a counting query returns $|\mathsf{Occ}_T(P)|$. Space-efficient suffix-tree variants use only $\mathcal{O}(n\log\sigma)$ bits and support reporting queries in $\mathcal{O}(m+|\mathsf{Occ}_T(P)|\cdot\log_{\sigma}^{\epsilon} n)$ time, where $\epsilon>0$ is an arbitrarily small constant, and counting queries in $\mathcal{O}(m)$ time. Notably, space-efficient indexes for more advanced counting queries have largely resisted achieving the same optimal (or near-optimal) query times when using less than $\Theta(n\log n)$ bits. We change this situation by proposing a general framework that supports advanced counting queries, denoted by $\phi_T(P)$, provided that $\phi_T$ satisfies two mild conditions: (1) $\phi_T(P)$ is an integer in $[0..|\mathsf{Occ}_T(P)|]$ that can be computed from $\mathsf{Occ}_T(P)$ via sorting; and (2) $\phi_T(Q)\geq\phi_T(P)$ for every prefix $Q$ of $P$. We show that our framework supports optimal $\mathcal{O}(m)$-time queries using $\mathcal{O}(n\log\sigma+n(\log\log n)^2)$ bits or near-optimal $\mathcal{O}(m\log_{\sigma}^{\epsilon} n)$-time queries using $\mathcal{O}(n\log\sigma)$ bits. As an example, our trade-offs improve upon the classical MAST index for counting non-overlapping occurrences [Apostolico and Preparata, Algorithmica, 1996; Brodal et al., ICALP 2002], which uses $\mathcal{O}(n\log n)$ bits and supports $\mathcal{O}(m)$-time queries, and the recent compact index for the same problem [Bals et al., ESA 2026], which uses $\mathcal{O}(n\log\sigma)$ bits and supports $\mathcal{O}(m\log n\log_{\sigma}^{\epsilon} n)$-time queries.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Cell-Probe Lower Bounds and Complexity-Preserving Reductions for Suffix Array QueriesarXiv · 2026
- String Indexing for Maximal Gap-Bounded Occurrence ClustersarXiv · 2026
- Suffixient Arrays: A New Efficient Suffix Array Compression Technique.Theory of computing systems · 2026
- ZigZag Trie: A Novel Index for Contextual QueriesarXiv · 2026
- Real-Time String Indexing in Optimal TimearXiv · 2026
- Internal Queries for Maximal Closed SubstringsarXiv · 2026