We revisit the problem of indexing a string S[1..n] to support finding all substrings in S that match a given pattern P [1..m] with at most k errors. Previous solutions either require an index of size exponential in k or need (m k ) time for searching. Motivated by the indexing of DNA, we investigate space efficient indexes that occupy only O(n) space. For k = 1, we give an index to support matching in O(m + occ + log n log log n) time. The previously best solution achieving this time complexity requires an index of O(n log n) space. This new index can also be used to improve existing indexes for k ≥ 2 errors. Among others, it can support 2-error matching in O(m log n log log n + occ) time, and k-error matching, for any k > 2, in O(m k−1 log n log log n + occ) time.
Chan et al. REF O(n log n) O(m + log n log log n + occ)
Compressed Indexes for Approximate String Matching
Algorithmica
Algorithmica
Mathematics Computer Science