Bit-Parallel Approximate Matching of Circular Strings with k Mismatches
Tommi Hirvola, Jorma Tarhio · ACM Journal of Experimental Algorithmics · 2017
We consider approximate string matching of a circular pattern consisting of the rotations of a pattern of length m . From SBNDM and Tuned Shift-Add, we derive a sublinear-time algorithm for searching a noncircular pattern with k allowed mismatches, which is extended to the problem of approximate circular pattern matching with k mismatches. We prove that the presented algorithms are average-optimal for m ⋅⌈log 2 ( k +1)+1 ⌉ = O ( w ), where w is the size of the computer word in bits. Experiments conducted under the aforementioned condition show that the new k -mismatches algorithm for circular strings outperforms previous solutions in practice. In particular, our algorithm is the first nonfiltering method for approximate circular string matching in sublinear average time, which makes it more suitable than earlier filtering methods for high error levels k / m and small alphabets.