Skip to content

Move-rb: Faster Bi-Directional r-indexes and Approximate Pattern Matching

Johannes Fischer, Lukas Nalbach

cs.DS

Abstract

Approximate pattern matching (APM) on highly repetitive texts is a central task in bioinformatics. Bi-directional r-indexes support left- and right-extension of a pattern and thereby accelerate APM algorithms based on search schemes, but existing variants -- br-index and b-move -- suffer from two bottlenecks: O(σ)O(σ) character-predecessor/-successor queries on the run-length-encoded BWT per extension, and predecessor queries on sparse bit vectors to maintain a value in the suffix array interval and to access the PLCP array while locating. We present Move-rb, a bi-directional r-index built on the optimized r-index Move-r. Although Move-rb is 2x larger than br-index, it is up to 24% smaller than b-move, answers APM queries 1-4 orders of magnitude faster than br-index, 1.9-10x faster than b-move and up to 5.5x faster than the state-of-the-art bi-directional (uncompressed) FM-index columba, which is 36-42x larger. Memory usage (including index size) during APM locate queries is reduced by 1.5x (up to 6.5x) for Hamming distance and 2.5x (up to 7.4x) for edit distance. Move-rb can be constructed 3-14x faster while using 19-141x less memory than br-index, b-move and columba. A variant using a relative Lempel-Ziv-encoded suffix array locates up to 10x faster while being 1.2-2.4x larger. We achieve these speedups by optimizing index operations and search scheme APM algorithms: Without a direction switch, Move-rb computes an all-kk-character extension in output-optimal O(k)O(k) time and a single-character extension in the same time. Augmenting Move-rb with O((r+r←)log⁡(n/rmin⁡)log⁡σ)O((r+\overleftarrow{r})\log(n/r_{\min})\logσ) bits reduces a single-character extension to O(log⁡σ)O(\logσ) time, where rr and r←\overleftarrow{r} are the numbers of runs in the BWT of the text and its reverse, and rmin⁡=min⁡(r,r←)r_{\min}=\min(r,\overleftarrow{r}). A direction switch incurs only O(log⁡log⁡ω(n/rmin⁡))O(\log\log_ω(n/r_{\min})) additional time.

Create a lesson

Metadata

Comments
26 pages, 14 figures, 9 tables. Full version of the ALENEX 2027 paper