[BGL] Updating the source vertex of an edge in-place
I need to be able to update the source vertex of an edge in-place. The only option that I see is to remove the edge with `remove_edge` and then add a new edge with `add_edge`. The problem, however, is that I think this will mess up a property map of an edge property if it cannot expand to map a new value for the newly-added edge. Thus, I would like to update the edge in-place. How do I do this?
On Fri, 20 Aug 2010, Daniel Trebbien wrote:
I need to be able to update the source vertex of an edge in-place. The only option that I see is to remove the edge with `remove_edge` and then add a new edge with `add_edge`. The problem, however, is that I think this will mess up a property map of an edge property if it cannot expand to map a new value for the newly-added edge. Thus, I would like to update the edge in-place.
That would typically not be possible. For example, in an adjacency list structure, moving an edge would involve removing it from one array and adding it to another. You will need to use remove_edge() then add_edge(), getting the properties of the edge before removal and using those when re-adding the edge. -- Jeremiah Willcock
participants (2)
-
Daniel Trebbien
-
Jeremiah Willcock