Lune

SODA2025Top-tier venue

Near-Optimal-Time Quantum Algorithms for Approximate Pattern Matching

Tomasz Kociumaka, Jakob Nogler, Philip Wellnitz

2025Year
1Citations
1Top-tier citations

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.

Questions to start from

Your agent calls

Luneget_paper_fulltext

Ask in Lune

Free to start. No credit card required.

lune papers fulltext a4376f89-ecff-4257-8e8c-15290a797768

Cited by top-tier papers1

Ask how each one uses it

Builds on7

Related papers

Dusk over the sea between two cliffs drawn in fine vertical lines