[Top][All Lists]

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

Re: [igraph] adding attribute to an edge, depending on nodes

From: Marco
Subject: Re: [igraph] adding attribute to an edge, depending on nodes
Date: Fri, 7 Nov 2008 15:53:31 +0100

Hi Tamas,

i was almost there! I was tryin to use g.es as a list, which was
obviously the wrong idea.


if the attr works as in the vertices, it should be painted red when i
plot the graph but... I don't see it red :(




è il gioco della vita,
la dobbiamo preparare
che non ci sfugga dalle dita
come la sabbia in riva al mare.

Lucio Dalla

On Fri, Nov 7, 2008 at 3:42 PM, Tamas Nepusz <address@hidden> wrote:
>> AFAIK is not possibile, when creating the edge, to set some attribute
>> for the edge.
>> How can i set attribute to that edge, without revisiting the graph?
> Hmmm, good point, we should have an attrs= keyword argument for
> add_edges and add_vertices. In the meanwhile, you can (ab)use the fact
> that the most recently added edge always has the highest ID:
> g.add_edges([(1,2)])
> g.es[g.ecount()-1]["label"] = "123"
> --
> Tamas
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help

reply via email to

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