Small-space and streaming pattern matching with edits
Tomasz Kociumaka, Ely Porat, Tatiana Starikovskaya
Abstract
In this work, we revisit the fundamental and well-studied problem of approximate pattern matching under edit distance. Given an integer, a patternof length, and a textof length, the task is to find substrings ofthat are within edit distancefrom. Our main result is a streaming algorithm that solves the problem inspace11Hereafter,hides afactor. andamortized time per character of the text, providing answers correct with high probability. This answers a decade-old question: since the discovery of a poly () -space streaming algorithm for pattern matching under Hamming distance by Porat and Porat [FOCS 2009], the existence of an analogous result for edit distance remained open. Up to this work, no poly ()-space algorithm was known even in the simpler semi-streaming model, wherecomes as a stream butis available for read-only access. In this model, we give a deterministic algorithm that achieves slightly better complexity. Our central technical contribution is a new space-efficient deterministic encoding of two strings, called the greedy encoding, which encodes a set of all alignments of cost at mostwith a certain property (we call such alignments greedy). On strings of length at most, the encoding occupiesspace. We use the encoding to compress substrings of the text that are close to the pattern. In order to do so, we compute the encoding for substrings of the text and of the pattern, which requires read-only access to the latter. In order to develop the fully streaming algorithm, we further introduce a new edit distance sketch parameterized by integers. For any string of length at most, the sketch is of size, and it can be computed with an-space streaming algorithm. Given the sketches of two strings, intime we can compute their edit distance or certify that it is larger than. This result improves upon-size sketches of Belazzougui and Zhang [FOCS 2016] and very recent-size sketches of Jin, Nelson, and Wu [STACS 2021].
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 5f600cd9-307e-4684-81a6-103bafd79023Cited by top-tier papers10
- Faster Pattern Matching under Edit Distance : A Reduction to Dynamic Puzzle Matching and the Seaweed Monoid of Permutation MatricesPanagiotis Charalampopoulos, Tomasz Kociumaka, Philip WellnitzFOCS 2022 · 8 citations
- Near-Optimal Quantum Algorithms for Bounded Edit Distance and Lempel-Ziv FactorizationDaniel Gibney, Ce Jin, Tomasz Kociumaka, Sharma V. ThankachanSODA 2024 · 7 citations
- Õ(n+poly(k))-time Algorithm for Bounded Tree Edit DistanceDebarati Das, Jacob Gilbert, MohammadTaghi Hajiaghayi, Tomasz Kociumaka et al.FOCS 2022 · 5 citations
- Streaming Regular Expression Membership and Pattern MatchingBartlomiej Dudek, Pawel Gawrychowski, Garance Gourdel, Tatiana StarikovskayaSODA 2022 · 4 citations
- Approximation Schemes for Edit Distance and LCS in Quasi-Strongly Subquadratic TimeXiao Mao, Aviad RubinsteinSTOC 2026 · 4 citations
Builds on3
- Resolution of the Burrows-Wheeler Transform ConjectureDominik Kempa, Tomasz KociumakaFOCS 2020 · 32 citations
- Faster Approximate Pattern Matching: A Unified ApproachPanagiotis Charalampopoulos, Tomasz Kociumaka, Philip WellnitzFOCS 2020 · 2 citations
- Approximating text-to-pattern Hamming distancesTimothy M. Chan, Shay Golan, Tomasz Kociumaka, Tsvi Kopelowitz et al.STOC 2020 · 2 citations
Related papers
- Sublinear-Time Algorithms for Computing & Embedding Gap Edit DistanceTomasz Kociumaka, Barna SahaFOCS 2020 · 9 citations
- Almost Linear Size Edit Distance SketchMichal Koucký, Michael E. SaksSTOC 2024 · 1 citation
- Near-Optimal-Time Quantum Algorithms for Approximate Pattern MatchingTomasz Kociumaka, Jakob Nogler, Philip WellnitzSODA 2025 · 1 citation
- Almost-optimal sublinear-time edit distance in the low distance regimeKarl Bringmann, Alejandro Cassis, Nick Fischer, Vasileios NakosSTOC 2022 · 4 citations
- Optimal Algorithms for Bounded Weighted Edit DistanceAlejandro Cassis, Tomasz Kociumaka, Philip WellnitzFOCS 2023 · 4 citations
