English

Streaming dictionary matching with mismatches

Data Structures and Algorithms 2021-06-22 v3

Abstract

In the kk-mismatch problem we are given a pattern of length nn and a text and must find all locations where the Hamming distance between the pattern and the text is at most kk. A series of recent breakthroughs have resulted in an ultra-efficient streaming algorithm for this problem that requires only O(klognk)O(k \log \frac{n}{k}) space and O(lognk(klogk+log3n))O(\log \frac{n}{k} (\sqrt{k \log k} + \log^3 n)) time per letter [Clifford, Kociumaka, Porat, SODA 2019]. In this work, we consider a strictly harder problem called dictionary matching with kk mismatches. In this problem, we are given a dictionary of dd patterns, where the length of each pattern is at most nn, and must find all substrings of the text that are within Hamming distance kk from one of the patterns. We develop a streaming algorithm for this problem with O(kdlogkdpolylog(n))O(k d \log^k d \mathrm{polylog}(n)) space and O(klogkdpolylog(n)+occ)O(k \log^{k} d \mathrm{polylog}(n) + |\mathrm{occ}|) time per position of the text. The algorithm is randomised and outputs correct answers with high probability. On the lower bound side, we show that any streaming algorithm for dictionary matching with kk mismatches requires Ω(kd)\Omega(k d) bits of space.

Keywords

Cite

@article{arxiv.1809.02517,
  title  = {Streaming dictionary matching with mismatches},
  author = {Paweł Gawrychowski and Tatiana Starikovskaya},
  journal= {arXiv preprint arXiv:1809.02517},
  year   = {2021}
}
R2 v1 2026-06-23T03:58:06.004Z