Advertisement

Algorithmica

, Volume 68, Issue 1, pp 16–40 | Cite as

A Uniform Paradigm to Succinctly Encode Various Families of Trees

  • Arash FarzanEmail author
  • J. Ian Munro
Article

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).

Keywords

Succinct data structures Trees Ordered trees Cardinal trees Unordered trees Compact encodings Entropy encoding 

References

  1. 1.
    Beame, P., Fich, F.E.: Optimal bounds for the predecessor problem and related problems. J. Comput. Syst. Sci. 65(1), 38–72 (2002) CrossRefzbMATHMathSciNetGoogle Scholar
  2. 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) CrossRefzbMATHMathSciNetGoogle Scholar
  3. 3.
    Bernhart, F.: Catalan, Motzkin, and Riordan numbers. Discrete Math. 204, 72–112 (1999) CrossRefMathSciNetGoogle Scholar
  4. 4.
    Brodnik, A., Munro, J.I.: Membership in constant time and almost-minimum space. SIAM J. Comput. 28(5), 1627–1640 (1999) CrossRefzbMATHMathSciNetGoogle Scholar
  5. 5.
    Clark, D.R.: Compact pat trees. Ph.D. thesis, University of Waterloo, Ontario, Canada (1998) Google Scholar
  6. 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. 7.
    Etherington, I.M.H.: Non-associate powers and a functional equation. Math. Gaz. 21(242), 36–39 (1937) CrossRefGoogle Scholar
  8. 8.
    Farzan, A.: Succinct representation of trees and graphs. Ph.D. thesis, School of Computer Science, University of Waterloo (2009) Google Scholar
  9. 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 CrossRefGoogle Scholar
  10. 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. 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) CrossRefGoogle Scholar
  12. 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. 13.
    Frederickson, G.N.: Data structures for on-line updating of minimum spanning trees, with applications. SIAM J. Comput. 14(4), 781–798 (1985) CrossRefzbMATHMathSciNetGoogle Scholar
  14. 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) CrossRefzbMATHGoogle Scholar
  15. 15.
    Geary, R.F., Raman, R., Raman, V.: Succinct ordinal trees with level-ancestor queries. ACM Trans. Algorithms 2(4), 510–534 (2006) CrossRefMathSciNetGoogle Scholar
  16. 16.
    Graham, R.L., Knuth, D.E., Patashnik, O.: Concrete Mathematics: A Foundation for Computer Science. Addison-Wesley Longman, Boston (1994) zbMATHGoogle Scholar
  17. 17.
    Harary, F., Palmer, E.M.: Graphical Enumeration. Academic Press, New York (1973) zbMATHGoogle Scholar
  18. 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) CrossRefGoogle Scholar
  19. 19.
    Jacobson, G.J.: Succinct static data structures. Ph.D. thesis, Pittsburgh, PA, USA (1988) Google Scholar
  20. 20.
    Jacobson, G.J.: Space-efficient static trees and graphs. In: 30th Annual Symposium on Foundations of Computer Science, pp. 549–554 (1989) CrossRefGoogle Scholar
  21. 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. 22.
    Knuth, D.E.: The Art of Computer Programming, vol. 1, 3rd edn. Addison-Wesley, Reading (1997) Google Scholar
  23. 23.
    Lu, H.-I., Yeh, C.-C.: Balanced parentheses strike back. ACM Trans. Algorithms 4, 28:1–28:13 (2008) CrossRefMathSciNetGoogle Scholar
  24. 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. 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. 26.
    Odlyzko, A.M.: Some new methods and results in tree enumeration (04 May 1984) Google Scholar
  27. 27.
    Otter, R.: The number of trees. Ann. Math., 2nd Ser. 49(3), 583–599 (1948) CrossRefzbMATHMathSciNetGoogle Scholar
  28. 28.
    Pagh, R.: Low redundancy in static dictionaries with constant query time. SIAM J. Comput. 31(2), 353–363 (2001) CrossRefzbMATHMathSciNetGoogle Scholar
  29. 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. 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. 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) CrossRefMathSciNetGoogle Scholar
  32. 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. 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) CrossRefGoogle Scholar
  34. 34.
    Storm, A.J.: Representing dynamic binary trees succinctly. Master’s thesis, School of Computer Science, University of Waterloo, Waterloo, Ontario, Canada (2000) Google Scholar
  35. 35.
    Wedderburn, J.H.M.: The functional equation g(x 2)=2ax+[g(x)]2. Ann. Math., 2nd Ser. 24(2), 121–140 (1922) CrossRefMathSciNetGoogle Scholar

Copyright information

© Springer Science+Business Media, LLC 2012

Authors and Affiliations

  1. 1.Max-Planck-Institut für InformatikSaarbrückenGermany
  2. 2.Cheriton School of Computer ScienceUniversity of WaterlooWaterlooCanada

Personalised recommendations