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: Tamas Nepusz
Subject: Re: [igraph] changing an edge's target or source
Date: Thu, 11 Feb 2010 16:52:45 +0000
User-agent: Mutt/1.5.20 (2009-06-14)

> 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




reply via email to

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