- cugraph.tree.minimum_spanning_tree.maximum_spanning_tree(G, weight=None, algorithm='boruvka', ignore_nan=False)#
Returns a maximum spanning tree (MST) or forest (MSF) on an undirected graph. Also computes the adjacency list if G does not have one.
- 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 maximum spanning tree.
Default to False
- 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
>>> from cugraph.datasets import netscience >>> G = netscience.get_graph(download=True) >>> G_mst = cugraph.maximum_spanning_tree(G)