Skip to main content
Log in

A Uniform Paradigm to Succinctly Encode Various Families of Trees

  • Published:
Algorithmica Aims and scope Submit manuscript

Abstract

We propose a uniform method to encode various types of trees succinctly. These families include ordered (ordinal), k-ary (cardinal), and unordered (free) trees. We will show the approach is intrinsically suitable for obtaining entropy-based encodings of trees (such as the degree-distribution entropy). Previously-existing succinct encodings of trees use ad hoc techniques to encode each particular family of trees.

Additionally, the succinct encodings obtained using the uniform approach improve upon the existing succinct encodings of each family of trees; in the case of ordered trees, it simplifies the encoding while supporting the full set of navigational operations. It also simplifies the implementation of many supported operations. The approach applied to k-ary trees yields a succinct encoding that supports both cardinal-type operations (e.g. determining the child label i) as well as the full set of ordinal-type operations (e.g. reporting the number of siblings to the left of a node). Previous work on succinct encodings of k-ary trees does not support both types of operations simultaneously (Benoit et al. in Algorithmica 43(4):275–292, 2005; Raman et al. in ACM-SIAM Symposium on Discrete Algorithms (SODA), pp. 233–242, 2002). For unordered trees, the approach achieves the first succinct encoding.

The approach is based on two recursive decompositions of trees into subtrees. Recursive decomposition of a structure into substructures is a common technique in succinct encodings and has even been used to encode (ordered) trees (Geary et al. in ACM Trans. Algorithms 2(4):510–534, 2006; He et al. in ICALP, pp. 509–520, 2007) and dynamic binary trees (Munro et al. in ACM-SIAM Symposium on Discrete Algorithms (SODA), pp. 529–536, 2001; Storm in Representing dynamic binary trees succinctly, Master’s thesis, 2000). The main distinction of the approach in this paper is that a tree is decomposed into subtrees in a manner that the subtrees are maximally isolated from each other. This intermediate decomposition result is interesting in its own right and has proved useful in other applications (Farzan et al. in ICALP (1), pp. 451–462, 2009; Farzan and Munro in ICALP (1), pp. 439–450, 2009; Farzan and Kamali in ICALP, 2011).

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
Algorithm 1
Algorithm 2
Fig. 3
Fig. 4

Similar content being viewed by others

Notes

  1. lgn denotes log2 n.

  2. Adopting the terminology of Raman et al. [31].

