Skip to main content

Template-Based Pattern Matching in Two-Dimensional Arrays

  • Conference paper
  • First Online:
Book cover Combinatorial Image Analysis (IWCIA 2017)

Part of the book series: Lecture Notes in Computer Science ((LNIP,volume 10256))

Included in the following conference series:

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.

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 EPUB and 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

Notes

  1. 1.

    The proposed automaton model g2h-DFA is different from the traditional two-headed finite automaton that has two read-only bidirectional heads.

References

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

    Google Scholar 

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

  3. Angluin, D.: Inference of reversible languages. J. ACM 29(3), 741–765 (1982)

    Article  MathSciNet  MATH  Google Scholar 

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

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

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

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

    Chapter  Google Scholar 

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

    Chapter  Google Scholar 

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

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

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

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

    Google Scholar 

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

    Chapter  Google Scholar 

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

  15. Tamm, H., Ukkonen, E.: Bideterministic automata and minimal representations of regular languages. Theoret. Comput. Sci. 328(1–2), 135–149 (2004)

    Article  MathSciNet  MATH  Google Scholar 

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

Download references

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

Authors

Corresponding author

Correspondence to Daniel Průša .

Editor information

Editors and Affiliations

Rights and permissions

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

Publish with us

Policies and ethics