On pattern matching with k mismatches and few don't cares
Abstract
We consider the problem of pattern matching with mismatches, where there can be don't care or wild card characters in the pattern. Specifically, given a pattern of length and a text of length , we want to find all occurrences of in that have no more than mismatches. The pattern can have don't care characters, which match any character. Without don't cares, the best known algorithm for pattern matching with mismatches has a runtime of . With don't cares in the pattern, the best deterministic algorithm has a runtime of . Therefore, there is an important gap between the versions with and without don't cares. In this paper we give an algorithm whose runtime increases with the number of don't cares. We define an {\em island} to be a maximal length substring of that does not contain don't cares. Let be the number of islands in . We present an algorithm that runs in time. If the number of islands is this runtime becomes , which essentially matches the best known runtime for pattern matching with mismatches without don't cares. If the number of islands is , this algorithm is asymptotically faster than the previous best algorithm for pattern matching with mismatches with don't cares in the pattern.
Keywords
Cite
@article{arxiv.1602.00621,
title = {On pattern matching with k mismatches and few don't cares},
author = {Marius Nicolae and Sanguthevar Rajasekaran},
journal= {arXiv preprint arXiv:1602.00621},
year = {2016}
}
Comments
Information Processing Letters, Available online 27 October 2016, ISSN 0020-0190