removing parallel edges in the Boost Graph Library?
I am trying to use BGL to model a directed multigraph, but every time I
try to remove just one of the edges (u,v), it removes all of the edges
from u to v.
My graph definition is:
typedef adjacency_list
Hi Nicholas, That sounds like a bug. Could you post a complete C++ program so I can immediately reproduce the problem. Thanks, Jeremy On Mar 30, 2004, at 5:26 PM, Nicholas Burlett wrote:
I am trying to use BGL to model a directed multigraph, but every time I try to remove just one of the edges (u,v), it removes all of the edges from u to v.
My graph definition is: typedef adjacency_list
graphdata; where VertexProperty and EdgeProperty are properties I've defined. Everything else seems to work: I have can add parallel edges, find the edge I want to remove based on the EdgeProperty, filter the graph for topological sorting, check for existing edges, etc.
In the following, e is of type graph_traits<graphdata>::edge_descriptor, and g is the graph of type graphdata (defined above):
std::cout << "about to remove edge\n"; DumpInfo(); remove_edge(e, g); std::cout << "removed edge\n"; DumpInfo();
Here is some sample output: about to remove edge vertex: 0 out-edges: in-edges: (1,0) (1,0) adjacent vertices: vertex: 1 out-edges: (1,0) (1,0) in-edges: adjacent vertices: 0 0 removed edge vertex: 0 out-edges: in-edges: adjacent vertices: vertex: 1 out-edges: in-edges: adjacent vertices:
Note that there were two edges present before the call to remove_edge, but only one after.
What am I doing wrong?
I'm using version 1.31, if that helps.
Thanks, Nicholas Burlett nrb23@cornell.edu
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________
Jeremy Siek
I modified the edge_property.cpp example to demonstrate the problem. I added an edge of flow 42 to the graph defined in the file so that there are now two edges (3,6) with different capacities. I then loop through the graph, and remove any edges that have flow of 42 by calling remove_edge(e, G). Since there is only one edge in the graph that has flow 42, this calls remove_edge only once. As is evident by the output of the program, both edges (3,6) get removed from the graph. I hope this will help you find the problem. Thanks, Nicholas Burlett nrb23@cornell.edu On Mar 31, 2004, at 11:26 AM, Jeremy Siek wrote:
Hi Nicholas,
That sounds like a bug. Could you post a complete C++ program so I can immediately reproduce the problem.
Thanks, Jeremy
On Mar 30, 2004, at 5:26 PM, Nicholas Burlett wrote:
I am trying to use BGL to model a directed multigraph, but every time I try to remove just one of the edges (u,v), it removes all of the edges from u to v.
My graph definition is: typedef adjacency_list
graphdata; where VertexProperty and EdgeProperty are properties I've defined. Everything else seems to work: I have can add parallel edges, find the edge I want to remove based on the EdgeProperty, filter the graph for topological sorting, check for existing edges, etc.
In the following, e is of type graph_traits<graphdata>::edge_descriptor, and g is the graph of type graphdata (defined above):
std::cout << "about to remove edge\n"; DumpInfo(); remove_edge(e, g); std::cout << "removed edge\n"; DumpInfo();
Here is some sample output: about to remove edge vertex: 0 out-edges: in-edges: (1,0) (1,0) adjacent vertices: vertex: 1 out-edges: (1,0) (1,0) in-edges: adjacent vertices: 0 0 removed edge vertex: 0 out-edges: in-edges: adjacent vertices: vertex: 1 out-edges: in-edges: adjacent vertices:
Note that there were two edges present before the call to remove_edge, but only one after.
What am I doing wrong?
I'm using version 1.31, if that helps.
Thanks, Nicholas Burlett nrb23@cornell.edu
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Jeremy Siek
http://www.osl.iu.edu/~jsiek Ph.D. Student, Indiana University Bloomington Graduating in August 2004 and looking for work C++ Booster (http://www.boost.org) _______________________________________________ _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Hi Nicholas,
Thanks. I've checked in a fix to the bug.
Cheers,
Jeremy
_______________________________________________
Jeremy Siek
Thanks! Is there any way to get a patch against 1.31.0, or should I check out a copy from CVS (I'm a bit worried about more bugs creeping in if I go with CVS)? Thanks, Nicholas Burlett nrb23@cornell.edu On Mar 31, 2004, at 8:43 PM, Jeremy Siek wrote:
Hi Nicholas,
Thanks. I've checked in a fix to the bug.
Cheers, Jeremy _______________________________________________ Jeremy Siek
http://www.osl.iu.edu/~jsiek Ph.D. Student, Indiana University Bloomington Graduating in August 2004 and looking for work C++ Booster (http://www.boost.org) _______________________________________________ _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Hi Nicholas, You can diff the latest CVS version of boost/detail/adjacency_list.hpp against what you've got and grab the change to bidirectional_graph_helper_with_property::remove_edge. Or you can live dangerously and work out of the latest CVS snapshot. (that's what I do) Cheers, Jeremy On Mar 31, 2004, at 9:59 PM, Nicholas Burlett wrote:
Thanks!
Is there any way to get a patch against 1.31.0, or should I check out a copy from CVS (I'm a bit worried about more bugs creeping in if I go with CVS)?
Thanks, Nicholas Burlett nrb23@cornell.edu
On Mar 31, 2004, at 8:43 PM, Jeremy Siek wrote:
Hi Nicholas,
Thanks. I've checked in a fix to the bug.
Cheers, Jeremy _______________________________________________ Jeremy Siek
http://www.osl.iu.edu/~jsiek Ph.D. Student, Indiana University Bloomington Graduating in August 2004 and looking for work C++ Booster (http://www.boost.org) _______________________________________________ _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________
Jeremy Siek
participants (2)
-
Jeremy Siek
-
Nicholas Burlett