References

  1. Beame, P., Fich, F.E.: Optimal bounds for the predecessor problem and related problems. J. Comput. Syst. Sci. 65(1), 38–72 (2002)

    Article  MATH  MathSciNet  Google Scholar 

  2. Benoit, D., Demaine, E.D., Munro, J.I., Raman, R., Raman, V., Rao, S.S.: Representing trees of higher degree. Algorithmica 43(4), 275–292 (2005)

    Article  MATH  MathSciNet  Google Scholar 

  3. Bernhart, F.: Catalan, Motzkin, and Riordan numbers. Discrete Math. 204, 72–112 (1999)

    Article  MathSciNet  Google Scholar 

  4. Brodnik, A., Munro, J.I.: Membership in constant time and almost-minimum space. SIAM J. Comput. 28(5), 1627–1640 (1999)

    Article  MATH  MathSciNet  Google Scholar 

  5. Clark, D.R.: Compact pat trees. Ph.D. thesis, University of Waterloo, Ontario, Canada (1998)

  6. Clark, D.R., Munro, J.I.: Efficient suffix trees on secondary storage (extended abstract). In: ACM-SIAM Symposium on Discrete Algorithms (SODA), pp. 383–391 (1996)

    Google Scholar 

  7. Etherington, I.M.H.: Non-associate powers and a functional equation. Math. Gaz. 21(242), 36–39 (1937)

    Article  Google Scholar 

  8. Farzan, A.: Succinct representation of trees and graphs. Ph.D. thesis, School of Computer Science, University of Waterloo (2009)

  9. Farzan, A., Kamali, S.: Compact navigation and distance oracles for graphs with small treewidth. In: Proceedings of the 38th International Colloquim Conference on Automata, Languages and Programming, Zurich, Switzerland, ICALP’11, vol. Part I, pp. 268–280. Springer, Berlin (2011). ISBN 978-3-642-22005-0. http://dl.acm.org/citation.cfm?id=2027127.2027156

    Chapter  Google Scholar 

  10. Farzan, A., Munro, J.I.: A uniform approach towards succinct representation of trees. In: SWAT (11th Scandinavian Workshop on Algorithm Theory). Lecture Notes in Computer Science, pp. 173–184. Springer, Berlin (2008)

    Google Scholar 

  11. Farzan, A., Munro, J.I.: Dynamic succinct ordered trees. In: Albers, S., Marchetti-Spaccamela, A., Matias, Y., Nikoletseas, S.E., Thomas, W. (eds.) International Colloquium on Automata, Languages, and Programming (ICALP) (1). Lecture Notes in Computer Science, vol. 5555, pp. 439–450. Springer, Berlin (2009)

    Chapter  Google Scholar 

  12. Farzan, A., Raman, R., Rao, S.S.: Universal succinct representations of trees? In: Albers, S., Marchetti-Spaccamela, A., Matias, Y., Nikoletseas, S.E., Thomas, W. (eds.) ICALP (1). Lecture Notes in Computer Science, vol. 5555, pp. 451–462. Springer, Berlin (2009)

    Google Scholar 

  13. Frederickson, G.N.: Data structures for on-line updating of minimum spanning trees, with applications. SIAM J. Comput. 14(4), 781–798 (1985)

    Article  MATH  MathSciNet  Google Scholar 

  14. Fredman, M.L., Komlós, J., Szemerédi, E.: Storing a sparse table with 0(1) worst case access time. J. ACM 31(3), 538–544 (1984)

    Article  MATH  Google Scholar 

  15. Geary, R.F., Raman, R., Raman, V.: Succinct ordinal trees with level-ancestor queries. ACM Trans. Algorithms 2(4), 510–534 (2006)

    Article  MathSciNet  Google Scholar 

  16. Graham, R.L., Knuth, D.E., Patashnik, O.: Concrete Mathematics: A Foundation for Computer Science. Addison-Wesley Longman, Boston (1994)

    MATH  Google Scholar 

  17. Harary, F., Palmer, E.M.: Graphical Enumeration. Academic Press, New York (1973)

    MATH  Google Scholar 

  18. He, M., Munro, J.I., Rao, S.S.: Succinct ordinal trees based on tree covering. In: International Colloquium on Automata, Languages, and Programming (ICALP). Lecture Notes in Computer Science, vol. 4596, pp. 509–520. Springer, Berlin (2007)

    Chapter  Google Scholar 

  19. Jacobson, G.J.: Succinct static data structures. Ph.D. thesis, Pittsburgh, PA, USA (1988)

  20. Jacobson, G.J.: Space-efficient static trees and graphs. In: 30th Annual Symposium on Foundations of Computer Science, pp. 549–554 (1989)

    Chapter  Google Scholar 

  21. Jansson, J., Sadakane, K., Sung, W.-K.: Ultra-succinct representation of ordered trees. In: Bansal, N., Pruhs, K., Stein, C. (eds.) ACM-SIAM Symposium on Discrete Algorithms (SODA), pp. 575–584. SIAM, Philadelphia (2007)

    Google Scholar 

  22. Knuth, D.E.: The Art of Computer Programming, vol. 1, 3rd edn. Addison-Wesley, Reading (1997)

    Google Scholar 

  23. Lu, H.-I., Yeh, C.-C.: Balanced parentheses strike back. ACM Trans. Algorithms 4, 28:1–28:13 (2008)

    Article  MathSciNet  Google Scholar 

  24. Munro, J.I., Raman, V.: Succinct representation of balanced parentheses, static trees and planar graphs. In: IEEE Symposium on Foundations of Computer Science, pp. 118–126 (1997)

    Google Scholar 

  25. Munro, J.I., Raman, V., Storm, A.J.: Representing dynamic binary trees succinctly. In: ACM-SIAM Symposium on Discrete Algorithms (SODA), pp. 529–536 (2001)

    Google Scholar 

  26. Odlyzko, A.M.: Some new methods and results in tree enumeration (04 May 1984)

  27. Otter, R.: The number of trees. Ann. Math., 2nd Ser. 49(3), 583–599 (1948)

    Article  MATH  MathSciNet  Google Scholar 

  28. Pagh, R.: Low redundancy in static dictionaries with constant query time. SIAM J. Comput. 31(2), 353–363 (2001)

    Article  MATH  MathSciNet  Google Scholar 

  29. Pǎtraşcu, M.: Succincter. In: IEEE Annual Symposium on Foundations of Computer Science (FOCS), pp. 305–313. IEEE Comput. Soc., Los Alamitos (2008)

    Google Scholar 

  30. Raman, R., Raman, V., Rao, S.S.: Succinct indexable dictionaries with applications to encoding k-ary trees and multisets. In: ACM-SIAM Symposium on Discrete Algorithms (SODA), pp. 233–242 (2002)

    Google Scholar 

  31. Raman, R., Raman, V., Satti, S.R.: Succinct indexable dictionaries with applications to encoding k-ary trees, prefix sums and multisets. ACM Trans. Algorithms 3(4), 43 (2007)

    Article  MathSciNet  Google Scholar 

  32. Rote, G.: Binary trees having a given number of nodes with 0, 1, and 2 children. In: Séminaire Lotharingien de Combinatoire, vol. 38. Springer, Berlin (1997)

    Google Scholar 

  33. Sadakane, K., Navarro, G.: Fully-functional succinct trees. In: Charikar, M. (ed.) ACM-SIAM Symposium on Discrete Algorithms (SODA), pp. 134–149. SIAM, Philadelphia (2010)

    Chapter  Google Scholar 

  34. Storm, A.J.: Representing dynamic binary trees succinctly. Master’s thesis, School of Computer Science, University of Waterloo, Waterloo, Ontario, Canada (2000)

  35. Wedderburn, J.H.M.: The functional equation g(x 2)=2ax+[g(x)]2. Ann. Math., 2nd Ser. 24(2), 121–140 (1922)

    Article  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Arash Farzan.

Additional information

Preliminary versions of this paper have appeared in [10] and also as a chapter in [8].

Rights and permissions

Reprints and permissions

About this article

Cite this article

Farzan, A., Munro, J.I. A Uniform Paradigm to Succinctly Encode Various Families of Trees. Algorithmica 68, 16–40 (2014). https://doi.org/10.1007/s00453-012-9664-0

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00453-012-9664-0

Keywords

Navigation