Enumerating All Rooted Trees Including k Leaves

Masanobu ISHIKAWA  Katsuhisa YAMANAKA  Yota OTACHI  Shin-ichi NAKANO  

IEICE TRANSACTIONS on Information and Systems   Vol.E95-D   No.3   pp.763-768
Publication Date: 2012/03/01
Online ISSN: 1745-1361
DOI: 10.1587/transinf.E95.D.763
Print ISSN: 0916-8532
Type of Manuscript: Special Section PAPER (Special Section on Foundations of Computer Science – Mathematical Foundations and Applications of Computer Science and Algorithms –)
graph algorithm,  enumeration,  rooted tree,  family tree,  

Full Text: PDF>>
Buy this Article

This paper presents an efficient algorithm to generate all (unordered) rooted trees with exactly n vertices including exactly k leaves. There are known results on efficient enumerations of some classes of graphs embedded on a plane, for instance, biconnected and triconnected triangulations [3],[6], and floorplans [4]. On the other hand, it is difficult to enumerate a class of graphs without a fixed embedding. The paper is on enumeration of rooted trees without a fixed embedding. We already proposed an algorithm to generate all “ordered” trees with n vertices including k leaves [11], while the algorithm cannot seem to efficiently generate all (unordered) rooted trees with n vertices including k leaves. We design a simple tree structure among such trees, then by traversing the tree structure we generate all such trees in constant time per tree in the worst case. By repeatedly applying the algorithm for each k=1,2, ...,n-1, we can also generate all rooted trees with exactly n vertices.