Skip to main content
`Ctrl`+`K`

# nonisomorphic_trees

nonisomorphic_trees(order, create='graph')

  Generates lists of nonisomorphic trees

  Parameters:
    order int

      order of the desired tree(s)

    create one 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