English

Faster Approximate(d) Text-to-Pattern L1 Distance

Data Structures and Algorithms 2018-05-04 v2

Abstract

The problem of finding \emph{distance} between \emph{pattern} of length mm and \emph{text} of length nn is a typical way of generalizing pattern matching to incorporate dissimilarity score. For both Hamming and L1L_1 distances only a super linear upper bound O~(nm)\widetilde{O}(n\sqrt{m}) are known, which prompts the question of relaxing the problem: either by asking for (1±ε)(1 \pm \varepsilon) approximate distance (every distance is reported up to a multiplicative factor), or kk-approximated distance (distances exceeding kk are reported as \infty). We focus on L1L_1 distance, for which we show new algorithms achieving complexities respectively O~(ε1n)\widetilde{O}(\varepsilon^{-1} n) and O~((m+km)n/m)\widetilde{O}((m+k\sqrt{m}) \cdot n/m). This is a significant improvement upon previous algorithms with runtime O~(ε2n)\widetilde{O}(\varepsilon^{-2} n) of Lipsky and Porat [Algorithmica 2011] and O~(nk)\widetilde{O}(n\sqrt{k}) of Amir, Lipsky, Porat and Umanski [CPM 2005].

Keywords

Cite

@article{arxiv.1801.09159,
  title  = {Faster Approximate(d) Text-to-Pattern L1 Distance},
  author = {Przemysław Uznański},
  journal= {arXiv preprint arXiv:1801.09159},
  year   = {2018}
}
R2 v1 2026-06-22T23:59:34.350Z