English

Approximate pattern matching with k-mismatches in packed text

Data Structures and Algorithms 2013-08-01 v3

Abstract

Given strings PP of length mm and TT of length nn over an alphabet of size σ\sigma, the string matching with kk-mismatches problem is to find the positions of all the substrings in TT that are at Hamming distance at most kk from PP. If TT can be read only one character at the time the best known bounds are O(nklogk)O(n\sqrt{k\log k}) and O(n+nk/wlogk)O(n + n\sqrt{k/w}\log k) in the word-RAM model with word length ww. In the RAM models (including AC0AC^0 and word-RAM) it is possible to read up to \floorw/logσ\floor{w / \log \sigma} characters in constant time if the characters of TT are encoded using \ceillogσ\ceil{\log \sigma} bits. The only solution for kk-mismatches in packed text works in O((nlogσ/logn)\ceilmlog(k+logn/logσ)/w+nε)O((n \log\sigma/\log n)\ceil{m \log (k + \log n / \log\sigma) / w} + n^{\varepsilon}) time, for any ε>0\varepsilon > 0. We present an algorithm that runs in time O(n\floorw/(mlogσ)(1+logmin(k,σ)logm/logσ))O(\frac{n}{\floor{w/(m\log\sigma)}} (1 + \log \min(k,\sigma) \log m / \log\sigma)) in the AC0AC^0 model if m=O(w/logσ)m=O(w / \log\sigma) and TT is given packed. We also describe a simpler variant that runs in time O(n\floorw/(mlogσ)logmin(m,logw/logσ))O(\frac{n}{\floor{w/(m\log\sigma)}}\log \min(m, \log w / \log\sigma)) in the word-RAM model. The algorithms improve the existing bound for w=Ω(log1+ϵn)w = \Omega(\log^{1+\epsilon}n), for any ϵ>0\epsilon > 0. Based on the introduced technique, we present algorithms for several other approximate matching problems.

Keywords

Cite

@article{arxiv.1211.5433,
  title  = {Approximate pattern matching with k-mismatches in packed text},
  author = {Emanuele Giaquinta and Szymon Grabowski and Kimmo Fredriksson},
  journal= {arXiv preprint arXiv:1211.5433},
  year   = {2013}
}

Comments

This paper is an extended version of the article that appeared in Information Processing Letters 113(19-21):693-697 (2013), http://dx.doi.org/10.1016/j.ipl.2013.07.002

R2 v1 2026-06-21T22:43:01.299Z