#ifndef CONNECTEDCOMPONENTS_H_
#define CONNECTEDCOMPONENTS_H_

#include <set>
#include <map>
#include <list>
#include "float.h"
#include "networks/graph/RealWeightedGraph.h"

namespace cosi
{

namespace algorithms
{

namespace graph
{

class ConnectedComponents
{
public:
	ConnectedComponents(cosi::commstruct::graph::U_RealWeightedGraph* G);
	void Run() ;
	std::set< std::set<Vertex> > GetComponents() ;
	virtual ~ConnectedComponents();
private:
	bool Disjoint(Vertex U , Vertex V ) ;
	void Union(Vertex U , Vertex V ) ;
	cosi::commstruct::graph::U_RealWeightedGraph* mG;
	std::set< std::set<Vertex> > mComponents ;

};

}

}

}

#endif /*CONNECTEDCOMPONENTS_H_*/
