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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
A. V. Aho and M. J. Corasick. Efficient string matching: an aid to bibliographic search. Commun. ACM, 18(6):333–340, 1975.
A. Amir, G. Benson, and M. Farach. An alphabet independent approach to two-dimensional pattern matching. SIAM J. Comput., 23(2):313–323, 1994.
A. Amir, A. Butman, M. Crochemore, G.M. Landau, and M. Schaps. Two-dimensional pattern matching with rotations. Submitted for publication, 2002.
R. Baeza-Yates and G. Navarro. New models and algorithms for multidimensional approximate pattern matching. J. Discret. Algorithms, 1(1):21–49, 2000.
R. A. Baeza-Yates and M. Régnier. Fast two-dimensional pattern matching. Inf. Process. Lett., 45(1):51–57, 1993.
L. G. Brown. A survey of image registration techniques. ACM Computing Surveys, 24(4):325–376, 1992.
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.
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.
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.
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.
K. Fredriksson and E. Ukkonen. Combinatorial methods for approximate image matching under translations and rotations. Patt. Recog. Letters, 20(11–-13):1249–1258, 1999.
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.
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.
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.
R. L. Rivest. Partial-match retrieval algorithms. SIAM J. Comput., 5(1):19–50, 1976.
S. Wu and U. Manber. Fast text searching allowing errors. Commun. ACM, 35(10):83–91, 1992.
A. C. Yao. The complexity of pattern matching for a random string. SIAM J. Comput., 8(3):368–387, 1979.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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