English

Space-Efficient k-Mismatch Text Indexes

Data Structures and Algorithms 2025-10-31 v1

Abstract

A central task in string processing is text indexing, where the goal is to preprocess a text (a string of length nn) into an efficient index (a data structure) supporting queries about the text. Cole, Gottlieb, and Lewenstein (STOC 2004) proposed kk-errata trees, a family of text indexes supporting approximate pattern matching queries of several types. In particular, kk-errata trees yield an elegant solution to kk-mismatch queries, where we are to report all substrings of the text with Hamming distance at most kk to the query pattern. The resulting kk-mismatch index uses O(nlogkn)O(n\log^k n) space and answers a query for a length-mm pattern in O(logknloglogn+m+occ)O(\log^k n \log \log n + m + occ) time, where occocc is the number of approximate occurrences. In retrospect, kk-errata trees appear very well optimized: even though a large body of work has adapted kk-errata trees to various settings throughout the past two decades, the original time-space trade-off for kk-mismatch indexing has not been improved in the general case. We present the first such improvement, a kk-mismatch index with O(nlogk1n)O(n\log^{k-1} n) space and the same query time as kk-errata trees. Previously, due to a result of Chan, Lam, Sung, Tam, and Wong (Algorithmica 2010), such an O(nlogk1n)O(n\log^{k-1} n)-size index has been known only for texts over alphabets of constant size. In this setting, however, we obtain an even smaller kk-mismatch index of size only O(nlogk2+ε+2k+2(kmod2)n)O(nlogk1.5+εn)O(n \log^{k-2+\varepsilon+\frac{2}{k+2-(k \bmod 2)}} n)\subseteq O(n\log^{k-1.5+\varepsilon} n) for 2kO(1)2\le k\le O(1) and any constant ε>0\varepsilon>0. Along the way, we also develop improved indexes for short patterns, offering better trade-offs in this practically relevant special case.

Keywords

Cite

@article{arxiv.2510.26264,
  title  = {Space-Efficient k-Mismatch Text Indexes},
  author = {Tomasz Kociumaka and Jakub Radoszewski},
  journal= {arXiv preprint arXiv:2510.26264},
  year   = {2025}
}

Comments

SODA 2026

R2 v1 2026-07-01T07:13:26.425Z