Boost logo

Boost Users :

Subject: Re: [Boost-users] BGL - accessing component subgraphs.
From: Adam Spargo (aws_at_[hidden])
Date: 2010-07-15 12:09:17

> There is a subgraph class in BGL, and also filtered_graph. Are the subgraphs
> you're working with induced subgraphs (i.e., you do not selectively remove
> edges other than by filtering out their endpoints)? The subgraph class seems
> to make the subgraphs look more like normal graphs, while filtered_graph is
> probably much simpler (it doesn't update num_vertices() to match the subgraph
> size, for example). If you're passing in something like the connected
> components of a graph individually, that is an induced subgraph and so either
> of those classes will work directly.

Thanks, I think that it is filtered_graph that I want as the vertex
indices are meaningful to me. I've adapted the filtered_graph example to
do what I want on a small graph, code attached. Just a couple questions -
is finding the components, then copying into a property map the most
efficient method, could I have the component algorithm populate the
property map directly. Second, I could only get this working by adding an
edge filter AND a vertex filter, but really I only need a vertex filter,
how to pass an 'empty' function object to the constructor?

Thanks for your help,


 The Wellcome Trust Sanger Institute is operated by Genome Research 
 Limited, a charity registered in England with number 1021457 and a 
 company registered in England with number 2742969, whose registered 
 office is 215 Euston Road, London, NW1 2BE. 

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at