Skip to main content

A Black Box for Online Approximate Pattern Matching

  • Conference paper

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 5029))

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

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Abrahamson, K.: Generalized string matching. SIAM journal on Computing 16(6), 1039–1051 (1987)

    Article  MATH  MathSciNet  Google Scholar 

  2. Amir, A., Farach, M.: Efficient 2-dimensional approximate matching of half-rectangular figures. Information and Computation 118(1), 1–11 (1995)

    Article  MATH  MathSciNet  Google Scholar 

  3. 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)

    Google Scholar 

  4. Amir, A., Lewenstein, M., Porat, E.: Faster algorithms for string matching with k mismatches. J. Algorithms 50(2), 257–275 (2004)

    Article  MATH  MathSciNet  Google Scholar 

  5. 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)

    Article  MATH  MathSciNet  Google Scholar 

  6. Clifford, P., Clifford, R.: Simple deterministic wildcard matching. Information Processing Letters 101(2), 53–54 (2007)

    Article  MathSciNet  Google Scholar 

  7. 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)

    Google Scholar 

  8. Clifford, R., Iliopoulos, C.: String algorithms in music analysis. Soft Computing 8(9), 597–603 (2004)

    Article  MATH  Google Scholar 

  9. 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)

    Google Scholar 

  10. 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)

    Chapter  Google Scholar 

  11. Cormen, T.H., Leiserson, C.E., Rivest, R.L.: Introduction to Algorithms. MIT Press, Cambridge (1990)

    Google Scholar 

  12. 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)

    Google Scholar 

  13. 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)

    Google Scholar 

  14. Henzinger, M.R., Raghavan, P., Rajagopalan, S.: Computing on data streams. In: External memory algorithms, pp. 107–118. American Mathematical Society, Boston (1999)

    Google Scholar 

  15. 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)

    Google Scholar 

  16. 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)

    Google Scholar 

  17. Kosaraju, S.R.: Efficient string matching (1987) (manuscript)

    Google Scholar 

  18. Landau, G.M., Vishkin, U.: Efficient string matching with k mismatches. Theoretical Computer Science 43, 239–249 (1986)

    Article  MATH  MathSciNet  Google Scholar 

  19. 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)

    Google Scholar 

  20. Muthukrishnan, S.: Data streams: algorithms and applications. In: SODA 2003: Proceedings of the fourteenth annual ACM-SIAM symposium on Discrete algorithms, p. 413 (2003)

    Google Scholar 

  21. Tamm, U.: Communication complexity of sum-type functions invariant under translation. Inf. Comput. 116(2), 162–173 (1995)

    Article  MATH  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Paolo Ferragina Gad M. Landau

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics