1.1 --- a/doc/quicktour.dox Fri Jul 01 10:33:27 2005 +0000
1.2 +++ b/doc/quicktour.dox Fri Jul 01 16:10:46 2005 +0000
1.3 @@ -22,7 +22,10 @@
1.4 example a length or capacity function defined on the edges. You can do this in
1.5 LEMON using so called \b 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 maps-page "here".
1.6
1.7 -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):
1.8 +In this quick tour we want to show you some facilities LEMON library can provide through examples (simple demo programs). The examples will only show part of the functionality, but links will always be given to reach complete details.
1.9 +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 getstart "How to start using LEMON".
1.10 +
1.11 +Have fun!
1.12
1.13 <ul> <li> The first thing to discuss is the way one can create data structures
1.14 like graphs and maps in a program using LEMON.
1.15 @@ -79,56 +82,18 @@
1.16 (called \c coordinates_x and \c coordinates_y), several edges, an edge map
1.17 called \c length and two designated nodes (called \c source and \c target).
1.18
1.19 -\todo Maybe another example would be better here.
1.20 +\todo Maybe a shorter example would be better here.
1.21
1.22 -\code
1.23 -@nodeset
1.24 -id coordinates_x coordinates_y
1.25 -9 447.907 578.328
1.26 -8 79.2573 909.464
1.27 -7 878.677 960.04
1.28 -6 11.5504 938.413
1.29 -5 327.398 815.035
1.30 -4 427.002 954.002
1.31 -3 148.549 753.748
1.32 -2 903.889 326.476
1.33 -1 408.248 577.327
1.34 -0 189.239 92.5316
1.35 -@edgeset
1.36 - length
1.37 -2 3 901.074
1.38 -8 5 270.85
1.39 -6 9 601.553
1.40 -5 9 285.022
1.41 -9 4 408.091
1.42 -3 0 719.712
1.43 -7 5 612.836
1.44 -0 4 933.353
1.45 -5 0 778.871
1.46 -5 5 0
1.47 -7 1 664.049
1.48 -5 5 0
1.49 -0 9 560.464
1.50 -4 8 352.36
1.51 -4 9 399.625
1.52 -4 1 402.171
1.53 -1 2 591.688
1.54 -3 8 182.376
1.55 -4 5 180.254
1.56 -3 1 345.283
1.57 -5 4 184.511
1.58 -6 2 1112.45
1.59 -0 1 556.624
1.60 -@nodes
1.61 -source 1
1.62 -target 8
1.63 -@end
1.64 -\endcode
1.65 +\include route.lgf
1.66
1.67 Finally let us give a simple example that reads a graph from a file and writes
1.68 -it to another.
1.69 +it to the standard output.
1.70
1.71 -\todo This is to be done!
1.72 +\include reader_writer_demo.cc
1.73 +
1.74 +See the whole program in file \ref reader_writer_demo.cc.
1.75 +
1.76 +\todo This is still under construction!
1.77
1.78 </ol>
1.79 <li> If you want to solve some transportation problems in a network then
1.80 @@ -139,62 +104,9 @@
1.81 \ref lemon::Dijkstra "LEMON Dijkstra class" and it also shows how to define a map on the edges (the length
1.82 function):
1.83
1.84 -\code
1.85 -
1.86 - typedef ListGraph Graph;
1.87 - typedef Graph::Node Node;
1.88 - typedef Graph::Edge Edge;
1.89 - typedef Graph::EdgeMap<int> LengthMap;
1.90 -
1.91 - Graph g;
1.92 -
1.93 - //An example from Ahuja's book
1.94 -
1.95 - Node s=g.addNode();
1.96 - Node v2=g.addNode();
1.97 - Node v3=g.addNode();
1.98 - Node v4=g.addNode();
1.99 - Node v5=g.addNode();
1.100 - Node t=g.addNode();
1.101 -
1.102 - Edge s_v2=g.addEdge(s, v2);
1.103 - Edge s_v3=g.addEdge(s, v3);
1.104 - Edge v2_v4=g.addEdge(v2, v4);
1.105 - Edge v2_v5=g.addEdge(v2, v5);
1.106 - Edge v3_v5=g.addEdge(v3, v5);
1.107 - Edge v4_t=g.addEdge(v4, t);
1.108 - Edge v5_t=g.addEdge(v5, t);
1.109 -
1.110 - LengthMap len(g);
1.111 -
1.112 - len.set(s_v2, 10);
1.113 - len.set(s_v3, 10);
1.114 - len.set(v2_v4, 5);
1.115 - len.set(v2_v5, 8);
1.116 - len.set(v3_v5, 5);
1.117 - len.set(v4_t, 8);
1.118 - len.set(v5_t, 8);
1.119 -
1.120 - std::cout << "The id of s is " << g.id(s)<< std::endl;
1.121 - std::cout <<"The id of t is " << g.id(t)<<"."<<std::endl;
1.122 -
1.123 - std::cout << "Dijkstra algorithm test..." << std::endl;
1.124 -
1.125 - Dijkstra<Graph, LengthMap> dijkstra_test(g,len);
1.126 -
1.127 - dijkstra_test.run(s);
1.128 -
1.129 -
1.130 - std::cout << "The distance of node t from node s: " << dijkstra_test.dist(t)<<std::endl;
1.131 -
1.132 - std::cout << "The shortest path from s to t goes through the following nodes" <<std::endl;
1.133 - std::cout << " (the first one is t, the last one is s): "<<std::endl;
1.134 -
1.135 - for (Node v=t;v != s; v=dijkstra_test.predNode(v)){
1.136 - std::cout << g.id(v) << "<-";
1.137 - }
1.138 - std::cout << g.id(s) << std::endl;
1.139 -\endcode
1.140 +\dontinclude dijkstra_demo.cc
1.141 +\skip ListGraph
1.142 +\until std::cout << g.id(s)
1.143
1.144 See the whole program in \ref dijkstra_demo.cc.
1.145
1.146 @@ -209,7 +121,7 @@
1.147 <li> If you want to design a network and want to minimize the total length
1.148 of wires then you might be looking for a <b>minimum spanning tree</b> in
1.149 an undirected graph. This can be found using the Kruskal algorithm: the
1.150 -class \ref lemon::Kruskal "LEMON Kruskal class" does this job for you.
1.151 +function \ref lemon::kruskal "LEMON Kruskal ..." does this job for you.
1.152 The following code fragment shows an example:
1.153
1.154 Ide Zsuzska fog irni!
1.155 @@ -336,9 +248,9 @@
1.156
1.157 The complete program can be found in file \ref lp_maxflow_demo.cc. After compiling run it in the form:
1.158
1.159 -<tt>./lp_maxflow_demo < ?????????.lgf</tt>
1.160 +<tt>./lp_maxflow_demo < sample.lgf</tt>
1.161
1.162 -where ?????????.lgf is a file in the lemon format containing a maxflow instance (designated "source", "target" nodes and "capacity" map on the edges).
1.163 +where sample.lgf is a file in the lemon format containing a maxflow instance (designated "source", "target" nodes and "capacity" map on the edges).
1.164
1.165
1.166