igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Adding edges by ID


From: Tamas Nepusz
Subject: Re: [igraph] Adding edges by ID
Date: Wed, 1 Oct 2014 20:20:02 +0200

Hello,
 
> I am trying to add edges to a graph
> (through IDs), however this does not seem to work. I know how to add
> them by using the vertex number, however being able to add them by
> their ID would really make things much easier for me.
In igraph, the ID of a vertex is its “number”; what you are using is not a 
vertex ID but a vertex _name_. As a consequence, the names have to be assigned 
to the “name” vertex attribute and it will work nicely. Also note that you can 
assign all the names at once, there is no need to do them in a for loop:

A.vs[“name”] = nodes_list

T.



reply via email to

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