Some day this file will contain an erasable version of SmartGraph.
2 Kruskal's algorithm to find a spanning tree of minimum weight
3 If the graph is not connected, it gives a forest.
8 #include <union_find.h>
12 template <typename graph_type, typename T>
17 typedef typename graph_type::NodeIt NodeIt;
18 typedef typename graph_type::EdgeIt EdgeIt;
19 typedef typename graph_type::EachNodeIt EachNodeIt;
20 typedef typename graph_type::EachEdgeIt EachEdgeIt;
21 typedef typename graph_type::SymEdgeIt SymEdgeIt;
25 typename graph_type::EdgeMap<T> &weight;
27 //Auxilliary variables
28 typename graph_type::NodeMap<int> component(flowG);
32 typename graph_type::EdgeMap<T> & _weight)
39 /*Originally by Misi.*/
42 NodeMap<graph_type, T> &d;
43 Node_dist_comp(NodeMap<graph_type, T> &_d) : d(_d) {}
45 bool operator()(const NodeIt& u, const NodeIt& v) const
46 { return d.get(u) < d.get(v); }