English

Hamming Distance Oracle

Data Structures and Algorithms 2024-07-09 v1

Abstract

In this paper, we present and study the \emph{Hamming distance oracle problem}. In this problem, the task is to preprocess two strings SS and TT of lengths nn and mm, respectively, to obtain a data-structure that is able to answer queries regarding the Hamming distance between a substring of SS and a substring of TT. For a constant size alphabet strings, we show that for every xnmx\le nm there is a data structure with O~(nm/x)\tilde{O}(nm/x) preprocess time and O(x)O(x) query time. We also provide a combinatorial conditional lower bound, showing that for every ε>0\varepsilon > 0 and xnmx \le nm there is no data structure with query time O(x)O(x) and preprocess time O((nmx)1ε)O((\frac{nm}{x})^{1-\varepsilon}) unless combinatorial fast matrix multiplication is possible. For strings over general alphabet, we present a data structure with O~(nm/x)\tilde{O}(nm/\sqrt{x}) preprocess time and O(x)O(x) query time for every xnmx \le nm.

Keywords

Cite

@article{arxiv.2407.05430,
  title  = {Hamming Distance Oracle},
  author = {Itai Boneh and Dvir Fried and Shay Golan and Matan Kraus},
  journal= {arXiv preprint arXiv:2407.05430},
  year   = {2024}
}
R2 v1 2026-06-28T17:32:00.796Z