# Changeset 1584:cf4bc8d477f4 in lemon-0.x for demo

Ignore:
Timestamp:
07/22/05 18:57:07 (14 years ago)
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2087
Message:

corrections

File:
1 edited

Unmodified
Removed
• ## demo/kruskal_demo.cc

 r1583 Edge e10 = g.addEdge(v4, t); //Make the input and output for the kruskal. //Make the input for the kruskal. typedef ListGraph::EdgeMap ECostMap; ECostMap edge_cost_map(g); // Fill the edge_cost_map. edge_cost_map.set(e1, -10); edge_cost_map.set(e2, -9); edge_cost_map.set(e3, -8); edge_cost_map.set(e4, -7); edge_cost_map.set(e5, -6); edge_cost_map.set(e6, -5); edge_cost_map.set(e7, -4); edge_cost_map.set(e8, -3); edge_cost_map.set(e9, -2); edge_cost_map.set(e10, -1); // Make the map or the vector, which will contain the edges of the minimum // spanning tree. typedef ListGraph::EdgeMap EBoolMap; ECostMap edge_cost_map(g, 2); EBoolMap tree_map(g); // Kruskal. std::cout << "The weight of the minimum spanning tree by using Kruskal algorithm is " << kruskal(g, ConstMap(2), tree_map)< tree_edge_vec; //Test with non uniform costs and inserter. std::cout << "The weight of the minimum spanning tree with non-uniform costs is " << kruskal(g, edge_cost_map_2, std::back_inserter(tree_edge_vec)) <=0;  i--) std::cout << g.id(tree_edge_vec[i]) << ";" ; std::cout << std::endl; std::cout << "The size of the tree again is: "<< tree_edge_vec.size()<< std::endl; return 0; }
Note: See TracChangeset for help on using the changeset viewer.