TreeGraphFactoryExtension<V, E> extension

Creates m-ary trees (also known as n-ary, k-ary or k-way tree) in which each node has no more than m children.

See https://en.wikipedia.org/wiki/M-ary_tree.

on

Methods

completeTree({required int vertexCount, int arity = 2}) Graph<V, E>
Creates a complete tree with vertexCount nodes and a branching factor of arity. By definition it is completely filled on every level except for the last one; where all the nodes are as far left as possible.
prefectTree({required int height, int arity = 2}) Graph<V, E>
Creates a perfectly balanced tree of height and a branching factor of arity. In the resulting tree all leaf nodes are at the same depth.