Boost logo

Boost Users :

From: Aaron Windsor (aaron.windsor_at_[hidden])
Date: 2008-02-06 08:53:01


On Feb 6, 2008 4:39 AM, Sebastian Weber
<sebastian.weber_at_[hidden]> wrote:
> Hi everyone!
>
> I think I've hit a but in the remove_edge(u,v,bg) function in case I
> want to delete a self-edge. The following code crashes on my machine:
>
> using namespace boost;
> typedef adjacency_list<vecS, vecS, undirectedS > ubase_graph_t;
>
> ubase_graph_t bg(5);
>
> add_edge(0, 1, bg);
> add_edge(1, 2, bg);
> add_edge(3, 4, bg);
> add_edge(4, 0, bg);
> add_edge(2, 2, bg);
>
> remove_edge(2, 2, bg);
>
> However, deleting via edge_descriptors is working:
>
> BGL_FORALL_OUTEDGES(2, ed, bg, ubase_graph_t) {
> if(target(ed, bg) == 2) {
> remove_edge(ed, bg);
> break;
> }
> }
>
> So what is wrong with remove_edge(u, u, bg) if there is a self-edge?

Hi Sebastian,

I can recreate the bug you're describing - this problem was actually
brought up a year ago as well, see:
http://lists.boost.org/Archives/boost/2007/02/116438.php. My reply to
that message describes what's going on. I've put in a ticket in for
this: http://svn.boost.org/trac/boost/ticket/1622. It won't be fixed
for 1.35, but should be fixed by the next release. Unfortunately, the
only workaround I can suggest is the one you've already discovered -
removing by edge descriptor.

Regards,
Aaron


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