Approximate Online Pattern Matching in Sub-linear Time
Abstract
We consider the approximate pattern matching problem under edit distance. In this problem we are given a pattern of length and a text of length over some alphabet , and a positive integer . The goal is to find all the positions in such that there is a substring of ending at which has edit distance at most from the pattern . Recall, the edit distance between two strings is the minimum number of character insertions, deletions, and substitutions required to transform one string into the other. For a position in , let be the smallest edit distance between and any substring of ending at . In this paper we give a constant factor approximation to the sequence . We consider both offline and online settings. In the offline setting, where both and are available, we present an algorithm that for all in , computes the value of approximately within a constant factor. The worst case running time of our algorithm is . As a consequence we break the -time barrier for this problem. In the online setting, we are given and then arrives one symbol at a time. We design an algorithm that upon arrival of the -th symbol of computes approximately within -multiplicative factor and -additive error. Our algorithm takes amortized time per symbol arrival and takes additional space apart from storing the pattern . Both of our algorithms are randomized and produce correct answer with high probability. To the best of our knowledge this is the first worst-case sub-linear (in the length of the pattern) time and sub-linear succinct space algorithm for online approximate pattern matching problem.
Cite
@article{arxiv.1810.03551,
title = {Approximate Online Pattern Matching in Sub-linear Time},
author = {Diptarka Chakraborty and Debarati Das and Michal Koucky},
journal= {arXiv preprint arXiv:1810.03551},
year = {2018}
}