Boost logo

Boost Users :

From: Dmitry (dmitry_at_[hidden])
Date: 2007-01-28 09:40:06


Hi, Tamas
Why you don't try this, seems should work:
 
graph_t cityg (bigedges.begin (), bigedges.end (), bigweights.begin (),
dim);
int num = strong_components(cityg, &component[0]);
 
you use std::vector as vertex storage, right?
Regards,
Dmitry

> Hello,
> I'm trying to use the boost library's strong_components function to
> partition a graph to connected sub-partitions, and ran into a problem.
 
> std::vector<int> other;
> // fill up the vector with the vertices by pushing back each one. The
number
> of vertices is about 170k and the biggest vertex index is about 260k.
> // ..
> // bigedges and bigweights have the edges and the weights, dim is the
total
> number of vertices - all these are checked and proper.
>
> graph_t cityg (bigedges.begin (), bigedges.end (), bigweights.begin (),
> dim);
> std::vector<int> component(num_vertices(cityg));
> int num = strong_components(cityg, &component[0], boost::vertex_index_map
> (&other[0]));
>

> Tamas
>


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net