Abstract
Many algorithms to generate all trees with n vertices without repetition are already known. The best algorithm runs in time proportional to the number of trees. However, the time needed to generate each tree may not be bounded by a constant, even though it is “on average”. In this paper we give a simple algorithm to generate all trees with exactly n vertices and diameter d, without repetition. Our algorithm generates each tree in constant time. It also generates all trees so that each tree can be obtained from the preceding tree by at most three operations. Each operation consists of a deletion of a vertex and an addition of a vertex. By using the algorithm for each diameter 2,3, ⋯ , n − 1, we can generate all trees with n vertices.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Aho, A.V., Ullman, J.D.: Foundations of Computer Science. Computer Science Press, New York (1995)
Beyer, T., Hedetniemi, S.M.: Constant Time Generation of Rooted Trees. SIAM J. Comput. 9, 706–712 (1980)
Goldberg, L.A.: Efficient Algorithms for Listing Combinatorial Structures. Cambridge University Press, New York (1993)
Joichi, J.T., White, D.E., Williamson, S.G.: Combinatorial Gray Codes. SIAM J. Comput. 9, 130–141 (1980)
Kreher, D.L., Stinson, D.R.: Combinatorial Algorithms. CRC Press, Boca Raton (1998)
Li, Z., Nakano, S.-i.: 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)
Li, G., Ruskey, F.: The Advantage of Forward Thinking in Generating Rooted and Free Trees. In: Proc. 10th Annual ACM-SIAM Symp. on Discrete Algorithms, pp. 939–940 (1999)
McKay, B.D.: Isomorph-free Exhaustive Generation. J. of Algorithms 26, 306–324 (1998)
Nakano, S.: Efficient Generation of Plane Trees. Information Processing Letters 84, 167–172 (2002)
Read, R.C.: How to Avoid Isomorphism Search When Cataloguing Combinatorial Configurations. Annals of Discrete Mathematics 2, 107–120 (1978)
Rosen, K.H. (ed.): Handbook of Discrete and Combinatorial Mathematics. CRC Press, Boca Raton (2000)
Savage, C.: A Survey of Combinatorial Gray Codes. SIAM Review 39, 605–629 (1997)
West, D.B.: Introduction to Graph Theory, 2nd edn. Prentice-Hall, NJ (2001)
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, 540–548 (1986)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2004 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Nakano, Si., Uno, T. (2004). Constant Time Generation of Trees with Specified Diameter. In: Hromkovič, J., Nagl, M., Westfechtel, B. (eds) Graph-Theoretic Concepts in Computer Science. WG 2004. Lecture Notes in Computer Science, vol 3353. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-30559-0_3
Download citation
DOI: https://doi.org/10.1007/978-3-540-30559-0_3
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-24132-4
Online ISBN: 978-3-540-30559-0
eBook Packages: Computer ScienceComputer Science (R0)