From 2042cb9741838ead8a0741c8b2274ebf2a6ec5fd Mon Sep 17 00:00:00 2001 From: Stoycho Kyosev Date: Sat, 18 Jan 2025 15:11:02 -0500 Subject: Refactor --- Seminar13/src/mst-prim.cpp | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'Seminar13/src/mst-prim.cpp') diff --git a/Seminar13/src/mst-prim.cpp b/Seminar13/src/mst-prim.cpp index c342ce8..a89bc26 100644 --- a/Seminar13/src/mst-prim.cpp +++ b/Seminar13/src/mst-prim.cpp @@ -76,10 +76,8 @@ mst_info prim(const weighted_graph& g, vertex_index_t start = 0) int main() { - // Create a weighted graph with 7 vertices, undirected weighted_graph g(7, false); - // Add edges with weights g.add_edge(0, 1, 4); g.add_edge(0, 2, 3); g.add_edge(1, 2, 1); @@ -90,19 +88,11 @@ int main() g.add_edge(4, 6, 8); g.add_edge(5, 6, 4); - // g.add_edge(0, 1, 10); - // g.add_edge(0, 2, 5); - // g.add_edge(1, 2, 1); - // g.add_edge(1, 3, 2); - // g.add_edge(2, 3, 3); - // Run Prim's algorithm auto result = prim(g); - // Print the total cost of the MST std::cout << "Total cost of MST: " << result.cost << '\n'; - // Print the tree structure std::cout << "Tree structure (parent array): "; for (const auto x : result.tree) { -- cgit v1.3.1-23-gd82d