Implements Prim's algorithm to compute the Minimum Spanning Tree (MST) of a weighted undirected graph. More...
Go to the source code of this file.
Functions | |
| template<Internal::valid_weighted_undirected_graph_type G> | |
| G | GraphLib::prim (const G &graph, typename G::id_type root) |
| Computes the Minimum Spanning Tree of a weighted undirected graph using Prim's algorithm. | |
Implements Prim's algorithm to compute the Minimum Spanning Tree (MST) of a weighted undirected graph.
Provides a templated function that constructs the MST by growing a tree from a given root node, repeatedly adding the minimum weight edge connecting the tree to a new node.
Definition in file prim.h.