Skip to main content

Optimal Exact and Fast Approximate Two Dimensional Pattern Matching Allowing Rotations

  • Conference paper
  • First Online:
Combinatorial Pattern Matching (CPM 2002)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2373))

Included in the following conference series:

Abstract

We give fast filtering algorithms to search for a 2-dimensional pattern in a 2-dimensional text allowing any rotation of the pattern. We consider the cases of exact and approximate matching under several matching models, improving the previous results. For a text of size n × n characters and a pattern of size m × m characters, the exact matching takes average time O(n 2 log m/m 2), which is optimal. If we allow k mismatches of characters, then our best algorithm achieves O(n 2 k log m/m 2) average time, for reasonable k values. For large k, we obtain an O(n 2 k 3/2 √log m/m) average time algorithm. We generalize the algorithms for the matching model where the sum of absolute differences between characters is at most k. Finally, we show how to make the algorithms optimal in the worst case, achieving the lower bound Ω(n 2 m 3).

Work supported by ComBi and the Academy of Finland.

Partially supported by the Millenium Center for Web Research.

Work supported by the Academy of Finland.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

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

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. A. V. Aho and M. J. Corasick. Efficient string matching: an aid to bibliographic search. Commun. ACM, 18(6):333–340, 1975.

    Article  MATH  MathSciNet  Google Scholar 

  2. A. Amir, G. Benson, and M. Farach. An alphabet independent approach to two-dimensional pattern matching. SIAM J. Comput., 23(2):313–323, 1994.

    Article  MATH  MathSciNet  Google Scholar 

  3. A. Amir, A. Butman, M. Crochemore, G.M. Landau, and M. Schaps. Two-dimensional pattern matching with rotations. Submitted for publication, 2002.

    Google Scholar 

  4. R. Baeza-Yates and G. Navarro. New models and algorithms for multidimensional approximate pattern matching. J. Discret. Algorithms, 1(1):21–49, 2000.

    MathSciNet  Google Scholar 

  5. R. A. Baeza-Yates and M. Régnier. Fast two-dimensional pattern matching. Inf. Process. Lett., 45(1):51–57, 1993.

    Article  MATH  Google Scholar 

  6. L. G. Brown. A survey of image registration techniques. ACM Computing Surveys, 24(4):325–376, 1992.

    Article  Google Scholar 

  7. W.I. Chang and T. Marr. Approximate string matching with local similarity. In Proc. 5th Combinatorial Pattern Matching (CPM’94), LNCS 807, pages 259–273, 1994.

    Google Scholar 

  8. M. Crochemore, A. Czumaj, L. Gcasieniec, T. Lecroq, W. Plandowski, and W. Rytter. Fast practical multi-pattern matching. Inf. Process. Lett., 71(3–-4):107–113, 1999.

    Article  MATH  Google Scholar 

  9. K. Fredriksson. Rotation invariant histogram filters for similarity and distance measures between digital images. In Proc. 7th String Processing and Information Retrieval (SPIRE’2000), pages 105–115. IEEE CS Press, 2000.

    Google Scholar 

  10. K. Fredriksson and E. Ukkonen. A rotation invariant filter for two-dimensional string matching. In Proc. 9th Combinatorial Pattern Matching (CPM’98), LNCS 1448, pages 118–125, 1998.

    Chapter  Google Scholar 

  11. K. Fredriksson and E. Ukkonen. Combinatorial methods for approximate image matching under translations and rotations. Patt. Recog. Letters, 20(11–-13):1249–1258, 1999.

    Article  Google Scholar 

  12. K. Fredriksson and E. Ukkonen. Combinatorial methods for approximate pattern matching under rotations and translations in 3d arrays. In Proc. 7th String Processing and Information Retrieval (SPIRE’2000), pages 96–104. IEEE CS Press, 2000.

    Google Scholar 

  13. G. Navarro K. Fredriksson and E. Ukkonen. An index for two dimensional string matching allowing rotations. In J. van Leeuwen, O. Watanabe, M. Hagiya, P.D. Mosses, and T. Ito, editors, IFIP TCS2000, LNCS 1872, pages 59–75, 2000.

    Google Scholar 

  14. J. Kärkkäinen and E. Ukkonen. Two-and higher-dimensional pattern matching in optimal expected time. SIAM J. Comput., 29(2):571–589, 2000.

    Article  Google Scholar 

  15. R. L. Rivest. Partial-match retrieval algorithms. SIAM J. Comput., 5(1):19–50, 1976.

    Article  MATH  MathSciNet  Google Scholar 

  16. S. Wu and U. Manber. Fast text searching allowing errors. Commun. ACM, 35(10):83–91, 1992.

    Article  Google Scholar 

  17. A. C. Yao. The complexity of pattern matching for a random string. SIAM J. Comput., 8(3):368–387, 1979.

    Article  MATH  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2002 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Fredriksson, K., Navarro, G., Ukkonen, E. (2002). Optimal Exact and Fast Approximate Two Dimensional Pattern Matching Allowing Rotations. In: Apostolico, A., Takeda, M. (eds) Combinatorial Pattern Matching. CPM 2002. Lecture Notes in Computer Science, vol 2373. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45452-7_20

Download citation

  • DOI: https://doi.org/10.1007/3-540-45452-7_20

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-43862-5

  • Online ISBN: 978-3-540-45452-6

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics