Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL]: How to delete whole sub-graph (tree in my case) ?
From: Andrew Sutton (andrew.n.sutton_at_[hidden])
Date: 2009-06-02 07:39:16


> I have a graph which is a tree actually.
> I need to delete the whole subtree given a vertex.
> Is there any interface to delete the whole subtree given the vertex ?
>
> or else, I will have to write a routine which does DFS and deletes
> each vertex/edge.
>
> Correct me if I am wrong:
> If I do
> clear_vertex(vertex_to_be_deleted, g)
> remove_vertex(vertex_to_be_deleted, g)
>
> I wont achieve what I want and I will get 2 disconnected graphs ?
>

Generally, yes. Unfortunately, subgraph doesn't implement remove_vertex.
It's slated as under construction, but appears to have been that way for
quite some time.

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