Abstract
We present a deterministic black box solution for online approximate matching. Given a pattern of length m and a streaming text of length n that arrives one character at a time, the task is to report the distance between the pattern and a sliding window of the text as soon as the new character arrives. Our solution requires \(O(\Sigma_{j=1}^{\log_2{m}} T(n,2^{j-1})/n)\) time for each input character, where T(n,m) is the total running time of the best offline algorithm. The types of approximation that are supported include exact matching with wildcards, matching under the Hamming norm, approximating the Hamming norm, k-mismatch and numerical measures such as the L 2 and L 1 norms. For these examples, the resulting online algorithms take O(log2 m), \(O(\sqrt{m\log{m}})\), O(log2 m/ε 2), \(O(\sqrt{k \log k} \log{m})\), O(log2 m) and \(O(\sqrt{m\log{m}})\) time per character respectively. The space overhead is O(m) which we show is optimal.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Abrahamson, K.: Generalized string matching. SIAM journal on Computing 16(6), 1039–1051 (1987)
Amir, A., Farach, M.: Efficient 2-dimensional approximate matching of half-rectangular figures. Information and Computation 118(1), 1–11 (1995)
Amir, A., Lipsky, O., Porat, E., Umanski, J.: Approximate matching in the L 1 metric. In: Apostolico, A., Crochemore, M., Park, K. (eds.) CPM 2005. LNCS, vol. 3537, pp. 91–103. Springer, Heidelberg (2005)
Amir, A., Lewenstein, M., Porat, E.: Faster algorithms for string matching with k mismatches. J. Algorithms 50(2), 257–275 (2004)
Atallah, M.J.: Faster image template matching in the sum of the absolute value of differences measure. IEEE Transactions on Image Processing 10(4), 659–663 (2001)
Clifford, P., Clifford, R.: Simple deterministic wildcard matching. Information Processing Letters 101(2), 53–54 (2007)
Clifford, P., Clifford, R., Iliopoulos, C.S.: Faster algorithms for δ,γ-matching and related problems. In: Apostolico, A., Crochemore, M., Park, K. (eds.) CPM 2005. LNCS, vol. 3537, pp. 68–78. Springer, Heidelberg (2005)
Clifford, R., Iliopoulos, C.: String algorithms in music analysis. Soft Computing 8(9), 597–603 (2004)
Clifford, R., Efremenko, K., Porat, E., Rothschild, A.: k-mismatch with don’t cares. In: Arge, L., Hoffmann, M., Welzl, E. (eds.) ESA 2007. LNCS, vol. 4698, pp. 151–162. Springer, Heidelberg (2007)
Clifford, R., Porat, E.: A filtering algorithm for k-mismatch with don’t cares. In: Ziviani, N., Baeza-Yates, R. (eds.) SPIRE 2007. LNCS, vol. 4726, pp. 130–136. Springer, Heidelberg (2007)
Cormen, T.H., Leiserson, C.E., Rivest, R.L.: Introduction to Algorithms. MIT Press, Cambridge (1990)
Cole, R., Hariharan, R.: Verifying candidate matches in sparse and wildcard matching. In: Proceedings of the Annual ACM Symposium on Theory of Computing, pp. 592–601 (2002)
Fischer, M., Paterson, M.: String matching and other products. In: Karp, R. (ed.) Proceedings of the 7th SIAM-AMS Complexity of Computation, pp. 113–125 (1974)
Henzinger, M.R., Raghavan, P., Rajagopalan, S.: Computing on data streams. In: External memory algorithms, pp. 107–118. American Mathematical Society, Boston (1999)
Indyk, P.: Faster algorithms for string matching problems: Matching the convolution bound. In: Proceedings of the 38th Annual Symposium on Foundations of Computer Science, pp. 166–173 (1998)
Kalai, A.: Efficient pattern-matching with don’t cares. In: Proceedings of the 13th Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 655–656 (2002)
Kosaraju, S.R.: Efficient string matching (1987) (manuscript)
Landau, G.M., Vishkin, U.: Efficient string matching with k mismatches. Theoretical Computer Science 43, 239–249 (1986)
Lipsky, O., Porat, E.: Approximate matching in the L ∞ metric. In: String Processing and Information Retrieval, 12th International Symposium (SPIRE 2005). LNCS, pp. 331–334. Springer, Heidelberg (2005)
Muthukrishnan, S.: Data streams: algorithms and applications. In: SODA 2003: Proceedings of the fourteenth annual ACM-SIAM symposium on Discrete algorithms, p. 413 (2003)
Tamm, U.: Communication complexity of sum-type functions invariant under translation. Inf. Comput. 116(2), 162–173 (1995)
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 2008 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Clifford, R., Efremenko, K., Porat, B., Porat, E. (2008). A Black Box for Online Approximate Pattern Matching. In: Ferragina, P., Landau, G.M. (eds) Combinatorial Pattern Matching. CPM 2008. Lecture Notes in Computer Science, vol 5029. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-69068-9_15
Download citation
DOI: https://doi.org/10.1007/978-3-540-69068-9_15
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-69066-5
Online ISBN: 978-3-540-69068-9
eBook Packages: Computer ScienceComputer Science (R0)