Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL] Remove vertices/edges from a subgraph
From: Andrew Sutton (andrew.n.sutton_at_[hidden])
Date: 2009-01-22 20:12:33


> I see. But suppose I have a graph that is attached to some root graph but
> has no subgraphs of its own, and I want to remove some nodes and edges
> (without affecting rest of the hierarchy at all), what would be the best way
> to do that?
>

Carefully :)

You mean that the subgraphs are disjoint and you want to remove elements
form a disjoint subgraph and the root graph? You might need to create a new
graph data structure - lets call it disjoint_subgraphs - that's kind of a
flattened, inverted version of the subgraph system. Each subgraph is
actually an independent, fully mutable adjacency_list (or whatever). The
"root" graph could provide a read-only view over the subgraphs. Descriptors
for the root graph would have to be redefined to reference descriptors from
specific subgraphs (not too hard). Vertex and edge iterators would simply
span the iterators of the subgraphs (also pretty easy).

Does that sound like it might do the trick?

Andrew Sutton
andrew.n.sutton_at_[hidden]



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