1.1 --- a/lemon/kruskal.h Wed Sep 06 10:28:13 2006 +0000
1.2 +++ b/lemon/kruskal.h Wed Sep 06 11:17:12 2006 +0000
1.3 @@ -24,6 +24,8 @@
1.4 #include <lemon/unionfind.h>
1.5 #include <lemon/bits/utility.h>
1.6 #include <lemon/bits/traits.h>
1.7 +#include <lemon/time_measure.h>
1.8 +#include <iostream>
1.9
1.10 ///\ingroup spantree
1.11 ///\file
1.12 @@ -117,8 +119,12 @@
1.13 typedef typename GR::template NodeMap<int> NodeIntMap;
1.14 typedef typename GR::Node Node;
1.15
1.16 - NodeIntMap comp(g, -1);
1.17 - UnionFind<Node,NodeIntMap> uf(comp);
1.18 + Timer timer;
1.19 + NodeIntMap comp(g);
1.20 + UnionFind<Node,NodeIntMap> uf(comp);
1.21 + for (typename GR::NodeIt it(g); it != INVALID; ++it) {
1.22 + uf.insert(it);
1.23 + }
1.24
1.25 EdgeCost tot_cost = 0;
1.26 for (typename IN::const_iterator p = in.begin();
1.27 @@ -132,6 +138,7 @@
1.28 out.set((*p).first, false);
1.29 }
1.30 }
1.31 + std::cout << timer << std::endl;
1.32 return tot_cost;
1.33 }
1.34