demo/kruskal_demo.cc
changeset 1680 4f8b9cee576b
parent 1584 cf4bc8d477f4
child 1875 98698b69a902
equal deleted inserted replaced
4:ebab44c44194 5:6ece04ab3088
    18 ///\file
    18 ///\file
    19 ///\brief Minimum weight spanning tree by Kruskal algorithm (demo).
    19 ///\brief Minimum weight spanning tree by Kruskal algorithm (demo).
    20 ///
    20 ///
    21 /// This demo program shows how to find a minimum weight spanning tree
    21 /// This demo program shows how to find a minimum weight spanning tree
    22 /// in a graph by using the Kruskal algorithm. 
    22 /// in a graph by using the Kruskal algorithm. 
       
    23 ///
       
    24 /// \include kruskal_demo.cc
    23 
    25 
    24 #include <iostream>
    26 #include <iostream>
    25 #include <vector>
    27 #include <vector>
    26 
    28 
    27 #include <lemon/maps.h>
    29 #include <lemon/maps.h>
   121 
   123 
   122   std::cout << "The edges of the tree again: " ;
   124   std::cout << "The edges of the tree again: " ;
   123   for(int i=tree_edge_vec.size()-1; i>=0;  i--)
   125   for(int i=tree_edge_vec.size()-1; i>=0;  i--)
   124     std::cout << g.id(tree_edge_vec[i]) << ";" ;
   126     std::cout << g.id(tree_edge_vec[i]) << ";" ;
   125   std::cout << std::endl;
   127   std::cout << std::endl;
   126   std::cout << "The size of the tree again is: "<< tree_edge_vec.size()<< std::endl; 
   128   std::cout << "The size of the tree again is: "<< tree_edge_vec.size()
       
   129 	    << std::endl; 
   127 
   130 
   128   
   131   
   129   return 0;
   132   return 0;
   130 }
   133 }