A Note on a Tree-Based 2D Indexing

  • Jan Žd’árek
  • Bořivoj Melichar
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6482)


A new approach to the 2D pattern matching and specifically to 2D text indexing is proposed. We present the transformation of 2D structures into the form of a tree, preserving the context of each element of the structure. The tree can be linearised using the prefix notation into the form of a text (a string) and we do the pattern matching in this text. Over this representation pushdown automata indexing the 2D text are constructed. They allow to search for 2D prefixes, suffixes, or factors of the 2D text in time proportional to the size of the representation of a 2D pattern. This result achieves the properties analogous to the results obtained in tree pattern matching and string indexing.


Pattern Match Tree Pattern Tree Representation Tree Automaton Pushdown Automaton 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Giammarresi, D., Restivo, A.: Two-dimensional languages. In: Handbook of Formal Languages, vol. III, pp. 216–267. Springer, Heidelberg (1997)Google Scholar
  2. 2.
    Giancarlo, R., Grossi, R.: Suffix tree data structures for matrices. In: Apostolico, A., Galil, Z. (eds.) Pattern Matching Algorithms, pp. 293–340. Oxford University Press, Oxford (1997)Google Scholar
  3. 3.
    Gonnet, G.H.: Efficient searching of text and pictures. Report OED-88-02, University of Waterloo (1988)Google Scholar
  4. 4.
    Giancarlo, R.: A generalization of the suffix tree to square matrices, with applications. SIAM J. Comput. 24(3), 520–562 (1995)MathSciNetCrossRefzbMATHGoogle Scholar
  5. 5.
    Amir, A., Farach, M.: Two-dimensional dictionary matching. Inf. Process. Lett. 44(5), 233–239 (1992)MathSciNetCrossRefzbMATHGoogle Scholar
  6. 6.
    Kim, D.K., Kim, Y.A., Park, K.: Generalizations of suffix arrays to multi-dimensional matrices. Theor. Comput. Sci. 302(1-3), 401–416 (2003)MathSciNetCrossRefzbMATHGoogle Scholar
  7. 7.
    Na, J.C., Giancarlo, R., Park, K.: On-line construction of two-dimensional suffix tree in \(\mathcal{O}(n^2 \log n)\) time. Algorithmica 48, 173–186 (2007)MathSciNetCrossRefzbMATHGoogle Scholar
  8. 8.
    Kim, D.K., Kim, Y.A., Park, K.: Constructing suffix arrays for multi-dimensional matrices. In: Farach-Colton, M. (ed.) CPM 1998. LNCS, vol. 1448, pp. 126–139. Springer, Heidelberg (1998)CrossRefGoogle Scholar
  9. 9.
    Giancarlo, R., Grossi, R.: On the construction of classes of suffix trees for square matrices: Algorithms and applications. Inf. Comput. 130(2), 151–182 (1996)MathSciNetCrossRefzbMATHGoogle Scholar
  10. 10.
    Giancarlo, R.: An index data structure for matrices, with applications to fast two-dimensional pattern matching. In: Dehne, F., et al. (eds.) WADS 1993. LNCS, vol. 709, pp. 337–348. Springer, Heidelberg (1993)CrossRefGoogle Scholar
  11. 11.
    Giancarlo, R., Grossi, R.: Multi-dimensional pattern matching with dimensional wildcards: Data structures and optimal on-line search algorithms. J. Algorithms 24(2), 223–265 (1997)MathSciNetCrossRefzbMATHGoogle Scholar
  12. 12.
    Inoue, K., Nakamura, A.: Some properties of two-dimensional on-line tessellation acceptors. Inf. Sci. 13(2), 95–121 (1977)MathSciNetCrossRefzbMATHGoogle Scholar
  13. 13.
    Janoušek, J.: String suffix automata and subtree pushdown automata. In: Holub, J., Žd’árek, J. (eds.) Proc. PSC 2009, CTU in Prague, Czech Republic, pp. 160–172 (2009)Google Scholar
  14. 14.
    Comon, H., et al.: Tree automata techniques and applications (2007), (release October 12, 2007)
  15. 15.
    Cleophas, L.: Tree Algorithms. Two Taxonomies and a Toolkit. PhD thesis, Technische Universiteit Eindhoven, Eindhoven (2008)Google Scholar
  16. 16.
    Flouri, T., Janoušek, J., Melichar, B.: Tree pattern matching by deterministic pushdown automata. In: Ganzha, M., Paprzycki, M. (eds.) Proc. IMCSIT, vol. 4, pp. 659–666. IEEE Computer Society Press, Los Alamitos (2009)Google Scholar
  17. 17.
    Olsen, G.: “Newick’s 8:45” tree format standard (August 1990),
  18. 18.
    Wagner, K., Wechsung, G.: Computational Complexity. Springer, Heidelberg (2001)zbMATHGoogle Scholar
  19. 19.
    Žd’árek, J.: Two-dimensional Pattern Matching Using Automata Approach. PhD thesis, Czech Technical University in Prague (2010),

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • Jan Žd’árek
    • 1
  • Bořivoj Melichar
    • 1
  1. 1.Department of Theoretical Computer Science, Faculty of Information TechnologyCzech Technical UniversityPragueCzech Republic

Personalised recommendations