Near-Optimal-Time Quantum Algorithms for Approximate Pattern Matching
Tomasz Kociumaka, Jakob Nogler, Philip Wellnitz
Abstract
Approximate Pattern Matching is among the most fundamental string-processing tasks. Given a text ๐ of length ๐, a pattern ๐ of length ๐, and a threshold ๐, the task is to identify the fragments of ๐ that are at distance at most ๐ to ๐. We consider the two most common distances: Hamming distance (the number of mismatches or character substitutions) in Pattern Matching with Mismatches and edit distance (the minimum number of character insertions, deletions, and substitutions) in Pattern Matching with Edits. We revisit the complexity of these two problems in the quantum setting.
Our recent work [STOC'24] shows that ร( ๐/๐ โข โ ๐๐) = ร( โ ๐๐)1 quantum queries are sufficient to solve (the decision version of) the Pattern Matching with Edits problem. However, the quantum time complexity of the underlying solution (that is, the computational overhead to recover the solution from the quantum queries) does not provide any improvement over classical computation. On the other hand, the state-of-the-art quantum algorithm for Pattern Matching with Mismatches [Jin and Nogler; SODA'23] achieves query complexity ร( โ ๐๐ 3/2 ) and time complexity ร( โ ๐๐ 2 ), falling short of a known unconditional lower bound of ฮฉ( โ ๐๐) quantum queries. In this work, we present quantum algorithms with a time complexity of ร( โ ๐๐ + ๐/๐ โข ๐ 2 ) for Pattern Matching with Mismatches and ร( โ ๐๐ + ๐/๐ โข ๐ 3.5 ) for Pattern Matching with Edits; both algorithms use ร( โ ๐๐) quantum queries. These running times are near-optimal for ๐ โช ๐ 1/3 and ๐ โช ๐ 1/6 , respectively, and they offer advantage over classical algorithms for ๐ โช (๐๐) 1/4 and ๐ โช (๐๐) 1/7 , respectively. Our solutions can also report the starting positions of all approximate occurrences of ๐ in ๐ (represented as collections of arithmetic progressions); in this case, both the unconditional lower bound and the complexities of our algorithms increase by a ฮ( ๐/๐) factor.
As a major technical contribution, we give a faster algorithm to solve a system of ๐ substring equations of the
The goal is to construct a generic solution string whose characters are equal only when necessary. While this is known to be possible in ๐ช(๐ + ๐) time [Gawrychowski, Kociumaka, Radoszewski, Rytter, Wale ล; TCS'16], we show that ร(๐ 2 ) classical time is sufficient to obtain an ร(๐)-size representation of ๐ that supports random access and other standard queries (of the so-called PILLAR model) in ๐ช(log ๐) time. We apply this tool to efficiently construct an ร(๐)-size representation of strings ๐ # and ๐ # obtained from ๐ and ๐ by carefully masking out some characters so that the output to the studied approximate pattern matching problems does not change.
1 Throughout this paper, the ร(โข) and ร(โข) notations hide poly-logarithmic factors (log ๐) ๐ช(1) and sub-polynomial factors ๐ ๐(1) , respectively, with respect to the total input size ๐ of the considered problems.
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 a4376f89-ecff-4257-8e8c-15290a797768Cited by top-tier papers1
Ask how each one uses itBuilds on7
- 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
- Dynamically Maintaining the Persistent Homology of Time SeriesSebastiano Cultrera di Montesano, Herbert Edelsbrunner, Monika Henzinger, Lara OstSODA 2024 ยท 5 citations
Related papers
- On the Communication Complexity of Approximate Pattern MatchingTomasz Kociumaka, Jakob Nogler, Philip WellnitzSTOC 2024 ยท 2 citations
- Faster Approximate Pattern Matching: A Unified ApproachPanagiotis Charalampopoulos, Tomasz Kociumaka, Philip WellnitzFOCS 2020 ยท 2 citations
- Near-Optimal Quantum Algorithms for Bounded Edit Distance and Lempel-Ziv FactorizationDaniel Gibney, Ce Jin, Tomasz Kociumaka, Sharma V. ThankachanSODA 2024 ยท 7 citations
- Approximating text-to-pattern Hamming distancesTimothy M. Chan, Shay Golan, Tomasz Kociumaka, Tsvi Kopelowitz et al.STOC 2020 ยท 2 citations
- Near-Optimal Property Testers for Pattern MatchingCe Jin, Tomasz KociumakaFOCS 2025 ยท 1 citation
