Skip to main content
Log in

Constant-Time Tree Traversal and Subtree Equality Check for Grammar-Compressed Trees

  • Published:
Algorithmica Aims and scope Submit manuscript

Abstract

A linear space data structure for grammar-compressed trees is presented which allows to carry out tree traversal operations and subtree equality checks in constant time. A traversal step consists of moving to the parent or to the ith child of a node.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6

Similar content being viewed by others

References

  1. Bender, M.A., Farach-Colton, M.: The LCA problem revisited. In: Proceedings of LATIN 2000. Lecture Notes in Computer Science, vol. 1776, pp. 88–94. Springer, Berlin (2000)

  2. Bille, P., Gørtz, I.L., Landau, G.M., Weimann, O.: Tree compression with top trees. Inf. Comput. 243, 166–177 (2015)

    Article  MathSciNet  MATH  Google Scholar 

  3. Bille, P., Landau, G.M., Raman, R., Sadakane, K., Satti, S.R., Weimann, O.: Random access to grammar-compressed strings and trees. SIAM J. Comput. 44(3), 513–539 (2015)

    Article  MathSciNet  MATH  Google Scholar 

  4. Bousquet-Mélou, M., Lohrey, M., Maneth, S., Noeth, E.: XML compression via DAGs. Theory Comput. Syst. 57(4), 1322–1371 (2014)

    Article  MATH  Google Scholar 

  5. Busatto, G., Lohrey, M., Maneth, S.: Efficient memory representation of XML document trees. Inf. Syst. 33(4–5), 456–474 (2008)

    Article  MATH  Google Scholar 

  6. Cai, J., Paige, R.: Using multiset discrimination to solve language processing problems without hashing. Theor. Comput. Sci. 145(1&2), 189–228 (1995)

    Article  MathSciNet  MATH  Google Scholar 

  7. Charikar, M., Lehman, E., Lehman, A., Liu, D., Panigrahy, R., Prabhakaran, M., Sahai, A., Shelat, A.: The smallest grammar problem. IEEE Trans. Inf. Theory 51(7), 2554–2576 (2005)

    Article  MathSciNet  MATH  Google Scholar 

  8. Comon, H., Dauchet, M., Gilleron, R., Jacquemard, F., Lugiez, D., Löding, C., Tison, S., Tommasi, M.: Tree automata techniques and applications. http://tata.gforge.inria.fr/ (2007)

  9. Delpratt, O., Raman, R., Rahman, N.: Engineering succinct DOM. In: Proceedings of EDBT. ACM International Conference Proceeding Series, vol. 261, pp. 49–60. ACM (2008)

  10. Gasieniec, L., Kolpakov, R.M., Potapov, I., Sant, P.: Real-time traversal in grammar-based compressed files. In: Proceedings of DCC 2005, p. 458. IEEE Computer Society. Long version availabe at http://www.csc.liv.ac.uk/~leszek/papers/dcc05.ps.gz (2005)

  11. Hübschle-Schneider, L., Raman, R.: Tree compression with top trees revisited. In: Proceedings of SEA 2015. Lecture Notes in Computer Science, vol. 9125, pp. 15–27. Springer, Berlin (2015). Long version available at arXiv:1506.04499

  12. Hucke, D., Lohrey, M., Noeth, E.: Constructing small tree grammars and small circuits for formulas. In: Proceedings of FSTTCS 2014. LIPIcs, vol. 29, pp. 457–468. Schloss Dagstuhl - Leibniz-Zentrum für Informatik (2014)

  13. Gusfield, D.: Algorithms on Strings, Trees, and Sequences—Computer Science and Computational Biology. Cambridge University Press, Cambridge (1997)

    Book  MATH  Google Scholar 

  14. Jeż, A., Lohrey, M.: Approximation of smallest linear tree grammars. In: Proceedings of STACS 2014. LIPIcs, vol. 25, pp. 445–457. Schloss Dagstuhl - Leibniz-Zentrum für Informatik (2014)

  15. Knuth, D.: The Art of Computer Programming. Fundamental Algorithms, vol. I. Addison-Wesley, Reading (1968)

    MATH  Google Scholar 

  16. Lohrey, M.: Algorithmics on SLP-compressed strings: a survey. Groups Complex. Cryptol. 4(2), 241–299 (2012)

    MathSciNet  MATH  Google Scholar 

  17. Lohrey, M., Maneth, S.: The complexity of tree automata and XPath on grammar-compressed trees. Theor. Comput. Sci. 363(2), 196–210 (2006)

    Article  MathSciNet  MATH  Google Scholar 

  18. Lohrey, M., Maneth, S., Mennicke, R.: XML tree structure compression using RePair. Inf. Syst. 38(8), 1150–1167 (2013)

    Article  Google Scholar 

  19. Lohrey, M., Maneth, S., Schmidt-Schauß, M.: Parameter reduction and automata evaluation for grammar-compressed trees. J. Comput. Syst. Sci. 78(5), 1651–1669 (2012)

    Article  MathSciNet  MATH  Google Scholar 

  20. Maneth, S., Sebastian, T.: Fast and tiny structural self-indexes for XML. CoRR (2010). arXiv:1012.5696

  21. Maneth, S., Sebastian, T.: XPath node selection over grammar-compressed trees. In: Proceedings of TTATT 2013, Electronic Proceedings in Theoretical Computer Science, vol. 134, pp. 38–48 (2013)

  22. Navarro, G., Sadakane, K.: Fully functional static and dynamic succinct trees. ACM Trans. Algorithms 10(3), 16 (2014)

    Article  MathSciNet  MATH  Google Scholar 

  23. Schieber, B., Vishkin, U.: On finding lowest common ancestors: simplification and parallelization. SIAM J. Comput. 17(6), 1253–1262 (1988)

    Article  MathSciNet  MATH  Google Scholar 

  24. Scwentick, T.: Automata for XML—a survey. J. Comput. Syst. Sci. 73(3), 289–315 (2007)

    Article  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Carl Philipp Reh.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Lohrey, M., Maneth, S. & Reh, C.P. Constant-Time Tree Traversal and Subtree Equality Check for Grammar-Compressed Trees. Algorithmica 80, 2082–2105 (2018). https://doi.org/10.1007/s00453-017-0331-3

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00453-017-0331-3

Keywords

Navigation