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⋅⌈log2(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.
- approximate string matching
- circular strings
- bit-parallel automata
Hirvola, T., & Tarhio, J. (2017). Bit-parallel approximate matching of circular strings with k mismatches. ACM Journal of Experimental Algorithmics, 22(1), 1-12. [1.5]. https://doi.org/10.1145/3129536