Changeset 50:72867897fcba in lemontutorial for undir_graphs.dox
 Timestamp:
 02/22/10 13:00:14 (15 years ago)
 Branch:
 default
 Phase:
 public
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

undir_graphs.dox
r47 r50 132 132 [SEC]sec_undir_graph_algs[SEC] Undirected Graph Algorihtms 133 133 134 \todo This subsection is under construction. 135 134 136 If you would like to design an electric network minimizing the total length 135 137 of wires, then you might be looking for a minimum spanning tree in an … … 139 141 Let us suppose that the network is stored in a \ref ListGraph object \c g 140 142 with a cost map \c cost. We create a \c bool valued edge map \c tree_map or 141 a vector \c tree_vector for st roing the tree that is found by the algorithm.143 a vector \c tree_vector for storing the tree that is found by the algorithm. 142 144 After that, we could call the \ref kruskal() function. It gives back the weight 143 145 of the minimum spanning tree and \c tree_map or \c tree_vector … … 168 170 std::vector<ListGraph::Edge> tree_vector; 169 171 std::cout << "The weight of the minimum spanning tree is " 170 << kruskal(g, cost_map, tree_vector) << std::endl; 172 << kruskal(g, cost_map, std::back_inserter(tree_vector)) 173 << std::endl; 171 174 172 175 // Print the results
Note: See TracChangeset
for help on using the changeset viewer.