COIN-OR::LEMON - Graph Library

Changeset 1181:848b6006941d in lemon-0.x for doc


Ignore:
Timestamp:
03/02/05 10:51:11 (15 years ago)
Author:
athos
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1589
Message:

Some work has been done in the quicktour.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/quicktour.dox

    r1175 r1181  
    1717
    1818
    19 Some examples are the following:
     19Some examples are the following (you will find links next to the code fragments that help to download full demo programs):
    2020
    2121- First we give two examples that show how to instantiate a graph. The
    2222first one shows the methods that add nodes and edges, but one will
    2323usually use the second way which reads a graph from a stream (file).
    24 
    25 
    26 -# The following code fragment shows how to fill a graph with data.
    27 
     24-# The following code fragment shows how to fill a graph with data. It creates a complete graph on 4 nodes. The type Listgraph is one of the LEMON graph types: the typedefs in the beginning are for convenience and we will supppose them later as well.
    2825 \code
    29 
    3026  typedef ListGraph Graph;
    3127  typedef Graph::Edge Edge;
     
    4440    for (NodeIt j(g); j!=INVALID; ++j)
    4541      if (i != j) g.addEdge(i, j);
    46 
    4742 \endcode
    4843
    49  -#
     44If you want to read more on the LEMON graph structures and concepts, read the page about \ref graphs "graphs".
     45
     46-# The following code shows how to read a graph from a stream (e.g. a file). LEMON supports the DIMACS file format: it can read a graph instance from a file
     47in that format (find the documentation of the format on the web).
     48\code
     49Graph g;
     50std::ifstream f("graph.dim");
     51readDimacs(f, g);
     52\endcode
     53One can also store network (graph+capacity on the edges) instances and other things in DIMACS format: to see the details read the documentation of the \ref dimacs.h "Dimacs file format reader".
     54
    5055
    5156- If you want to solve some transportation problems in a network then
     
    5459that solves this is  the \ref lemon::Dijkstra "LEMON Dijkstra class".
    5560A simple program using the \ref lemon::Dijkstra "LEMON Dijkstra class" is
    56 as follows (we assume that the graph is already given in the memory):
     61as follows (we do not include the part that instantiates the graph and the length function):
    5762
    5863\code
    59 
     64  typedef Graph::EdgeMap<int> LengthMap;
     65  Graph G;
     66  Node s, t;
     67  LengthMap cap(G);
     68        ...
     69  Dijkstra<Graph, LengthMap>
     70        dijkstra_test(G, cap);
     71  dijkstra_test.run(s);
    6072\endcode
    6173
Note: See TracChangeset for help on using the changeset viewer.