# HG changeset patch # User Peter Kovacs # Date 1266840014 -3600 # Node ID 72867897fcba8344439eff1a3bf1e2c51952e4f7 # Parent c8c5a2a4ec71a8558686228a84a6ca56dc2c2754 Minor improvements diff -r c8c5a2a4ec71 -r 72867897fcba algorithms.dox --- a/algorithms.dox Mon Feb 22 02:03:25 2010 +0100 +++ b/algorithms.dox Mon Feb 22 13:00:14 2010 +0100 @@ -196,7 +196,7 @@ The original sample code could also use the class interface as follows. \code - Dijkstra dijktra(g, length); + Dijkstra dijkstra(g, length); dijkstra.distMap(dist); dijsktra.init(); dijkstra.addSource(u); diff -r c8c5a2a4ec71 -r 72867897fcba graphs.dox --- a/graphs.dox Mon Feb 22 02:03:25 2010 +0100 +++ b/graphs.dox Mon Feb 22 13:00:14 2010 +0100 @@ -81,27 +81,23 @@ provides faster item iteration than \ref ListDigraph and \ref SmartDigraph, especially using \ref concepts::Digraph::OutArcIt "OutArcIt" iterators, since its arcs are stored in an appropriate order. -However, it only provides \ref StaticDigraph::build() "build()" and -\ref \ref StaticDigraph::clear() "clear()" functions and does not -support any other modification of the digraph. +However, you can neither add nor delete arcs or nodes, the graph +has to be built at once and other modifications are not supported. \ref FullDigraph is an efficient implementation of a directed full graph. -This structure is also completely static, so you can neither add nor delete -arcs or nodes, moreover, the class needs constant space in memory. +This structure is also completely static and it needs constant space +in memory. [SEC]sec_graph_types[SEC] Undirected Graph Structures The general undirected graph classes, \ref ListGraph and \ref SmartGraph have similar implementations as their directed variants. -Therefore, \ref SmartDigraph is more efficient, but \ref ListGraph provides +Therefore, \ref SmartGraph is more efficient, but \ref ListGraph provides more functionality. - In addition to these general structures, LEMON also provides special purpose undirected graph types for handling \ref FullGraph "full graphs", \ref GridGraph "grid graphs" and \ref HypercubeGraph "hypercube graphs". -They all static structures, i.e. they do not allow distinct item additions -or deletions, the graph has to be built at once. [TRAILER] */ diff -r c8c5a2a4ec71 -r 72867897fcba lp.dox --- a/lp.dox Mon Feb 22 02:03:25 2010 +0100 +++ b/lp.dox Mon Feb 22 13:00:14 2010 +0100 @@ -65,9 +65,9 @@ lp.obj(10 * x1 + 6 * x2); lp.solve(); - cout << "Objective function value: " << lp.primal() << endl; - cout << "x1 = " << lp.primal(x1) << endl; - cout << "x2 = " << lp.primal(x2) << endl; + std::cout << "Objective function value: " << lp.primal() << std::endl; + std::cout << "x1 = " << lp.primal(x1) << std::endl; + std::cout << "x2 = " << lp.primal(x2) << std::endl; \endcode \ref LpBase::Col "Lp::Col" type represents the variables in the LP problems, @@ -110,6 +110,8 @@ lp.max(); lp.obj(o); lp.solve(); + + std::cout << "Max flow value: " << lp.primal() << std::endl; \endcode [TRAILER] diff -r c8c5a2a4ec71 -r 72867897fcba undir_graphs.dox --- a/undir_graphs.dox Mon Feb 22 02:03:25 2010 +0100 +++ b/undir_graphs.dox Mon Feb 22 13:00:14 2010 +0100 @@ -131,6 +131,8 @@ [SEC]sec_undir_graph_algs[SEC] Undirected Graph Algorihtms +\todo This subsection is under construction. + If you would like to design an electric network minimizing the total length of wires, then you might be looking for a minimum spanning tree in an undirected graph. @@ -138,7 +140,7 @@ Let us suppose that the network is stored in a \ref ListGraph object \c g with a cost map \c cost. We create a \c bool valued edge map \c tree_map or -a vector \c tree_vector for stroing the tree that is found by the algorithm. +a vector \c tree_vector for storing the tree that is found by the algorithm. After that, we could call the \ref kruskal() function. It gives back the weight of the minimum spanning tree and \c tree_map or \c tree_vector will contain the found spanning tree. @@ -167,7 +169,8 @@ // Kruskal algorithm with edge vector std::vector tree_vector; std::cout << "The weight of the minimum spanning tree is " - << kruskal(g, cost_map, tree_vector) << std::endl; + << kruskal(g, cost_map, std::back_inserter(tree_vector)) + << std::endl; // Print the results std::cout << "Edges of the tree: " << std::endl;