On the Communication Complexity of Approximate Pattern Matching
Tomasz Kociumaka, Jakob Nogler, Philip Wellnitz
Abstract
The decades-old Pattern Matching with Edits problem, given a length-𝑛 string 𝑇 (the text), a length-𝑚 string 𝑃 (the pattern), and a positive integer 𝑘 (the threshold), asks to list all fragments of 𝑇 that are at edit distance at most 𝑘 from 𝑃. The one-way communication complexity of this problem is the minimum amount of space needed to encode the answer so that it can be retrieved without accessing the input strings 𝑃 and 𝑇.
The closely related Pattern Matching with Mismatches problem (defined in terms of the Hamming distance instead of the edit distance) is already well understood from the communication complexity perspective: Clifford, Kociumaka, and Porat [SODA 2019] proved that Ω(𝑛/𝑚 • 𝑘 log(𝑚/𝑘)) bits are necessary and 𝒪(𝑛/𝑚 • 𝑘 log(𝑚|Σ|/𝑘)) bits are sufficient; the upper bound allows encoding not only the occurrences of 𝑃 in 𝑇 with at most 𝑘 mismatches but also the substitutions needed to make each 𝑘-mismatch occurrence exact.
Despite recent improvements in the running time [Charalampopoulos, Kociumaka, and Wellnitz; FOCS 2020 and 2022], the communication complexity of Pattern Matching with Edits remained unexplored, with a lower bound of Ω(𝑛/𝑚 • 𝑘 log(𝑚/𝑘)) bits and an upper bound of 𝒪(𝑛/𝑚 • 𝑘 3 log 𝑚) bits stemming from previous research. In this work, we prove an upper bound of 𝒪(𝑛/𝑚 • 𝑘 log 2 𝑚) bits, thus establishing the optimal communication complexity up to logarithmic factors. We also show that 𝒪(𝑛/𝑚 • 𝑘 log 𝑚 log(𝑚|Σ|)) bits allow encoding, for each 𝑘-error occurrence of 𝑃 in 𝑇, the shortest sequence of edits needed to make the occurrence exact. Our result further emphasizes the close relationship between Pattern Matching with Mismatches and Pattern Matching with Edits.
We leverage the techniques behind our new result on the communication complexity to obtain quantum algorithms for Pattern Matching with Edits: we demonstrate a quantum algorithm that uses 𝒪(𝑛 1+𝑜(1) /𝑚 • √ 𝑘𝑚) queries and 𝒪(𝑛 1+𝑜(1) /𝑚 • ( √ 𝑘𝑚 + 𝑘 3.5 )) quantum time. Moreover, when determining the existence of at least one occurrence, the algorithm uses 𝒪( 𝑛 1+𝑜(1) /𝑚 • √ 𝑘𝑚) queries and 𝒪( 𝑛 1+𝑜(1) /𝑚 • ( √ 𝑘𝑚 + 𝑘 3.5 )) time. For both cases, we establish corresponding lower bounds to demonstrate that the query complexity is optimal up to sub-polynomial factors. Acknowledgements The work of Philip Wellnitz was carried out at the Max Planck Institute for Informatics. The work of Jakob Nogler was carried out mostly during a summer internship at the Max Planck Institute for Informatics.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
4 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Pattern Matching under Weighted Edit Distance cites Near-Optimal-Time Quantum Algorithms for Approximate Pattern Matching
- Pattern Matching under Weighted Edit Distance cites Faster Pattern Matching under Edit Distance : A Reduction to Dynamic Puzzle Matching and the Seaweed Monoid of Permutation Matrices
- Quantum Speed-ups for String Synchronizing Sets, Longest Common Substring, and k-mismatch Matching cites Near-Optimal Quantum Algorithms for String Problems
- Near-Optimal-Time Quantum Algorithms for Approximate Pattern Matching cites Gap Edit Distance via Non-Adaptive Queries: Simple and Optimal
- Near-Optimal-Time Quantum Algorithms for Approximate Pattern Matching cites Quantum Speed-ups for String Synchronizing Sets, Longest Common Substring, and k-mismatch Matching
- Near-Optimal-Time Quantum Algorithms for Approximate Pattern Matching cites Small-space and streaming pattern matching with k edits
- Near-Optimal-Time Quantum Algorithms for Approximate Pattern Matching cites Faster Pattern Matching under Edit Distance : A Reduction to Dynamic Puzzle Matching and the Seaweed Monoid of Permutation Matrices
- Faster Pattern Matching under Edit Distance : A Reduction to Dynamic Puzzle Matching and the Seaweed Monoid of Permutation Matrices cites Small-space and streaming pattern matching with k edits
Cited by top-tier papers4
- Faster Weighted and Unweighted Tree Edit Distance and APSP EquivalenceJakob Nogler, Adam Polak, Barna Saha, Virginia Vassilevska Williams et al.STOC 2025 · 4 citations
- Pattern Matching under Weighted Edit DistancePanagiotis Charalampopoulos, Tomasz Kociumaka, Philip WellnitzFOCS 2025 · 3 citations
- Near-Optimal-Time Quantum Algorithms for Approximate Pattern MatchingTomasz Kociumaka, Jakob Nogler, Philip WellnitzSODA 2025 · 1 citation
- Tight Lower Bounds for Central String Queries in Compressed SpaceDominik Kempa, Tomasz KociumakaSODA 2026
Builds on9
- Near-Optimal Quantum Algorithms for String ProblemsShyan Akmal, Ce JinSODA 2022 · 15 citations
- Small-space and streaming pattern matching with editsTomasz Kociumaka, Ely Porat, Tatiana StarikovskayaFOCS 2021 · 13 citations
- Quantum Speed-ups for String Synchronizing Sets, Longest Common Substring, and k-mismatch MatchingCe Jin, Jakob NoglerSODA 2023 · 10 citations
- 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
- Gap Edit Distance via Non-Adaptive Queries: Simple and OptimalElazar Goldenberg, Tomasz Kociumaka, Robert Krauthgamer, Barna SahaFOCS 2022 · 5 citations
Related papers
- Faster Approximate Pattern Matching: A Unified ApproachPanagiotis Charalampopoulos, Tomasz Kociumaka, Philip WellnitzFOCS 2020 · 2 citations
- Near-Optimal Property Testers for Pattern MatchingCe Jin, Tomasz KociumakaFOCS 2025 · 1 citation
- Near-Optimal Quantum Algorithms for Bounded Edit Distance and Lempel-Ziv FactorizationDaniel Gibney, Ce Jin, Tomasz Kociumaka, Sharma V. ThankachanSODA 2024 · 7 citations
- Faster two-dimensional pattern matching with k mismatchesJonas Ellert, Pawel Gawrychowski, Adam Górkiewicz, Tatiana StarikovskayaSODA 2025 · 1 citation
- Almost-optimal sublinear-time edit distance in the low distance regimeKarl Bringmann, Alejandro Cassis, Nick Fischer, Vasileios NakosSTOC 2022 · 4 citations
