Boost logo

Boost Users :

Subject: Re: [Boost-users] Filtered graph losing original property
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2012-02-04 14:23:37

On Sat, 4 Feb 2012, giridhar wrote:

> > Hello All,
> >
> > ????? I have a Graph with 3 children (sub graphs). After I filter
> > certain edges of the main graph, I can't access the children. Is there
> > any turn around to work this.
> >>What do you mean "children"?  How are they represented by properties.
> typedef subgraph< adjacency_list<vecS, vecS, undirectedS,
>    Vertexp, property< edge_index_t, unsigned int, Edgep > > > Graph;
> This is the property of every graph even the main graph and children.
> I am creating children like this:
>     Graph g; // main graph
>    //graph children
>    Graph& g1=g.create_subgraph();
>     Graph& g2=g.create_subgraph();
>     Graph& g3=g.create_subgraph();
> > I want some edges to be filtered from the total graph, but still the
> > filtered graph should retain its original children (with filtered edges
> > ofcourse). Any information on this would be great help to me.
> That is the way that properties are supposed to work in filtered_graphs.
> When I filter these graphs using the predicate, I can access the edges and vertices (as if it is a whole single graph) from filtered graph. But somehow filtered graph is
> forgetting that it is made of 3 subgraphs, i.e, I cannot access children of filtered graph . For example consider G is the filtered graph, I cannot access children
> through iterators.
> tie(c1,c2)= G.children();

Remember that G here is now a filtered_graph (if I understand the example
correctly), not a subgraph. I'm sure filtered_graphs of subgraphs have
never been tested; how sophisticated is your use of subgraphs? Could you
use filtered_graphs (possibly on top of other filtered_graphs) instead?

-- Jeremiah Willcock

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