cugraph.tree.minimum_spanning_tree.maximum_spanning_tree#
- cugraph.tree.minimum_spanning_tree.maximum_spanning_tree(G, weight=None, algorithm='boruvka', ignore_nan=False)[source]#
Returns a maximum spanning tree (MST) or forest (MSF) on an undirected graph. Also computes the adjacency list if G does not have one.
- Parameters:
- GcuGraph.Graph or networkx.Graph
cuGraph graph descriptor with connectivity information.
- weightstring
default to the weights in the graph, if the graph edges do not have a weight attribute a default weight of 1 will be used.
- algorithmstring
Default to ‘boruvka’. The parallel algorithm to use when finding a maximum spanning tree.
- ignore_nanbool
Default to False
- Returns:
- G_mstcuGraph.Graph or networkx.Graph
A graph descriptor with a maximum spanning tree or forest. The networkx graph will not have all attributes copied over
Examples
>>> from cugraph.datasets import netscience >>> G = netscience.get_graph(download=True) >>> G_mst = cugraph.maximum_spanning_tree(G)