The Dynamic k-Mismatch Problem
Abstract
The text-to-pattern Hamming distances problem asks to compute the Hamming distances between a given pattern of length and all length- substrings of a given text of length . We focus on the -mismatch version of the problem, where a distance needs to be returned only if it does not exceed a threshold . We assume (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 , returns the Hamming distance between the pattern and the text substring starting at position , or reports that it exceeds . First, we show a data structure with update and query time. Then we show that update and query time is also possible. These two provide an optimal trade-off for the dynamic -mismatch problem with : we prove that, conditioned on the strong 3SUM conjecture, one cannot simultaneously achieve time for all operations. For , we give another lower bound, conditioned on the Online Matrix-Vector conjecture, that excludes algorithms taking time per operation. This is tight for constant-sized alphabets: Clifford et al. (STACS 2018) achieved time per operation in that case, but with time per operation for large alphabets. We improve and extend this result with an algorithm that, given , achieves update time and query time . In particular, for , an appropriate choice of yields time per operation, which is when no threshold is provided.
Cite
@article{arxiv.2105.06166,
title = {The Dynamic k-Mismatch Problem},
author = {Raphaël Clifford and Paweł Gawrychowski and Tomasz Kociumaka and Daniel P. Martin and Przemysław Uznański},
journal= {arXiv preprint arXiv:2105.06166},
year = {2022}
}