Boost logo

Boost Users :

Subject: Re: [Boost-users] BGL: Copying graphs and edge_descriptors confusion
From: Cedric Laczny (cedric.laczny_at_[hidden])
Date: 2011-06-27 13:35:38


Hi David,

On Monday, 27. June 2011 19:25:58 David Doria wrote:
> I have a graph, 'inputGraph' with a bool in its bundled edge
> properties. If I copy that graph with:
>
> Graph g = inputGraph;
>
> there seems to be some odd behavior with the edge_descriptors. If you
> take a look at this example:
>
> http://programmingexamples.net/index.php?title=CPP/Boost/BGL/CopyAGraph
>
> I set one of the edges to visible=0 and then output all of the edge
> visibilities using the iterator from boost::edges(g) - this works
> properly, the edge that I set to visible=0 indeeds shows up as such.
> However, if I instead use the iterator from boost::edges(inputGraph) ,
> all of the edges appear as visible! Shouldn't the edge_descriptors be
> identical since the graph g is an exact copy of inputGraph?
>
> Can anyone explain why the last two loops in that example do not
> produce the same output?
>

I can't explain to you why you observe this unexpected behavior, but there is
also the copy_graph() function in the BGL which might perhaps suit your needs?

Hope that helps,

Best,

Cedric

> Thanks,
>
> David
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


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