doc/quicktour.dox
changeset 1584 cf4bc8d477f4
parent 1580 a9e4208cf4e3
child 1640 9c7834ac5e64
     1.1 --- a/doc/quicktour.dox	Fri Jul 22 15:15:29 2005 +0000
     1.2 +++ b/doc/quicktour.dox	Fri Jul 22 16:57:07 2005 +0000
     1.3 @@ -143,28 +143,26 @@
     1.4  <li> If you want to design a network and want to minimize the total
     1.5  length of wires then you might be looking for a <b>minimum spanning
     1.6  tree</b> in an undirected graph. This can be found using the Kruskal
     1.7 -algorithm: the function \ref lemon::kruskal "LEMON Kruskal " does
     1.8 -this job for you.  After we had a graph \c g and a cost map \c
     1.9 -edge_cost_map , the following code fragment shows an example how to get weight of the minmum spanning tree (in this first example the costs are uniform; this is of course not the case in real life applications):
    1.10 +algorithm: the function \ref lemon::kruskal "LEMON Kruskal " does this
    1.11 +job for you.  
    1.12 +
    1.13 +First make a graph \c g and a cost map \c
    1.14 +edge_cost_map, then make a bool edgemap \c tree_map or a vector \c
    1.15 +tree_edge_vec for the algorithm output. After calling the function it
    1.16 +gives back the weight of the minimum spanning tree and the \c tree_map or
    1.17 +the \c tree_edge_vec contains the edges of the tree.
    1.18 +
    1.19 +If you want to store the edges in a bool edgemap, then use the
    1.20 +function as follows:
    1.21  
    1.22  \dontinclude kruskal_demo.cc
    1.23 -\skip std::cout 
    1.24 -\until kruskal
    1.25 +\skip Kruskal with boolmap; 
    1.26 +\until  std::endl
    1.27  
    1.28 -In the variable \c tree_map the function gives back an edge bool map, which contains the edges of the found tree.
    1.29 +And if you rather use a vector instead of a bool map:
    1.30  
    1.31 -If the costs are non-uniform, for example  the cost is given by \c
    1.32 -edge_cost_map_2 , or the edges of the tree  have to be given in a
    1.33 -vector, then we can give to the kruskal a vector \c tree_edge_vec , instead of
    1.34 -an edge bool map:
    1.35 -
    1.36 -\skip edge_cost_map_2 
    1.37 -\until edge_cost_map_2, std::back_inserter
    1.38 -
    1.39 -And finally the next fragment shows how to use the functions \c makeKruskalMapInput and \c makeKruskalSequenceOutPut:
    1.40 -
    1.41 -\skip makeKruskalSequenceOutput
    1.42 -\until tree_edge_vec
    1.43 +\skip Kruskal with vector; 
    1.44 +\until std::endl
    1.45  
    1.46  See the whole program in \ref kruskal_demo.cc.
    1.47