Papers
Topics
Authors
Recent
Search
2000 character limit reached

The Dynamic k-Mismatch Problem

Published 13 May 2021 in cs.DS | (2105.06166v2)

Abstract: The text-to-pattern Hamming distances problem asks to compute the Hamming distances between a given pattern of length mm and all length-mm substrings of a given text of length n≥mn\ge m. We focus on the kk-mismatch version of the problem, where a distance needs to be returned only if it does not exceed a threshold kk. We assume n≤2mn\le 2m (in general, one can partition the text into overlapping blocks). In this work, we show data structures for the dynamic version of this problem supporting two operations: An update performs a single-letter substitution in the pattern or the text, and a query, given an index ii, returns the Hamming distance between the pattern and the text substring starting at position ii, or reports that it exceeds kk. First, we show a data structure with O~(1)\tilde{O}(1) update and O~(k)\tilde{O}(k) query time. Then we show that O~(k)\tilde{O}(k) update and O~(1)\tilde{O}(1) query time is also possible. These two provide an optimal trade-off for the dynamic kk-mismatch problem with k≤nk \le \sqrt{n}: we prove that, conditioned on the strong 3SUM conjecture, one cannot simultaneously achieve k<sup>1−Ω(1)k<sup>{1-\Omega(1)} time for all operations. For k≥nk\ge \sqrt{n}, we give another lower bound, conditioned on the Online Matrix-Vector conjecture, that excludes algorithms taking n<sup>1/2−Ω(1)n<sup>{1/2-\Omega(1)} time per operation. This is tight for constant-sized alphabets: Clifford et al. (STACS 2018) achieved O~(n)\tilde{O}(\sqrt{n}) time per operation in that case, but with O~(n<sup>3/4)\tilde{O}(n<sup>{3/4}) time per operation for large alphabets. We improve and extend this result with an algorithm that, given 1≤x≤k1\le x\le k, achieves update time O~(nk+nkx)\tilde{O}(\frac{n}{k} +\sqrt{\frac{nk}{x}}) and query time O~(x)\tilde{O}(x). In particular, for k≥nk\ge \sqrt{n}, an appropriate choice of xx yields O~(nk3)\tilde{O}(\sqrt[3]{nk}) time per operation, which is O~(n<sup>2/3)\tilde{O}(n<sup>{2/3}) when no threshold kk is provided.

Citations (6)

Summary

No one has generated a summary of this paper yet.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Continue Learning

We haven't generated follow-up questions for this paper yet.