Changeset 50:72867897fcba in lemontutorial
 Timestamp:
 02/22/10 13:00:14 (10 years ago)
 Branch:
 default
 Phase:
 public
 Files:

 4 edited
Legend:
 Unmodified
 Added
 Removed

algorithms.dox
r49 r50 197 197 198 198 \code 199 Dijkstra<ListDigraph> dijk tra(g, length);199 Dijkstra<ListDigraph> dijkstra(g, length); 200 200 dijkstra.distMap(dist); 201 201 dijsktra.init(); 
graphs.dox
r46 r50 82 82 SmartDigraph, especially using \ref concepts::Digraph::OutArcIt 83 83 "OutArcIt" iterators, since its arcs are stored in an appropriate order. 84 However, it only provides \ref StaticDigraph::build() "build()" and 85 \ref \ref StaticDigraph::clear() "clear()" functions and does not 86 support any other modification of the digraph. 84 However, you can neither add nor delete arcs or nodes, the graph 85 has to be built at once and other modifications are not supported. 87 86 88 87 \ref FullDigraph is an efficient implementation of a directed full graph. 89 This structure is also completely static , so you can neither add nor delete90 arcs or nodes, moreover, the class needs constant spacein memory.88 This structure is also completely static and it needs constant space 89 in memory. 91 90 92 91 … … 95 94 The general undirected graph classes, \ref ListGraph and \ref SmartGraph 96 95 have similar implementations as their directed variants. 97 Therefore, \ref Smart Digraph is more efficient, but \ref ListGraph provides96 Therefore, \ref SmartGraph is more efficient, but \ref ListGraph provides 98 97 more functionality. 99 100 98 In addition to these general structures, LEMON also provides special purpose 101 99 undirected graph types for handling \ref FullGraph "full graphs", 102 100 \ref GridGraph "grid graphs" and \ref HypercubeGraph "hypercube graphs". 103 They all static structures, i.e. they do not allow distinct item additions104 or deletions, the graph has to be built at once.105 101 106 102 [TRAILER] 
lp.dox
r48 r50 66 66 lp.solve(); 67 67 68 cout << "Objective function value: " << lp.primal() <<endl;69 cout << "x1 = " << lp.primal(x1) <<endl;70 cout << "x2 = " << lp.primal(x2) <<endl;68 std::cout << "Objective function value: " << lp.primal() << std::endl; 69 std::cout << "x1 = " << lp.primal(x1) << std::endl; 70 std::cout << "x2 = " << lp.primal(x2) << std::endl; 71 71 \endcode 72 72 … … 111 111 lp.obj(o); 112 112 lp.solve(); 113 114 std::cout << "Max flow value: " << lp.primal() << std::endl; 113 115 \endcode 114 116 
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.