[BGL] graph without parallel edges

Hi everyboty, Can someone point to a concrete example of a graph without parallel edges??? I am using setS as my container for the edges but I still insert edges twice in my graph algorithm. Thank you, aa

On Feb 20, 2006, at 3:43 PM, Alejandro Aragón wrote:
Hi everyboty,
Can someone point to a concrete example of a graph without parallel edges??? I am using setS as my container for the edges but I still insert edges twice in my graph algorithm. Thank you,
When using setS for the OutEdgeListS, insertion of a parallel edge should have no effect at all. If this isn't the behavior you are seeing, we have a bug and we'll need to fix it. Doug

Doug Gregor wrote:
On Feb 20, 2006, at 3:43 PM, Alejandro Aragón wrote:
Hi everyboty,
Can someone point to a concrete example of a graph without parallel edges??? I am using setS as my container for the edges but I still insert edges twice in my graph algorithm. Thank you,
When using setS for the OutEdgeListS, insertion of a parallel edge should have no effect at all. If this isn't the behavior you are seeing, we have a bug and we'll need to fix it.
Doug
Well, for some reason, the boolean inserted turns out to be always 1. I'll run an example and I will let you know. a^2

Alejandro Aragón wrote:
Doug Gregor wrote:
On Feb 20, 2006, at 3:43 PM, Alejandro Aragón wrote:
Hi everyboty,
Can someone point to a concrete example of a graph without parallel edges??? I am using setS as my container for the edges but I still insert edges twice in my graph algorithm. Thank you, When using setS for the OutEdgeListS, insertion of a parallel edge should have no effect at all. If this isn't the behavior you are seeing, we have a bug and we'll need to fix it.
Doug
Well, for some reason, the boolean inserted turns out to be always 1. I'll run an example and I will let you know.
a^2
Well, it seems now that the problem is fixed. I was using a directedS graph with setS for the OutEdgeListS. I changed that to undirectedS and now edges are not added twice as before. I thought that setS completely discarded parallel edges no matter of the choice of the directivity of the graph. It doesn't make sense to me that you can have a directed graph with a disjoint set container that doesn't allow the parallel edge behavior. I think there should be some warning if you use setS with directedS right? a^2

On Feb 28, 2006, at 1:23 AM, Alejandro Aragón wrote:
Well, it seems now that the problem is fixed. I was using a directedS graph with setS for the OutEdgeListS. I changed that to undirectedS and now edges are not added twice as before. I thought that setS completely discarded parallel edges no matter of the choice of the directivity of the graph. It doesn't make sense to me that you can have a directed graph with a disjoint set container that doesn't allow the parallel edge behavior. I think there should be some warning if you use setS with directedS right?
I think the Graph library is doing the right thing here. In a directed graph, the edges (u, v) and (v, u) are not parallel edges, so even with OutEdgeListS=setS you can have both in a graph. By using setS, you won't be able to have two edges (u, v) and (u, v). Doug
participants (3)
-
Alejandro Aragón
-
Doug Gregor
-
Douglas Gregor