[Paper Review] Lightweight LCP-Array Construction in Linear Time
This paper presents two new linear-time algorithms for constructing the LCP-array that are highly space-efficient (using only n or 2n bytes) and optimized for modern memory hierarchies by minimizing cache misses. By leveraging the Burrows-Wheeler Transform and a rank-select data structure to selectively compute only necessary LCP values, the algorithms outperform existing state-of-the-art methods, especially on large texts with small alphabets or long BWT runs—such as DNA sequences and XML collections.
The suffix tree is a very important data structure in string processing, but it suffers from a huge space consumption. In large-scale applications, compressed suffix trees (CSTs) are therefore used instead. A CST consists of three (compressed) components: the suffix array, the LCP-array, and data structures for simulating navigational operations on the suffix tree. The LCP-array stores the lengths of the longest common prefixes of lexicographically adjacent suffixes, and it can be computed in linear time. In this paper, we present new LCP-array construction algorithms that are fast and very space efficient. In practice, our algorithms outperform the currently best algorithms.
Motivation & Objective
- Address the performance bottleneck in LCP-array construction caused by poor locality and high cache miss rates in existing algorithms.
- Develop space-efficient algorithms that use only n or 2n bytes of additional memory while maintaining linear-time complexity.
- Optimize for modern computer architectures by trading character comparisons for cache misses, particularly benefiting from good locality in the BWT.
- Improve practical performance on real-world workloads such as long DNA sequences and large XML document collections, which exhibit small alphabets and long BWT runs.
- Achieve faster construction times than current best algorithms by exploiting structural properties of the BWT and suffix array.
Proposed method
- Use a bit array b to mark positions in the text where LCP values are not precomputed, distinguishing between known and unknown LCP values.
- Maintain a compressed representation of the PLCP-array (lcp-values in text order) using only n or 2n bytes, focusing on irreducible entries.
- Employ a rank-select data structure on the bit array b to enable constant-time rank queries, allowing efficient indexing into the compressed PLCP-array.
- Process the suffix array and BWT in a streaming fashion from disk, scanning left-to-right to compute LCP values incrementally.
- Leverage Lemma 2 to infer reducible LCP values as ℓ = ℓ−1, reducing the need for character comparisons when possible.
- Apply a final transformation to map the PLCP-array (in text order) back to the LCP-array (in suffix array order) using rank queries.
Experimental results
Research questions
- RQ1Can LCP-array construction be made significantly faster in practice while using minimal additional memory?
- RQ2To what extent can cache efficiency be improved by trading character comparisons for reduced cache misses in LCP construction?
- RQ3How do structural properties of the BWT—such as run length and alphabet size—affect the performance of LCP construction algorithms?
- RQ4Can a hybrid approach that computes only irreducible LCP values via selective character comparisons outperform full-scan algorithms?
- RQ5Does the use of a rank-select structure on a bit array marking unknown LCP positions lead to better performance on large-scale text data?
Key findings
- The proposed algorithms achieve linear-time construction of the LCP-array with only n or 2n bytes of additional space, significantly reducing memory usage compared to prior methods.
- On large texts, particularly long DNA sequences (small alphabet) and XML document collections (long BWT runs), the algorithms are consistently faster than the current best-known algorithms.
- The performance gain is most pronounced for large inputs, with the superiority increasing as text size grows.
- The algorithms outperform state-of-the-art methods by reducing cache misses through smarter data access patterns, even though they may perform slightly more character comparisons.
- The use of a rank-select structure on a bit array enables efficient indexing into a compressed PLCP-array, allowing selective computation of only necessary values.
- The final step of mapping from PLCP to LCP is efficient and linear, relying on rank queries to align values in suffix array order.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.