Abstract
We propose a framework for pattern matching in two-dimensional arrays of symbols where the patterns are described by an extended version of the regular matrix grammar and the size of desired matches is prescribed. We then demonstrate how to reformulate the 2D pattern matching as the one-dimensional pattern matching (string pattern matching), and study the efficiency of the string pattern matching algorithm based on pattern complexity with respect to two finite automaton models: (1) the classical finite automaton and (2) the finite automaton equipped with two scanning heads placed in a fixed distance. We also identify several subclasses of the considered templates for which the framework yields a more efficient matching than the naive algorithm.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 1.
The proposed automaton model g2h-DFA is different from the traditional two-headed finite automaton that has two read-only bidirectional heads.
References
Aho, A.V.: Algorithms for finding patterns in strings. In: van Leeuwen, J. (ed.) Algorithms and Complexity, Handbook of Theoretical Computer Science, vol. A, pp. 255–300. The MIT Press, Cambridge (1990)
Amir, A., Benson, G., Farach, M.: Alphabet independent two dimensional matching. In: Proceedings of the Twenty-fourth Annual ACM Symposium on Theory of Computing, STOC 1992, NY, USA, pp. 59–68 (1992). http://doi.acm.org/10.1145/129712.129719
Angluin, D.: Inference of reversible languages. J. ACM 29(3), 741–765 (1982)
Baeza-Yates, R., Régnier, M.: Fast two-dimensional pattern matching. Inf. Process. Lett. 45(1), 51–57 (1993). http://www.sciencedirect.com/science/article/pii/002001909390250D
Baker, T.P.: A technique for extending rapid exact-match string matching to arrays of more than one dimension. SIAM J. Comput. 7(4), 533–541 (1978). http://dx.doi.org/10.1137/0207043
Bird, R.S.: Two dimensional pattern matching. Inf. Process. Lett. 6(5), 168–170 (1977). http://dx.doi.org/10.1016/0020-0190(77)90017–5
Fernau, H., Paramasivan, M., Schmid, M.L., Thomas, D.G.: Scanning pictures the Boustrophedon way. In: Barneva, R.P., Bhattacharya, B.B., Brimkov, V.E. (eds.) IWCIA 2015. LNCS, vol. 9448, pp. 202–216. Springer, Cham (2015). doi:10.1007/978-3-319-26145-4_15
Giammarresi, D., Restivo, A.: Two-dimensional languages. In: Rozenberg, G., Salomaa, A. (eds.) Handbook of Formal Languages, vol. 3, pp. 215–267. Springer, New York (1997)
Kärkkäinen, J., Ukkonen, E.: Two and higher dimensional pattern matching in optimal expected time. In: Sleator, D.D. (ed.) Proceedings of the Fifth Annual ACM-SIAM Symposium on Discrete Algorithms, Arlington, Virginia, 23–25, pp. 715–723. ACM/SIAM (1994). http://dl.acm.org/citation.cfm?id=314464.314680
Karp, R.M., Rabin, M.O.: Efficient randomized pattern-matching algorithms. IBM J. Res. Dev. 31(2), 249–260 (1987). http://dx.doi.org/10.1147/rd.312.0249
Meduna, A., Zemek, P.: Jumping finite automata. Int. J. Found. Comput. Sci. 23(7), 1555–1578 (2012). http://www.fit.vutbr.cz/research/view_pub.php.cs?id=9795
Pin, J.-E.: On reversible automata. In: Simon, I. (ed.) LATIN 1992. LNCS, vol. 583, pp. 401–416. Springer, Heidelberg (1992). doi:10.1007/BFb0023844
Průša, D.: Complexity of sets of two-dimensional patterns. In: Han, Y.-S., Salomaa, K. (eds.) CIAA 2016. LNCS, vol. 9705, pp. 236–247. Springer, Cham (2016). doi:10.1007/978-3-319-40946-7_20
Siromoney, G., Siromoney, R., Krithivasan, K.: Abstract families of matrices and picture languages. Comput. Graph. Image Process. 1(3), 284–307 (1972). http://www.sciencedirect.com/science/article/pii/S0146664X72800194
Tamm, H., Ukkonen, E.: Bideterministic automata and minimal representations of regular languages. Theoret. Comput. Sci. 328(1–2), 135–149 (2004)
Zhu, R.F., Takaoka, T.: A technique for two-dimensional pattern matching. ACM Commun. 32(9), 1110–1120 (1989). http://doi.acm.org/10.1145/66451.66459
Acknowledgments
Han was supported by the Basic Science Research Program through NRF funded by MEST (2015R1D1A1A01060097) and the IITP grant funded by the Korea government (MSIP) (R0124-16-0002), and Průša was supported by the Czech Science Foundation under grant no. 15-04960S.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2017 Springer International Publishing AG
About this paper
Cite this paper
Han, YS., Průša, D. (2017). Template-Based Pattern Matching in Two-Dimensional Arrays. In: Brimkov, V., Barneva, R. (eds) Combinatorial Image Analysis. IWCIA 2017. Lecture Notes in Computer Science(), vol 10256. Springer, Cham. https://doi.org/10.1007/978-3-319-59108-7_7
Download citation
DOI: https://doi.org/10.1007/978-3-319-59108-7_7
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-59107-0
Online ISBN: 978-3-319-59108-7
eBook Packages: Computer ScienceComputer Science (R0)