Abstract
In this paper, we give a simple algorithm to generate all ordered trees with exactly n vertices including exactly k leaves. The best known algorithm generates such trees in O(n − k) time for each, while our algorithm generates such trees in O(1) time for each in worst case.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Avis, D., Fukuda, K.: Reverse search for enumeration. Discrete Appl. Math. 65(1-3), 21–46 (1996)
Beyer, T., Hedetniemi, S.M.: Constant time generation of rooted trees. SIAM J. Comput. 9(4), 706–712 (1980)
Fenner, T.I., Loizou, G.: A binary tree representation and related algorithms for generating integer partitions. The Computer J. 23(4), 332–337 (1980)
Goldberg, L.: Efficient algorithms for listing combinatorial structures. Cambridge University Press, New York (1993)
Kikuchi, Y., Tanaka, H., Nakano, S., Shibata, Y.: How to obtain the complete list of caterpillars. In: Warnow, T.J., Zhu, B. (eds.) COCOON 2003. LNCS, vol. 2697, pp. 329–338. Springer, Heidelberg (2003)
Knuth, D.: The art of computer programming. Generating all tuples and permutations, vol. 4, fascicle 2. Addison-Wesley, Reading (2005)
Knuth, D.E.: The art of computer programming. Generating all trees, history of combinatorial generation, vol. 4, fascicle 4. Addison-Wesley, Reading (2006)
Korsh, J.F., LaFollette, P.: Multiset permutations and loopless generation of ordered trees with specified degree sequence. Journal of Algorithms 34(2), 309–336 (2000)
Korsh, J.F., LaFollette, P.: Loopless generation of trees with specified degrees. The Computer Journal 45(3), 364–372 (2002)
Kreher, D.L., Stinson, D.R.: Combinatorial algorithms. CRC Press, Boca Raton (1998)
Li, G., Ruskey, F.: The advantages of forward thinking in generating rooted and free trees. In: Proc. 10th Annual ACM-SIAM Symp. on Discrete Algorithms (SODA 1999), pp. 939–940 (1999)
Li, Z., Nakano, S.: Efficient generation of plane triangulations without repetitions. In: Orejas, F., Spirakis, P.G., van Leeuwen, J. (eds.) ICALP 2001. LNCS, vol. 2076, pp. 433–443. Springer, Heidelberg (2001)
McKay, B.D.: Isomorph-free exhaustive generation. J. Algorithms 26(2), 306–324 (1998)
Muramatsu, T., Nakano, S.: A random generation of plane trees with exactly k leaves. IEICE Transaction on Fundamentals J90-A(12), 940–947 (2007) (in Japanese)
Nakano, S.: Efficient generation of plane trees. Inf. Process. Lett. 84(3), 167–172 (2002)
Nakano, S.: Efficient generation of triconnected plane triangulations. Comput. Geom. Theory and Appl. 27(2), 109–122 (2004)
Nakano, S., Uno, T.: Constant time generation of trees with specified diameter. In: Hromkovič, J., Nagl, M., Westfechtel, B. (eds.) WG 2004. LNCS, vol. 3353, pp. 33–45. Springer, Heidelberg (2004)
Nakano, S., Uno, T.: Generating colored trees. In: Kratsch, D. (ed.) WG 2005. LNCS, vol. 3787, pp. 249–260. Springer, Heidelberg (2005)
Pallo, J.: Generating trees with n nodes and m leaves. International Journal of Computer Mathematics 21(2), 133–144 (1987)
Read, R.C.: Every one a winner or how to avoid isomorphism search. Annuals of Discrete Mathematics 2, 107–120 (1978)
Reingold, E.M., Nievergelt, J., Deo, N.: Combinatorial Algorithms. Prentice-Hall, Englewood Cliffs (1977)
Ruskey, F., van Baronaigien, D.R.: Fast recursive algorithms for generating combinatorial objects. Congressus Numerantium 41, 53–62 (1984)
Sawada, J.: Generating rooted and free plane trees. ACM Transactions on Algorithms 2(1), 1–13 (2006)
Stanley, R.P.: Enumerative combinatorics, vol. 2. Cambridge University Press, Cambridge (1999)
Wilf, H.S.: Combinatorial algorithms: An update. SIAM, Philadelphia (1989)
Wright, R.A., Richmond, B., Odlyzko, A., McKay, B.D.: Constant time generation of free trees. SIAM J. Comput. 15(2), 540–548 (1986)
Yamanaka, K., Kawano, S., Kikuchi, Y., Nakano, S.: Constant time generation of integer partitions. IEICE Trans. Fundamentals E90-A(5), 888–895 (2007)
Yamanaka, K., Nakano, S.: Listing all plane graphs. In: Nakano, S.-i., Rahman, M. S. (eds.) WALCOM 2008. LNCS, vol. 4921, pp. 210–221. Springer, Heidelberg (2008)
Zaks, S., Richards, D.: Generating trees and other combinatorial objects lexicographically. SIAM J. Comput. 8(1), 73–81 (1979)
Zoghbi, A., Stojmenović, I.: Fast algorithms for generating integer partitions. Int. J. Comput. Math. 70, 319–332 (1998)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2009 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Yamanaka, K., Otachi, Y., Nakano, Si. (2009). Efficient Enumeration of Ordered Trees with k Leaves (Extended Abstract). In: Das, S., Uehara, R. (eds) WALCOM: Algorithms and Computation. WALCOM 2009. Lecture Notes in Computer Science, vol 5431. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-00202-1_13
Download citation
DOI: https://doi.org/10.1007/978-3-642-00202-1_13
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-00201-4
Online ISBN: 978-3-642-00202-1
eBook Packages: Computer ScienceComputer Science (R0)