Approximate String Matching with Compressed Indexes

Luís M. S. Russo, Gonzalo Navarro, Arlindo L. Oliveira, Pedro Morales

TL;DR

This paper tackles the challenge of approximate string matching (ASM) on compressed text indexes, which are crucial for applications like bioinformatics but have lagged behind exact search capabilities. The authors introduce novel algorithms that adapt existing techniques to these compressed structures, achieving competitive performance and useful space-time trade-offs.

What Problem Does This Paper Address?

Traditional text indexing methods often require significant space, making them impractical for large datasets. Compressed full-text self-indexes offer a solution by drastically reducing space requirements, even allowing for text reconstruction. However, while these indexes excel at exact string matching, their application to approximate string matching (ASM) – finding patterns with a certain number of errors (insertions, deletions, substitutions) – has seen limited progress. This gap is particularly problematic in fields like bioinformatics, where sequence variations are common. The paper aims to bridge this gap by developing efficient ASM algorithms that leverage the unique properties of compressed self-indexes, specifically Lempel-Ziv (LZ) based indexes and compressed suffix trees/arrays.

Methods

The authors propose several key approaches:

  • Exact-Match Filtration Adaptation: They adapt the classical "partitioning into exact search" strategy to compressed self-indexes. This involves breaking the pattern into smaller pieces and searching for exact matches of these pieces within the compressed text. They optimize this for both LZ-based and suffix-array-based compressed indexes.
  • Lempel-Ziv as q-Samples Extension: The paper demonstrates that an LZ index can be viewed as an extension of the classical q-samples index. They provide new insights into q-samples indexes and apply them to LZ indexes, enabling more efficient ASM.
  • Improved Hierarchical Verification: They enhance the hierarchical verification technique, a method for sequential searching that gradually increases the error threshold. This improvement is particularly effective when combined with the bidirectionality offered by most compressed suffix trees/arrays, allowing for more efficient verification by extending matches left and right. This reduces costly accesses to the underlying text.

Datasets

The paper uses standard text datasets for evaluation:

  • English text
  • DNA sequences
  • Protein sequences

These datasets are sourced from the "Pizza&Chili corpus." The patterns used were of length 30 and were generated by taking substrings from the texts and introducing a 10% error rate.

Key Insights and Ideas

  • Compressed Indexes are Viable for ASM: The paper demonstrates that compressed self-indexes, previously limited to exact matching, can be effectively used for approximate string matching, opening up new possibilities for space-constrained applications.
  • LZ Indexes as Generalized q-Samples: Viewing LZ indexes as an extension of q-samples indexes provides a novel framework for adapting ASM techniques to this popular compression scheme.
  • Bidirectionality is Key for Efficient Verification: Leveraging the bidirectional navigation capabilities of compressed suffix trees/arrays significantly improves the efficiency of hierarchical verification, a critical step in ASM.
  • Space-Time Trade-offs are Achievable: The proposed algorithms offer competitive performance, achieving useful trade-offs between index size and search time, making them practical for real-world scenarios.

Key Results

The experimental results show that the proposed algorithms are competitive:

  • ILZI (Hybrid Lempel-Ziv): Performed particularly well on protein data and was often the fastest or close to the fastest, especially for low error levels (k=1 or k=2), achieving up to an order of magnitude improvement over classical indexes in these cases.
  • BiFMI (Bidirectional FM-Index): Achieved the smallest space usage among the tested compressed indexes and showed performance close to ILZI, demonstrating the effectiveness of hierarchical verification even on a slower index.
  • DLZI (Advanced Lempel-Ziv): Showed the best performance among the exact partitioning indexes.
  • Sequential Approaches: Outperformed compressed indexing approaches for sufficiently high error levels.

The paper also highlights that for low error levels, compressed indexing approaches are most valuable, and their work significantly improves the usability of these indexes for ASM.

Limitations and Future Work

  • Parametrization: Some of the proposed hybrid index approaches require careful parameter tuning (e.g., v and h for ILZI) to achieve optimal performance, although the authors also explored automatic parameter selection.
  • Secondary Filtering: The ILZI implementation could be further improved by incorporating secondary filtering, which is not currently applied.
  • Weighting Letters: The authors plan to explore assigning weights to letters of the pattern to potentially reduce the number of positions to verify and improve overall performance.
  • New Benchmarks: The paper suggests investigating the impact of assigning smaller weights to less frequent letters of the pattern.
  • FCST vs. ILZI: While the BiFMI (FCST-based) approach requires less space, it was less efficient than the ILZI-based algorithm in some cases. The authors note that the ILZI-based algorithm cannot be used as a subroutine in a suffix tree algorithm, whereas their FCST-based approach can.

Summary updated

BibTeX
@inproceedings{russo2009approximate,
  author = {Luís M. S. Russo and Gonzalo Navarro and Arlindo L. Oliveira and Pedro Morales},
  title = {{Approximate String Matching with Compressed Indexes}},
  booktitle = {Algorithms},
  year = {2009},
  url = {https://openreview.net/forum?id=LR7lWrf5KpR},
}
Figure