- cugraph.tree.minimum_spanning_tree.minimum_spanning_tree(G, weight=None, algorithm='boruvka', ignore_nan=False)#
Returns a minimum spanning tree (MST) or forest (MSF) on an undirected graph
- GcuGraph.Graph or networkx.Graph
cuGraph graph descriptor with connectivity information.
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.
Default to ‘boruvka’. The parallel algorithm to use when finding a minimum spanning tree.
Default to False
- G_mstcuGraph.Graph or networkx.Graph
A graph descriptor with a minimum spanning tree or forest. The networkx graph will not have all attributes copied over
>>> from cugraph.datasets import netscience >>> G = netscience.get_graph(download=True) >>> G_mst = cugraph.minimum_spanning_tree(G)