Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL] Updating the source vertex of an edge in-place
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2010-08-21 14:24:33


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


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