Boost logo

Boost :

Subject: Re: [boost] [bgl] Reconnecting an edge
From: Matthias Walter (xammy_at_[hidden])
Date: 2010-04-01 11:49:13


On 04/01/2010 05:32 PM, Andrew Sutton wrote:
>> Is there any way to reconnect an edge in a graph? I'm interested in
>>> doing so while retaining a property map. Thus remove_edge and add_edge
>>> are not a solution, I think. If not, may it worth to add such a concept?
>>>
>>
>> I do not believe there is a way to do that other than by messing with
>> internal data structures. Is copying the properties over too slow for what
>> you're doing? If the properties are large/slow to copy, would having a
>> shared_ptr as the property stored in the graph help?
>>
>
> I wrote an algorithm a couple years ago that did something similar -
> conceptually temporarily removing and re-adding edges. Rather than modify
> the actual graph, I just used a color map to mask the edges that were
> temporarily being excluded.
>
> Would that be an option for your application?

I looked deeper into the implementation of adjancency_list and figured
out that indeed it doesn't look feasible there.

For my application, I was able to implement it by copying the
properties. I just thought of a generic way that might be faster than
removing and adding. If someone has a good idea how to implement it
nicely, such that edge-index-maps are retained, this could be a nice
feature. But for me it's "solved", so we're not in a hurry :)

best regards
Matthias Walter


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk