Minor improvements
authorPeter Kovacs <kpeter@inf.elte.hu>
Mon, 22 Feb 2010 13:00:14 +0100
changeset 5072867897fcba
parent 49 c8c5a2a4ec71
child 51 e335f323a929
Minor improvements
algorithms.dox
graphs.dox
lp.dox
undir_graphs.dox
     1.1 --- a/algorithms.dox	Mon Feb 22 02:03:25 2010 +0100
     1.2 +++ b/algorithms.dox	Mon Feb 22 13:00:14 2010 +0100
     1.3 @@ -196,7 +196,7 @@
     1.4  The original sample code could also use the class interface as follows.
     1.5  
     1.6  \code
     1.7 -  Dijkstra<ListDigraph> dijktra(g, length);
     1.8 +  Dijkstra<ListDigraph> dijkstra(g, length);
     1.9    dijkstra.distMap(dist);
    1.10    dijsktra.init();
    1.11    dijkstra.addSource(u);
     2.1 --- a/graphs.dox	Mon Feb 22 02:03:25 2010 +0100
     2.2 +++ b/graphs.dox	Mon Feb 22 13:00:14 2010 +0100
     2.3 @@ -81,27 +81,23 @@
     2.4  provides faster item iteration than \ref ListDigraph and \ref
     2.5  SmartDigraph, especially using \ref concepts::Digraph::OutArcIt
     2.6  "OutArcIt" iterators, since its arcs are stored in an appropriate order.
     2.7 -However, it only provides \ref StaticDigraph::build() "build()" and
     2.8 -\ref \ref StaticDigraph::clear() "clear()" functions and does not
     2.9 -support any other modification of the digraph.
    2.10 +However, you can neither add nor delete arcs or nodes, the graph
    2.11 +has to be built at once and other modifications are not supported.
    2.12   
    2.13  \ref FullDigraph is an efficient implementation of a directed full graph.
    2.14 -This structure is also completely static, so you can neither add nor delete
    2.15 -arcs or nodes, moreover, the class needs constant space in memory.
    2.16 +This structure is also completely static and it needs constant space
    2.17 +in memory.
    2.18  
    2.19  
    2.20  [SEC]sec_graph_types[SEC] Undirected Graph Structures
    2.21  
    2.22  The general undirected graph classes, \ref ListGraph and \ref SmartGraph
    2.23  have similar implementations as their directed variants.
    2.24 -Therefore, \ref SmartDigraph is more efficient, but \ref ListGraph provides
    2.25 +Therefore, \ref SmartGraph is more efficient, but \ref ListGraph provides
    2.26  more functionality.
    2.27 -
    2.28  In addition to these general structures, LEMON also provides special purpose
    2.29  undirected graph types for handling \ref FullGraph "full graphs",
    2.30  \ref GridGraph "grid graphs" and \ref HypercubeGraph "hypercube graphs".
    2.31 -They all static structures, i.e. they do not allow distinct item additions
    2.32 -or deletions, the graph has to be built at once.
    2.33  
    2.34  [TRAILER]
    2.35  */
     3.1 --- a/lp.dox	Mon Feb 22 02:03:25 2010 +0100
     3.2 +++ b/lp.dox	Mon Feb 22 13:00:14 2010 +0100
     3.3 @@ -65,9 +65,9 @@
     3.4    lp.obj(10 * x1 + 6 * x2);
     3.5    lp.solve();
     3.6  
     3.7 -  cout << "Objective function value: " << lp.primal() << endl;
     3.8 -  cout << "x1 = " << lp.primal(x1) << endl;
     3.9 -  cout << "x2 = " << lp.primal(x2) << endl;
    3.10 +  std::cout << "Objective function value: " << lp.primal() << std::endl;
    3.11 +  std::cout << "x1 = " << lp.primal(x1) << std::endl;
    3.12 +  std::cout << "x2 = " << lp.primal(x2) << std::endl;
    3.13  \endcode
    3.14  
    3.15  \ref LpBase::Col "Lp::Col" type represents the variables in the LP problems,
    3.16 @@ -110,6 +110,8 @@
    3.17    lp.max();
    3.18    lp.obj(o);
    3.19    lp.solve();
    3.20 +
    3.21 +  std::cout << "Max flow value: " << lp.primal() << std::endl;
    3.22  \endcode
    3.23  
    3.24  [TRAILER]
     4.1 --- a/undir_graphs.dox	Mon Feb 22 02:03:25 2010 +0100
     4.2 +++ b/undir_graphs.dox	Mon Feb 22 13:00:14 2010 +0100
     4.3 @@ -131,6 +131,8 @@
     4.4  
     4.5  [SEC]sec_undir_graph_algs[SEC] Undirected Graph Algorihtms
     4.6  
     4.7 +\todo This subsection is under construction.
     4.8 +
     4.9  If you would like to design an electric network minimizing the total length
    4.10  of wires, then you might be looking for a minimum spanning tree in an
    4.11  undirected graph.
    4.12 @@ -138,7 +140,7 @@
    4.13  
    4.14  Let us suppose that the network is stored in a \ref ListGraph object \c g
    4.15  with a cost map \c cost. We create a \c bool valued edge map \c tree_map or
    4.16 -a vector \c tree_vector for stroing the tree that is found by the algorithm.
    4.17 +a vector \c tree_vector for storing the tree that is found by the algorithm.
    4.18  After that, we could call the \ref kruskal() function. It gives back the weight
    4.19  of the minimum spanning tree and \c tree_map or \c tree_vector
    4.20  will contain the found spanning tree.
    4.21 @@ -167,7 +169,8 @@
    4.22    // Kruskal algorithm with edge vector
    4.23    std::vector<ListGraph::Edge> tree_vector;
    4.24    std::cout << "The weight of the minimum spanning tree is "
    4.25 -            << kruskal(g, cost_map, tree_vector) << std::endl;
    4.26 +            << kruskal(g, cost_map, std::back_inserter(tree_vector))
    4.27 +            << std::endl;
    4.28  
    4.29    // Print the results
    4.30    std::cout << "Edges of the tree: " << std::endl;