nonisomorphic_trees#

nonisomorphic_trees(order, create='graph')[source]#

Generates lists of nonisomorphic trees

Parameters:
orderint

order of the desired tree(s)

createone of {“graph”, “matrix”} (default=”graph”)

If "graph" is selected a list of Graph instances will be returned, if matrix is selected a list of adjacency matrices will be returned.

Deprecated since version 3.3: The create argument is deprecated and will be removed in NetworkX version 3.5. In the future, nonisomorphic_trees will yield graph instances by default. To generate adjacency matrices, call nx.to_numpy_array on the output, e.g.:

[nx.to_numpy_array(G) for G in nx.nonisomorphic_trees(N)]
Yields:
list

A list of nonisomorphic trees, in one of two formats depending on the value of the create parameter: - create="graph": yields a list of networkx.Graph instances - create="matrix": yields a list of list-of-lists representing adjacency matrices