Dynamic r-index: An Updatable Self-Index in LCP-bounded Time
Takaaki Nishimoto, Yasuo Tabei
TL;DR
The paper tackles dynamic string indexing for highly repetitive data by introducing the dynamic r-index, an updatable self-index based on run-length BWT. It extends the static r-index with three coordinated dynamic data structures and a dynamic LF mapping to support efficient insertions and deletions while preserving fast count and locate queries. The authors provide detailed algorithms, complexity analyses, and extensive experiments showing LCP-bounded update times and practical performance on large, repetitive datasets. This work enables real-time maintenance of compressed self-indexes in evolving text collections, with substantial space efficiency on repetitive data and open-source release plans. Overall, the dynamic r-index offers a principled, scalable approach to updatable self-indexing for modern repetitive workloads.
Abstract
A self-index is a compressed data structure that supports locate queries -- reporting all positions where a given pattern occurs in a string while maintaining the string in compressed form. While many self-indexes have been proposed, developing dynamically updatable ones supporting string insertions and deletions remains a challenge. The r-index (Gagie et al., JACM'20) is a representative static self-index based on the run-length Burrows-Wheeler transform (RLBWT), designed for highly repetitive strings. We present the dynamic r-index, a dynamic extension of the r-index that achieves updates in LCP-bounded time. The dynamic r-index supports count queries in $O(m \log r / \log \log r)$ time and locate queries in $O(m \log r / \log \log r + \mathsf{occ} \log r)$ time, using $O(r)$ words of space, where $m$ is the length of a query with $\mathsf{occ}$ occurrences and $r$ is the number of runs in the RLBWT. Crucially, update operations are supported in $O((m + L_{\mathsf{max}}) \log n)$ time for a substring of length $m$, where $L_{\mathsf{max}}$ is the maximum LCP value; the average running time is $O((m + L_{\mathsf{avg}}) \log n)$, where $L_{\mathsf{avg}}$ is the average LCP value. This LCP-bounded complexity is particularly advantageous for highly repetitive strings where LCP values are typically small. We experimentally demonstrate the practical efficiency of the dynamic r-index on various highly repetitive datasets.
