igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] add edges in python igraph


From: Simone Gabbriellini
Subject: Re: [igraph] add edges in python igraph
Date: Mon, 19 Jan 2009 19:14:16 +0100

Tamas,

sorry to trouble you again,

but how can I check if the edge between 1 and 2 already exists, before
creating a new one?

thanks,
Simone

2009/1/19 Simone Gabbriellini <address@hidden>:
> ok, this workaround is more than ok for me...
>
> thanks very much,
> simone
>
> 2009/1/19 Tamas Nepusz <address@hidden>:
>>> is it possible to set also the color of the new edge?
>> You can make use of the undocumented igraph feature that the newly added
>> edge always has the largest ID. So, this should work:
>>
>> max_edge_id = g.ecount()
>> g.add_edges((1,2))
>> g.es[max_edge_id]["color"] = "blue"
>>
>> (Hmm, actually, there should be a better way to add an edge with
>> attributes. Maybe some keyword arguments to add_edges. I have to think
>> about it).
>>
>> --
>> 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]