Approximate point set pattern matching with Lp-norm
SPIRE'11 Proceedings of the 18th international conference on String processing and information retrieval
One-dimensional approximate point set pattern matching with Lp-norm
Theoretical Computer Science
Hi-index | 0.00 |
Given an alphabet Σ={1,2,…,|Σ|} text string T∈Σn and a pattern string P∈Σm , for each i=1,2,…,n−m+1 define L p (i) as the p-norm distance when the pattern is aligned below the text and starts at position i of the text. The problem of pattern matching with L p distance is to compute L p (i) for every i=1,2,…,n−m+1. We discuss the problem for d=1,2,∞. First, in the case of L 1 matching (pattern matching with an L 1 distance) we show a reduction of the string matching with mismatches problem to the L 1 matching problem and we present an algorithm that approximates the L 1 matching up to a factor of 1+ε, which has an $O(\frac{1}{\varepsilon^{2}}n\log m\log|\Sigma|)$ run time. Then, the L 2 matching problem (pattern matching with an L 2 distance) is solved with a simple O(nlog m) time algorithm. Finally, we provide an algorithm that approximates the L ∞ matching up to a factor of 1+ε with a run time of $O(\frac{1}{\varepsilon}n\log m\log|\Sigma|)$. We also generalize the problem of String Matching with mismatches to have weighted mismatches and present an O(nlog 4 m) algorithm that approximates the results of this problem up to a factor of O(log m) in the case that the weight function is a metric.