graphscope.nx.generators.classic.binomial_tree

graphscope.nx.generators.classic.binomial_tree(n, create_using=None)[source]

Returns the Binomial Tree of order n.

The binomial tree of order 0 consists of a single node. A binomial tree of order k is defined recursively by linking two binomial trees of order k-1: the root of one is the leftmost child of the root of the other.

Parameters:
  • n (int) – Order of the binomial tree.

  • create_using (NetworkX graph constructor, optional (default=nx.Graph)) – Graph type to create. If graph instance, then cleared before populated.

Returns:

G – A binomial tree of $2^n$ nodes and $2^n - 1$ edges.

Return type:

NetworkX graph