, Volume 80, Issue 7, pp 2082–2105 | Cite as

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

  • Markus Lohrey
  • Sebastian Maneth
  • Carl Philipp Reh
Part of the following topical collections:
  1. Special Issue on Compact Data Structures


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.


Grammar-compressed trees Tree straight-line programs Algorithms for compressed trees 


  1. 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)Google Scholar
  2. 2.
    Bille, P., Gørtz, I.L., Landau, G.M., Weimann, O.: Tree compression with top trees. Inf. Comput. 243, 166–177 (2015)MathSciNetCrossRefMATHGoogle Scholar
  3. 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)MathSciNetCrossRefMATHGoogle Scholar
  4. 4.
    Bousquet-Mélou, M., Lohrey, M., Maneth, S., Noeth, E.: XML compression via DAGs. Theory Comput. Syst. 57(4), 1322–1371 (2014)CrossRefMATHGoogle Scholar
  5. 5.
    Busatto, G., Lohrey, M., Maneth, S.: Efficient memory representation of XML document trees. Inf. Syst. 33(4–5), 456–474 (2008)CrossRefMATHGoogle Scholar
  6. 6.
    Cai, J., Paige, R.: Using multiset discrimination to solve language processing problems without hashing. Theor. Comput. Sci. 145(1&2), 189–228 (1995)MathSciNetCrossRefMATHGoogle Scholar
  7. 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)MathSciNetCrossRefMATHGoogle Scholar
  8. 8.
    Comon, H., Dauchet, M., Gilleron, R., Jacquemard, F., Lugiez, D., Löding, C., Tison, S., Tommasi, M.: Tree automata techniques and applications. (2007)
  9. 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)Google Scholar
  10. 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 (2005)
  11. 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. 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)Google Scholar
  13. 13.
    Gusfield, D.: Algorithms on Strings, Trees, and Sequences—Computer Science and Computational Biology. Cambridge University Press, Cambridge (1997)CrossRefMATHGoogle Scholar
  14. 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)Google Scholar
  15. 15.
    Knuth, D.: The Art of Computer Programming. Fundamental Algorithms, vol. I. Addison-Wesley, Reading (1968)MATHGoogle Scholar
  16. 16.
    Lohrey, M.: Algorithmics on SLP-compressed strings: a survey. Groups Complex. Cryptol. 4(2), 241–299 (2012)MathSciNetMATHGoogle Scholar
  17. 17.
    Lohrey, M., Maneth, S.: The complexity of tree automata and XPath on grammar-compressed trees. Theor. Comput. Sci. 363(2), 196–210 (2006)MathSciNetCrossRefMATHGoogle Scholar
  18. 18.
    Lohrey, M., Maneth, S., Mennicke, R.: XML tree structure compression using RePair. Inf. Syst. 38(8), 1150–1167 (2013)CrossRefGoogle Scholar
  19. 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)MathSciNetCrossRefMATHGoogle Scholar
  20. 20.
    Maneth, S., Sebastian, T.: Fast and tiny structural self-indexes for XML. CoRR (2010). arXiv:1012.5696
  21. 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)Google Scholar
  22. 22.
    Navarro, G., Sadakane, K.: Fully functional static and dynamic succinct trees. ACM Trans. Algorithms 10(3), 16 (2014)MathSciNetCrossRefMATHGoogle Scholar
  23. 23.
    Schieber, B., Vishkin, U.: On finding lowest common ancestors: simplification and parallelization. SIAM J. Comput. 17(6), 1253–1262 (1988)MathSciNetCrossRefMATHGoogle Scholar
  24. 24.
    Scwentick, T.: Automata for XML—a survey. J. Comput. Syst. Sci. 73(3), 289–315 (2007)MathSciNetCrossRefGoogle Scholar

Copyright information

© Springer Science+Business Media, LLC 2017

Authors and Affiliations

  • Markus Lohrey
    • 1
  • Sebastian Maneth
    • 2
  • Carl Philipp Reh
    • 1
  1. 1.Universität SiegenSiegenGermany
  2. 2.Department of Mathematics and InformaticsUniversität BremenBremenGermany

Personalised recommendations