GraphLib
Bearbeitung der Aufgabe Mini Graph Library für OOP WiSe 2023/24
Loading...
Searching...
No Matches
prim.h File Reference

Implements Prim's algorithm to compute the Minimum Spanning Tree (MST) of a weighted undirected graph. More...

#include <set>
#include "GraphLib/internal/concepts.h"

Go to the source code of this file.

Functions

template<Internal::valid_weighted_undirected_graph_type 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.

Detailed Description

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.