Boost logo

Boost Users :

From: Martin Okrslar (okrslar_at_[hidden])
Date: 2003-03-12 13:02:44


Dear Group,

when computing the connected components of a BGL graph one has to create
a vector that holds the component integer assigned to each vertex (See
http://www.boost.org/libs/graph/example/connected_components.cpp and
http://www.boost.org/libs/graph/doc/connected_components.html).

OK, that works very well. But how can I get the component number of each
vertex? If my graph has internal properties, I can not simply access the
vector with an iterator on the graph vertices:

component[*vi]; //doesn't work!

This doesn't work, because the vertices (to be specific: the vertex
desriptors) of the graph aren't integers if the graph has internal
properties.

Any idea how to get the component of each vertex?

all the best
 Martin

-- 
-----------------------------------------------------------------------------
Martin Okrslar
MPI for Molecular Genetics          phone: ++ 49 + 30 / 8413-1166
Computational Molecular Biology     Fax:   ++ 49 + 30 / 8413-1152
Ihnestrasse 73                      email: okrslar_at_[hidden]
D-14195 Berlin                      URL:   http://cmb.molgen.mpg.de
-----------------------------------------------------------------------------

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