English

Fast and Small Subsampled R-indexes

Data Structures and Algorithms 2024-09-24 v1

Abstract

The rr-index represented a breakthrough in compressed indexing of repetitive text collections, outperforming its alternatives by orders of magnitude in query time. Its space usage, O(r)O(r) where rr is the number of runs in the Burrows--Wheeler Transform of the text, is however higher than Lempel--Ziv (LZ) and grammar-based indexes, and makes it uninteresting in various real-life scenarios of milder repetitiveness. We introduce the srsr-index, a variant that limits the space to O(min(r,n/s))O(\min(r,n/s)) for a text of length nn and a given parameter ss, at the expense of multiplying by ss the time per occurrence reported. The srsr-index is obtained subsampling the text positions indexed by the rr-index, being still able to support pattern matching with guaranteed performance. Our experiments show that the theoretical analysis falls short in describing the practical advantages of the srsr-index, because it performs much better on real texts than on synthetic ones: the srsr-index retains the performance of the rr-index while using 1.5--4.0 times less space, sharply outperforming {\em virtually every other} compressed index on repetitive texts in both time and space. Only a particular LZ-based index uses less space than the srsr-index, but it is an order of magnitude slower. Our second contribution are the rr-csa and srsr-csa indexes. Just like the rr-index adapts the well-known FM-Index to repetitive texts, the rr-csa adapts Sadakane's Compressed Suffix Array (CSA) to this case. We show that the principles used on the rr-index turn out to fit naturally and efficiently in the CSA framework. The srsr-csa is the corresponding subsampled version of the rr-csa. While the CSA performs better than the FM-Index on classic texts with alphabets larger than DNA, we show that the srsr-csa outperforms the srsr-index on repetitive texts over those larger alphabets and some DNA texts as well.

Keywords

Cite

@article{arxiv.2409.14654,
  title  = {Fast and Small Subsampled R-indexes},
  author = {Dustin Cobas and Travis Gagie and Gonzalo Navarro},
  journal= {arXiv preprint arXiv:2409.14654},
  year   = {2024}
}

Comments

arXiv admin note: text overlap with arXiv:2103.15329

R2 v1 2026-06-28T18:53:11.747Z