[graph] removing self-edges bug?
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
On Feb 6, 2008 4:39 AM, Sebastian Weber
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
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
Hi Aaron, thanks for your hint and sorry for the spam - I did not think of checking the current bug list on the wiki. Next time. Greetings, Sebastian On Wed, 2008-02-06 at 08:53 -0500, Aaron Windsor wrote:
On Feb 6, 2008 4:39 AM, Sebastian Weber
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
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 mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Aaron Windsor
-
Sebastian Weber