[Paper Review] Extending the Burrows-Wheeler Transform for Cartesian Tree Matching and Constructing It
This paper proposes a compact construction algorithm for the cBWT index, a Burrows-Wheeler transform-based data structure for Cartesian tree matching, enabling efficient indexing of multiple texts. It achieves O(n lg σ lg n / lg lg n) construction time and O(n lg σ) space, supporting dynamic extension with logarithmic slowdown and compact working space, crucial for applications like motif detection in time series and music scores.
Cartesian tree matching is a form of generalized pattern matching where a substring of the text matches with the pattern if they share the same Cartesian tree. This form of matching finds application for time series of stock prices and can be of interest for melody matching between musical scores. For the indexing problem, the state-of-the-art data structure is a Burrows-Wheeler transform based solution due to [Kim and Cho, CPM'21], which uses nearly succinct space and can count the number of substrings that Cartesian tree match with a pattern in time linear in the pattern length. The authors address the construction of their data structure with a straight-forward solution that, however, requires pointer-based data structures, resulting in O(n lg n) bits of space, where n is the text length [Kim and Cho, CPM'21, Section A.4]. We address this bottleneck by a construction that requires O(n lg σ) bits of space and has a time complexity of O(n (lg σ lg n)/(lg lg n)), where σ is alphabet size. Additionally, we can extend this index for indexing multiple circular texts in the spirit of the extended Burrows-Wheeler transform without sacrificing the time and space complexities. We present this index in a dynamic variant, where we pay a logarithmic slowdown and need space linear in the input texts in bits for the extra functionality that we can incrementally add texts. Our extended setting is of interest for finding repetitive motifs common in the aforementioned applications, independent of offsets and scaling.
Motivation & Objective
- Address the lack of a compact construction algorithm for the cBWT index, which previously required O(n lg n) additional space due to pointer-based structures.
- Enable efficient indexing of multiple circular texts for Cartesian tree matching, allowing detection of repetitive motifs independent of offset and scaling.
- Design a dynamic variant of the cBWT index that incrementally supports adding new texts with compact space and logarithmic time overhead.
- Extend the FM-index framework to Cartesian tree matching using the extended Burrows-Wheeler transform, preserving optimal time and space complexity.
- Support efficient counting, LCP, and suffix array queries for circular rotations of indexed texts, essential for motif discovery in time series and music data.
Proposed method
- Extend the cBWT index using techniques from the extended Burrows-Wheeler transform to support multiple circular texts.
- Introduce a dynamic bitstring E to mark modified regions during incremental construction, preserving index functionality during updates.
- Use backward search on the cBWT index to compute cntR(Rot(S,i)), plcp∞R(Rot(S,i)), and slcp∞R(Rot(S,i)) for each rotation i of a new string S.
- Leverage Lemma 4.6 to recursively compute query values from rotated suffixes using rank and select operations on E.
- Store cntR-values in lex-order using E and the rank/select data structure from Lemma 2.1 to maintain compact space and support efficient updates.
- Apply iterative construction: start with the first text, then incrementally extend the index to include each subsequent text using Lemma 4.7, maintaining the invariant that E is zeroed before and after each extension.
Experimental results
Research questions
- RQ1Can the cBWT index be constructed in compact space without relying on pointer-based data structures?
- RQ2How can the cBWT index be extended to support multiple circular texts while preserving optimal time and space complexity?
- RQ3What is the time and space complexity of dynamically extending the cBWT index with new texts, and can it be done with logarithmic slowdown?
- RQ4Can the index efficiently support counting and LCP queries for all rotations of a pattern across multiple texts?
- RQ5Is it possible to maintain the functionality of the cBWT index during incremental construction using only compact auxiliary data structures?
Key findings
- The cBWT index can be constructed in O(n lg σ lg n / lg lg n) time and O(n lg σ) bits of space, significantly improving upon prior O(n lg n) additional space solutions.
- The construction algorithm supports dynamic extension of the index with new texts, achieving O((λ + ρ) lg σ lg(λ+ρ) / lg lg(λ+ρ)) time and O((λ + ρ) lg σ) bits of space per extension.
- The dynamic variant maintains the ability to answer count queries in O(m) time for a pattern of length m, matching the performance of the original cBWT index.
- The use of a dynamic bitstring E enables compact, incremental updates with only a logarithmic slowdown, ensuring the index remains functional during construction.
- The extended index supports efficient computation of plcp∞R and slcp∞R for all rotations of new strings, enabling detection of repetitive motifs across multiple texts regardless of offset or scaling.
- The final construction of the cBWT index for d texts with total length n achieves O(n lg σ lg n / lg lg n) time and O(n lg σ) space, under the condition that text lengths are non-decreasing.
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.