On the Communication Complexity of Approximate Pattern Matching

Tomasz Kociumaka,Jakob Nogler,Philip Wellnitz
2024-10-09
Abstract:The decades-old Pattern Matching with Edits problem, given a length-$n$ string $T$ (the text), a length-$m$ string $P$ (the pattern), and a positive integer $k$ (the threshold), asks to list all fragments of $T$ that are at edit distance at most $k$ from $P$. 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 $P$ and $T$. 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 $\Omega(n/m \cdot k \log(m/k))$ bits are necessary and $O(n/m \cdot k\log (m|\Sigma|/k))$ bits are sufficient; the upper bound allows encoding not only the occurrences of $P$ in $T$ with at most $k$ mismatches but also the substitutions needed to make each $k$-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 $\Omega(n/m \cdot k\log(m/k))$ bits and an upper bound of $O(n/m \cdot k^3\log m)$ bits stemming from previous research. In this work, we prove an upper bound of $O(n/m \cdot k \log^2 m)$ bits, thus establishing the optimal communication complexity up to logarithmic factors. We also show that $O(n/m \cdot k \log m \log (m|\Sigma|))$ bits allow encoding, for each $k$-error occurrence of $P$ in $T$, the shortest sequence of edits needed to make the occurrence exact. We leverage the techniques behind our new result on the communication complexity to obtain quantum algorithms for Pattern Matching with Edits.
Data Structures and Algorithms,Quantum Physics
What problem does this paper attempt to address?
The problem that this paper attempts to solve is about the communication complexity of edit distance in pattern matching. Specifically, given a text string \(T\) of length \(n\), a pattern string \(P\) of length \(m\), and a positive integer threshold \(k\), the goal of the pattern - matching problem is to list all fragments of text \(T\) whose edit distance from pattern \(P\) is no more than \(k\). Edit distance refers to the minimum number of operations required to convert one string into another by inserting, deleting, or replacing characters. The main contributions of the paper are as follows: 1. **Upper bound of communication complexity**: The author proves that the one - way deterministic communication protocol for the pattern - matching problem can send \(\mathcal{O}\left(\frac{n}{m}\cdot k\log^{2}m\right)\) bits of information. This result is optimal within a logarithmic factor. 2. **Quantum algorithms**: The author also proposes quantum algorithms for the pattern - matching problem, which have good performance in terms of query complexity and time complexity. Specifically, they present two quantum algorithms: - One quantum algorithm can solve the problem in \(\hat{\mathcal{O}}\left(\frac{n^{1 + o(1)}}{m}\cdot\sqrt{km}\right)\) queries and \(\hat{\mathcal{O}}\left(\frac{n^{1 + o(1)}}{m}\cdot(\sqrt{km}+k^{3.5})\right)\) time. - Another quantum algorithm can determine whether there is at least one match in \(\hat{\mathcal{O}}\left(\sqrt{\frac{n^{1 + o(1)}}{m}\cdot\sqrt{km}}\right)\) queries and \(\hat{\mathcal{O}}\left(\sqrt{\frac{n^{1 + o(1)}}{m}\cdot(\sqrt{km}+k^{3.5})}\right)\) time. 3. **Structural insights**: The author reveals the solution structure of the pattern - matching problem by conducting in - depth analysis of the structure of the pattern - matching problem. These structural insights not only help in understanding the problem itself but also provide a theoretical basis for designing more efficient algorithms. These contributions of the paper not only promote the theoretical research of the pattern - matching problem but also provide new ideas for the design of efficient algorithms in practical applications. In particular, the proposal of quantum algorithms opens up new directions for further research in the field of quantum computing in the future.