Skip to main content
`Ctrl`+`K`

# minimum_branching

minimum_branching(G, attr='weight', default=1, preserve_attrs=False, partition=None)

  Returns a minimum branching from G.

  Parameters:
    G(multi)digraph-like

      The graph to be searched.

    attr str

      The edge attribute used to in determining optimality.

    default float

      The value of the edge attribute used if an edge does not have the attribute `attr`.

    preserve_attrs bool

      If True, preserve the other attributes of the original graph (that are not passed to `attr`)

    partition str

      The key for the edge attribute containing the partition data on the graph. Edges can be included, excluded or open using the `EdgePartition` enum.

  Returns:
    B(multi)digraph-like

      A minimum branching.

  See also

  `minimal_branching`