igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] changing an edge's target or source


From: Benjamin Fields
Subject: Re: [igraph] changing an edge's target or source
Date: Thu, 11 Feb 2010 17:01:01 +0000

okay, well not the most exciting answer, but at least there isn't anything I 
was missing.  Thanks for the help.

/Ben

On 11 Feb 2010, at 16:52, Tamas Nepusz wrote:

>> Apologies if I'm missing something obvious or direct, but is there a
>> simple way to change an edge's source or target?
> No, unfortunately there isn't as there is no support for that in the
> underlying C library. Your best bet is to add a helper function that
> saves the attributes of the old edge (if any), removes the edge, adds
> the new edge and adds the attributes once again. I know, this is not the
> most efficient way to do it :( However, I'm not sure that it could be
> done more efficiently with igraph's current graph data type, which is
> practically an indexed edge list, so if you modify the target or the
> source of an edge, the index has to be updated as well.
> 
> -- 
> Tamas
> 
> 
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help

Ben Fields
PhD Candidate
Dept. of Computing
Goldsmiths, University of London
e: address@hidden
p: +44 (0) 20 7078 5170
---------------------------------------------
"Which is more musical: a truck passing by a factory or a truck passing by a 
music school?" --John Cage





reply via email to

[Prev in Thread] Current Thread [Next in Thread]