Boost.graph - changing edge end-points or copying an edge

F

Ferdi Smit

I wrote a generic algorithm for boost.graph to merge two vertices, ie. the
end-points of an edge are joined together as if they are a single
vertex. I'm currently doing this by creating a new vertex, and creating an
edge to this new vertex from every incident vertex of any of the
end-points (and then deleting the end points and every incident edge).
The problem with this approach is that edge properties are not maintained.
The newly added edges should be copies of the old edges, with the same
properties. Alternatively it would be ok if it was possible to change the
source or target of an existing edge to a different vertex.

As far as I can tell from browsing through the documentation this is not
possible. I could manually copy some properties, but then the algorithm
loses its generality. Is there a way to copy an edge or vertex, including
all its properties? Alternatively is there a way to change the
source/target vertex of an edge?

Thanks,
-Ferdi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top