igraph-help
[Top][All Lists]
Advanced

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

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


From: Tamas Nepusz
Subject: Re: [igraph] adding attribute to an edge, depending on nodes
Date: Fri, 07 Nov 2008 14:42:10 +0000

> 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






reply via email to

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