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






Similar content being viewed by others
Notes
lgn denotes log2 n.
Adopting the terminology of Raman et al. [31].
References
Beame, P., Fich, F.E.: Optimal bounds for the predecessor problem and related problems. J. Comput. Syst. Sci. 65(1), 38–72 (2002)
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)
Bernhart, F.: Catalan, Motzkin, and Riordan numbers. Discrete Math. 204, 72–112 (1999)
Brodnik, A., Munro, J.I.: Membership in constant time and almost-minimum space. SIAM J. Comput. 28(5), 1627–1640 (1999)
Clark, D.R.: Compact pat trees. Ph.D. thesis, University of Waterloo, Ontario, Canada (1998)
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)
Etherington, I.M.H.: Non-associate powers and a functional equation. Math. Gaz. 21(242), 36–39 (1937)
Farzan, A.: Succinct representation of trees and graphs. Ph.D. thesis, School of Computer Science, University of Waterloo (2009)
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
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)
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)
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)
Frederickson, G.N.: Data structures for on-line updating of minimum spanning trees, with applications. SIAM J. Comput. 14(4), 781–798 (1985)
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)
Geary, R.F., Raman, R., Raman, V.: Succinct ordinal trees with level-ancestor queries. ACM Trans. Algorithms 2(4), 510–534 (2006)
Graham, R.L., Knuth, D.E., Patashnik, O.: Concrete Mathematics: A Foundation for Computer Science. Addison-Wesley Longman, Boston (1994)
Harary, F., Palmer, E.M.: Graphical Enumeration. Academic Press, New York (1973)
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)
Jacobson, G.J.: Succinct static data structures. Ph.D. thesis, Pittsburgh, PA, USA (1988)
Jacobson, G.J.: Space-efficient static trees and graphs. In: 30th Annual Symposium on Foundations of Computer Science, pp. 549–554 (1989)
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)
Knuth, D.E.: The Art of Computer Programming, vol. 1, 3rd edn. Addison-Wesley, Reading (1997)
Lu, H.-I., Yeh, C.-C.: Balanced parentheses strike back. ACM Trans. Algorithms 4, 28:1–28:13 (2008)
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)
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)
Odlyzko, A.M.: Some new methods and results in tree enumeration (04 May 1984)
Otter, R.: The number of trees. Ann. Math., 2nd Ser. 49(3), 583–599 (1948)
Pagh, R.: Low redundancy in static dictionaries with constant query time. SIAM J. Comput. 31(2), 353–363 (2001)
Pǎtraşcu, M.: Succincter. In: IEEE Annual Symposium on Foundations of Computer Science (FOCS), pp. 305–313. IEEE Comput. Soc., Los Alamitos (2008)
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)
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)
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)
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)
Storm, A.J.: Representing dynamic binary trees succinctly. Master’s thesis, School of Computer Science, University of Waterloo, Waterloo, Ontario, Canada (2000)
Wedderburn, J.H.M.: The functional equation g(x 2)=2ax+[g(x)]2. Ann. Math., 2nd Ser. 24(2), 121–140 (1922)
Author information
Authors and Affiliations
Corresponding author
Rights 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
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00453-012-9664-0