Skip to content

num::structures::minimum_spanning_tree

Defined in header <structures/algorithms/traversal.hpp>

template <typename Weight, std::integral Index>
graph<Weight, Index> minimum_spanning_tree(const graph<Weight, Index> &G);

Compute a minimum spanning tree by Kruskal's algorithm: \(\arg\min_T \sum_{e \in T} w_e\).