English

Faster ED-String Matching with $k$ Mismatches

Data Structures and Algorithms 2025-03-04 v1

Abstract

We revisit the complexity of approximate pattern matching in an elastic-degenerate string. Such a string is a sequence of nn finite sets of strings of total length NN, and compactly describes a collection of strings obtained by first choosing exactly one string in every set, and then concatenating them together. This is motivated by the need of storing a collection of highly similar DNA sequences. The basic algorithmic question on elastic-degenerate strings is pattern matching: given such an elastic-degenerate string and a standard pattern of length mm, check if the pattern occurs in one of the strings in the described collection. Bernardini et al.~[SICOMP 2022] showed how to leverage fast matrix multiplication to obtain an O~(nmω1)+O(N)\tilde{\mathcal{O}}(nm^{\omega-1})+\mathcal{O}(N)-time complexity for this problem, where ww is the matrix multiplication exponent. However, the best result so far for finding occurrences with kk mismatches, where kk is a constant, is the O~(nm2+N)\tilde{\mathcal{O}}(nm^{2}+N)-time algorithm of Pissis et al.~[CPM 2025]. This brings the question whether increasing the dependency on mm from mω1m^{\omega-1} to quadratic is necessary when moving from k=0k=0 to larger (but still constant) kk. We design an O~(nm1.5+N)\tilde{\mathcal{O}}(nm^{1.5}+N)-time algorithm for pattern matching with kk mismatches in an elastic-degenerate string, for any constant kk. To obtain this time bound, we leverage the structural characterization of occurrences with kk mismatches of Charalampopoulos et al.~[FOCS 2020] together with fast Fourier transform. We need to work with multiple patterns at the same time, instead of a single pattern, which requires refining the original characterization. This might be of independent interest.

Keywords

Cite

@article{arxiv.2503.01388,
  title  = {Faster ED-String Matching with $k$ Mismatches},
  author = {Paweł Gawrychowski and Adam Górkiewicz and Pola Marciniak and Solon P. Pissis and Karol Pokorski},
  journal= {arXiv preprint arXiv:2503.01388},
  year   = {2025}
}
R2 v1 2026-06-28T22:04:25.375Z