[Paper Review] Streaming $k$-edit approximate pattern matching via string decomposition
This paper presents a randomized streaming algorithm for k-edit approximate pattern matching that uses Õ(k²) space and Õ(k²) time per symbol, significantly improving upon the prior Õ(k⁵) space and Õ(k⁸) time bound. It leverages a locally consistent string decomposition to convert edit distance into Hamming distance, then applies the CKP k-mismatch algorithm as a black box on decomposed grammars.
In this paper we give an algorithm for streaming $k$-edit approximate pattern matching which uses space $\widetilde{O}(k^2)$ and time $\widetilde{O}(k^2)$ per arriving symbol. This improves substantially on the recent algorithm of Kociumaka, Porat and Starikovskaya (2022) which uses space $\widetilde{O}(k^5)$ and time $\widetilde{O}(k^8)$ per arriving symbol. In the $k$-edit approximate pattern matching problem we get a pattern $P$ and text $T$ and we want to identify all substrings of the text $T$ that are at edit distance at most $k$ from $P$. In the streaming version of this problem both the pattern and the text arrive in a streaming fashion symbol by symbol and after each symbol of the text we need to report whether there is a current suffix of the text with edit distance at most $k$ from $P$. We measure the total space needed by the algorithm and time needed per arriving symbol.
Motivation & Objective
- To design a space- and time-efficient streaming algorithm for k-edit approximate pattern matching.
- To overcome the high space and time complexity of prior streaming approaches, especially the Õ(k⁵) space and Õ(k⁸) time of Kociumaka et al. (2022).
- To achieve near-optimal performance by reducing edit distance computation to Hamming distance via string decomposition.
- To enable efficient, real-time pattern matching in streaming settings where both pattern and text arrive symbol by symbol.
Proposed method
- Uses the locally consistent string decomposition from Bhattacharya and Koucký (2023) to represent strings as grammars preserving edit distance.
- Applies the CKP k-mismatch pattern matching algorithm as a black box on the decomposed grammars to detect approximate matches.
- Maintains active, committed, and pattern-specific grammars to track current text suffixes and their alignment with the pattern.
- Uses rolling grammar updates to incrementally process each incoming text symbol with Õ(k) time per update.
- Computes edit distance between text suffixes and the pattern by summing edit distances across aligned grammar pairs.
- Employs randomized alignment sampling to ensure high probability correctness with bounded error.
Experimental results
Research questions
- RQ1Can k-edit approximate pattern matching be solved in Õ(k²) space and time per symbol in the streaming model?
- RQ2Can string decomposition techniques be used to reduce edit distance problems to Hamming distance problems in a streaming context?
- RQ3Is it possible to achieve sub-quadratic time per symbol while maintaining low space complexity?
- RQ4Can the error probability of the algorithm be bounded to a small polynomial using random sampling of alignments?
Key findings
- The algorithm achieves Õ(k²) space and Õ(k²) time per arriving symbol, representing a substantial improvement over the prior Õ(k⁵) space and Õ(k⁸) time bound.
- The use of string decomposition transforms edit distance computation into a Hamming distance problem on grammars, enabling reuse of efficient k-mismatch algorithms.
- The algorithm maintains correctness with high probability, with failure probability at most O(log N / N), which can be made an arbitrarily small polynomial.
- The time complexity is bounded by Õ(k²) per symbol due to efficient grammar management and edit distance computation on at most k mismatched grammar pairs.
- The space complexity is dominated by the CKP k-mismatch algorithm and grammar storage, both of which are Õ(k²) at any point.
- The approach is robust to streaming constraints, as it processes symbols incrementally and supports real-time reporting of edit distance to current text suffixes.
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.