[Paper Review] Longest Common Extensions with Recompression
This paper presents a new compressed longest common extension (LCE) data structure using the recompression technique, achieving O(lg N) query time and O(z lg(N/z)) space, where z is the size of the Lempel-Ziv 77 factorization without self-reference. The method supports efficient LCE queries on grammar-compressed strings by maintaining consistent compression patterns across identical substrings, outperforming prior work in both time and space complexity.
Given two positions $i$ and $j$ in a string $T$ of length $N$, a longest common extension (LCE) query asks for the length of the longest common prefix between suffixes beginning at $i$ and $j$. A compressed LCE data structure is a data structure that stores $T$ in a compressed form while supporting fast LCE queries. In this article we show that the recompression technique is a powerful tool for compressed LCE data structures. We present a new compressed LCE data structure of size $O(z \lg (N/z))$ that supports LCE queries in $O(\lg N)$ time, where $z$ is the size of Lempel-Ziv 77 factorization without self-reference of $T$. Given $T$ as an uncompressed form, we show how to build our data structure in $O(N)$ time and space. Given $T$ as a grammar compressed form, i.e., an straight-line program of size n generating $T$, we show how to build our data structure in $O(n \lg (N/n))$ time and $O(n + z \lg (N/z))$ space. Our algorithms are deterministic and always return correct answers.
Motivation & Objective
- To design a compressed LCE data structure that supports fast queries while minimizing space usage on highly compressible strings.
- To leverage the recompression technique to ensure consistent compression patterns for identical substrings, enabling efficient LCE computation.
- To achieve deterministic, correct answers with improved time and space complexity over existing randomized or higher-space alternatives.
- To support efficient construction from both uncompressed and grammar-compressed (SLP) string representations.
Proposed method
- The method uses the recompression technique to replace frequently occurring pairs in the string with new variables, creating a compressed grammar representation.
- It maintains a balanced derivation tree structure with O(lg N) height, enabling O(lg N) time traversal for LCE queries.
- The algorithm ensures that identical substrings are compressed in nearly identical ways, with only O(lg N) discrepancies in their surrounding contexts.
- It employs two types of partitions in the recompression process: one for compressing the string by a constant factor, and another for compressing the grammar size, keeping intermediate CFG sizes bounded at O(n).
- The construction is performed level-by-level using a modified version of the SimTtoG algorithm, switching to direct TtoG when the string becomes small enough.
- The resulting grammar, called an RLSLP, supports LCE queries by simulating derivation tree traversal and matching common variable sequences in O(lg N) time.
Experimental results
Research questions
- RQ1Can the recompression technique be used to build a compressed LCE data structure with better time and space complexity than existing approaches?
- RQ2How can consistent compression patterns for identical substrings be exploited to support fast LCE queries in grammar-compressed strings?
- RQ3What is the optimal trade-off between construction time, space usage, and query time for LCE queries on SLP-compressed strings?
- RQ4Can the data structure be constructed deterministically in O(n lg(N/n)) time and O(n + z lg(N/z)) space from an SLP input?
Key findings
- The proposed data structure achieves O(lg N) query time, improving upon the O(lg N + lg ℓ lg* N) time of prior work.
- The space complexity is O(z lg(N/z)), which is a significant improvement over the O(z lg N lg* N) space of previous signature encoding-based methods.
- The data structure can be constructed in O(N) time and space from an uncompressed string, and in O(n lg(N/n)) time and O(n + z lg(N/z)) space from an SLP of size n.
- The construction is deterministic and always returns correct answers, avoiding the need for probabilistic verification steps required in randomized approaches.
- The method supports efficient LCE queries on grammar-compressed strings without explicit decompression, enabling faster processing in compressed string algorithms.
- The algorithm maintains O(n) size for intermediate CFGs during construction by using dual partitioning strategies, ensuring linear growth in grammar size.
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.