Changeset 1511:d6b95a59da26 in lemon0.x for doc/quicktour.dox
 Timestamp:
 06/24/05 10:44:54 (16 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@1994
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

doc/quicktour.dox
r1287 r1511 19 19 about \ref graphs "graphs". 20 20 21 You will also want to assign data to the edges or nodes of the graph, for example a length or capacity function defined on the edges. You can do this in LEMON using so called \ref maps "maps". You can define a map on the nodes or on the edges of the graph and the value of the map (the range of the function) can be practically almost any type. Read more about maps \ref mapspage "here".21 You will also want to assign data to the edges or nodes of the graph, for example a length or capacity function defined on the edges. You can do this in LEMON using so called \ref maps "maps". You can define a map on the nodes or on the edges of the graph and the value of the map (the range of the function) can be practically almost of any type. Read more about maps \ref mapspage "here". 22 22 23 Some examples are the following (you will find links next to the code fragments that help to download full demo programs ):23 Some examples are the following (you will find links next to the code fragments that help to download full demo programs: save them on your computer and compile them according to the description in the page about \ref getsart How to start using LEMON): 24 24 25 25  First we give two examples that show how to instantiate a graph. The 26 26 first one shows the methods that add nodes and edges, but one will 27 27 usually use the second way which reads a graph from a stream (file). 28 # 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 supp pose them later as well.28 # 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 suppose them later as well. 29 29 \code 30 30 typedef ListGraph Graph; 31 typedef Graph::Edge Edge;32 typedef Graph::InEdgeIt InEdgeIt;33 typedef Graph::OutEdgeIt OutEdgeIt;34 typedef Graph::EdgeIt EdgeIt;35 typedef Graph::Node Node;36 31 typedef Graph::NodeIt NodeIt; 37 32 … … 46 41 \endcode 47 42 43 See the whole program in file \ref helloworld.cc. 44 48 45 If you want to read more on the LEMON graph structures and concepts, read the page about \ref graphs "graphs". 49 46 50 47 # 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 51 in that format (find the documentation of the DIM ECS file format on the web).48 in that format (find the documentation of the DIMACS file format on the web). 52 49 \code 53 50 Graph g; … … 102 99 len.set(v5_t, 8); 103 100 104 std::cout << "The id of s is " << g.id(s)<< ", the id of t is " << g.id(t)<<"."<<std::endl; 101 std::cout << "The id of s is " << g.id(s)<< std::endl; 102 std::cout <<"The id of t is " << g.id(t)<<"."<<std::endl; 105 103 106 104 std::cout << "Dijkstra algorithm test..." << std::endl; … … 113 111 std::cout << "The distance of node t from node s: " << dijkstra_test.dist(t)<<std::endl; 114 112 115 std::cout << "The shortest path from s to t goes through the following nodes (the first one is t, the last one is s): "<<std::endl; 113 std::cout << "The shortest path from s to t goes through the following nodes" <<std::endl; 114 std::cout << " (the first one is t, the last one is s): "<<std::endl; 116 115 117 116 for (Node v=t;v != s; v=dijkstra_test.predNode(v)){ … … 137 136 The following code fragment shows an example: 138 137 138 Ide Zsuzska fog irni! 139 140  141 139 142 \code 140 143
Note: See TracChangeset
for help on using the changeset viewer.