Ejemplo n.º 1
0
void gen_rand_graph(TGraph& g, size_t nV, size_t nE)
{
	g.clear();
	boost::mt19937 rng;
	boost::generate_random_graph(g, nV, nE, rng, true, true);
	boost::uniform_real<> ur(-1,10); 
	boost::variate_generator<boost::mt19937&, boost::uniform_real<> >	ew1rg(rng, ur);
	randomize_property<edge_weight_t>(g, ew1rg);
	boost::uniform_int<> uint(1,5); 
	boost::variate_generator<boost::mt19937&, boost::uniform_int<> >	ew2rg(rng, uint);
	randomize_property<edge_weight2_t>(g, ew2rg);
}