A Full and Linear Index of a Tree for Tree Patterns

  • Jan Janoušek
  • Bořivoj Melichar
  • Radomír Polách
  • Martin Poliak
  • Jan Trávníček
Conference paper

DOI: 10.1007/978-3-319-09704-6_18

Part of the Lecture Notes in Computer Science book series (LNCS, volume 8614)
Cite this paper as:
Janoušek J., Melichar B., Polách R., Poliak M., Trávníček J. (2014) A Full and Linear Index of a Tree for Tree Patterns. In: Jürgensen H., Karhumäki J., Okhotin A. (eds) Descriptional Complexity of Formal Systems. DCFS 2014. Lecture Notes in Computer Science, vol 8614. Springer, Cham

Abstract

A new and simple method of indexing a tree for tree patterns is presented. A tree pattern is a tree whose leaves can be labelled by a special symbol S, which serves as a placeholder for any subtree. Given a subject tree T with n nodes, the tree is preprocessed and an index, which consists of a standard string compact suffix automaton and a subtree jump table, is constructed. The number of distinct tree patterns which match the tree is \(\mathcal{O}(2^n)\), and the size of the index is \(\mathcal{O}(n)\). The searching phase uses the index, reads an input tree pattern P of size m and computes the list of positions of all occurrences of the pattern P in the tree T. For an input tree pattern P in linear prefix notation pref(P) = P1SP2SSPk, k ≥ 1, the searching is performed in time \(\mathcal{O}(m + \sum\limits_{i=1}^k |occ(P_i)|))\), where occ(Pi) is the set of all occurrences of Pi in pref(T).

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Springer International Publishing Switzerland 2014

Authors and Affiliations

  • Jan Janoušek
    • 1
  • Bořivoj Melichar
    • 1
  • Radomír Polách
    • 1
  • Martin Poliak
    • 1
  • Jan Trávníček
    • 1
  1. 1.Department of Theoretical Computer Science, Faculty of Information TechnologyCzech Technical University in PraguePrague 6Czech Republic

Personalised recommendations