|
From: | Tamas Nepusz |
Subject: | Re: [igraph] how to iterate a vertex seq to find neighbors |
Date: | Tue, 23 Dec 2008 18:45:25 +0100 |
Sorry, I misunderstood your question. You can use g.get_eid(mynode, myneighbor) to get the ID of an edge connecting mynode and myneighbour:I am a bit confused... "weight" is an attribute of the edge, not of the vertex...
g.es[g.get_eid(mynode, myneighbor)]["weight"]Alternatively, you can get all the weights and the node-neighbour pairs in advance into a dict and then use that dict to look up the weight:
weight_dict = dict(zip(g.get_edgelist(), g.es["weight"]))weight_dict[mynode, myneighbour] will then give you the weight of the corresponding edge.
-- T.
[Prev in Thread] | Current Thread | [Next in Thread] |