COIN-OR::LEMON - Graph Library

Changeset 50:72867897fcba in lemon-tutorial


Ignore:
Timestamp:
02/22/10 13:00:14 (10 years ago)
Author:
Peter Kovacs <kpeter@…>
Branch:
default
Phase:
public
Message:

Minor improvements

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • algorithms.dox

    r49 r50  
    197197
    198198\code
    199   Dijkstra<ListDigraph> dijktra(g, length);
     199  Dijkstra<ListDigraph> dijkstra(g, length);
    200200  dijkstra.distMap(dist);
    201201  dijsktra.init();
  • graphs.dox

    r46 r50  
    8282SmartDigraph, especially using \ref concepts::Digraph::OutArcIt
    8383"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.
     84However, you can neither add nor delete arcs or nodes, the graph
     85has to be built at once and other modifications are not supported.
    8786 
    8887\ref FullDigraph is an efficient implementation of a directed full graph.
    89 This structure is also completely static, so you can neither add nor delete
    90 arcs or nodes, moreover, the class needs constant space in memory.
     88This structure is also completely static and it needs constant space
     89in memory.
    9190
    9291
     
    9594The general undirected graph classes, \ref ListGraph and \ref SmartGraph
    9695have similar implementations as their directed variants.
    97 Therefore, \ref SmartDigraph is more efficient, but \ref ListGraph provides
     96Therefore, \ref SmartGraph is more efficient, but \ref ListGraph provides
    9897more functionality.
    99 
    10098In addition to these general structures, LEMON also provides special purpose
    10199undirected graph types for handling \ref FullGraph "full graphs",
    102100\ref GridGraph "grid graphs" and \ref HypercubeGraph "hypercube graphs".
    103 They all static structures, i.e. they do not allow distinct item additions
    104 or deletions, the graph has to be built at once.
    105101
    106102[TRAILER]
  • lp.dox

    r48 r50  
    6666  lp.solve();
    6767
    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;
    7171\endcode
    7272
     
    111111  lp.obj(o);
    112112  lp.solve();
     113
     114  std::cout << "Max flow value: " << lp.primal() << std::endl;
    113115\endcode
    114116
  • undir_graphs.dox

    r47 r50  
    132132[SEC]sec_undir_graph_algs[SEC] Undirected Graph Algorihtms
    133133
     134\todo This subsection is under construction.
     135
    134136If you would like to design an electric network minimizing the total length
    135137of wires, then you might be looking for a minimum spanning tree in an
     
    139141Let us suppose that the network is stored in a \ref ListGraph object \c g
    140142with a cost map \c cost. We create a \c bool valued edge map \c tree_map or
    141 a vector \c tree_vector for stroing the tree that is found by the algorithm.
     143a vector \c tree_vector for storing the tree that is found by the algorithm.
    142144After that, we could call the \ref kruskal() function. It gives back the weight
    143145of the minimum spanning tree and \c tree_map or \c tree_vector
     
    168170  std::vector<ListGraph::Edge> tree_vector;
    169171  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;
    171174
    172175  // Print the results
Note: See TracChangeset for help on using the changeset viewer.