This documents an unmaintained version of NetworkX. Please upgrade to a maintained version and see the current NetworkX documentation.
balanced_tree(r, h, create_using=None)¶
Return the perfectly balanced r-tree of height h.
G – A tree with n nodes
This is the rooted tree where all leaves are at distance h from the root. The root has degree r and all other internal nodes have degree r+1.
Node labels are the integers 0 (the root) up to number_of_nodes - 1.
Also refered to as a complete r-ary tree.