A Novel Algorithm for String Matching with Mismatches

P. Vinod-prasad · 2016

We present an online algorithm to deal with pattern matching in strings. The problem we investigate is commonly known as ‘string matching with mismatches’ in which the objective is to report the number of characters that match when a pattern is aligned with every location in the text. The novel method we propose is based on the frequencies of individual characters in the pattern and the text. Given a pattern of length M, and the text of length N, both defined over an alphabet of size Iƒ, the algorithm consumes O(M) space and executes in O(MN/Iƒ) time on the average. The average execution time O(MN/Iƒ) simplifies to O(N) for patterns of size M ≤ Iƒ. The algorithm makes use of simple arrays, which reduces the cost overhead to maintain the complex data structures such as suffix trees or automaton.

Read the paper · More papers on PaperTik