spanning_tree

spanning_tree(graph: TGraph, maximise=False)

Implements Kruskal’s algorithm for finding minimum or maximum spanning tree.

Parameters:
  • graph – input graph

  • maximise – if True, find maximum spanning tree (default: False)

Returns:

spanning tree