igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] how to select eid on the basis of an edge attribute


From: Tamas Nepusz
Subject: Re: [igraph] how to select eid on the basis of an edge attribute
Date: Thu, 22 Jan 2009 21:11:08 +0000

Hi Simone,

Could this be the a good strategy?

1) find all the neighbors of v1:

2) for each neighbor in the list:

3) check if they are blue-linked with v1 (using get_eids()):
Yup, but since you will be checking the _edges_ adjacent to v1, you should find the adjacent edges in step 1 instead of the neighbours. So:

nei_edges = g.adjacent(v1)
for nei_edge in nei_edges:
  if g.es[nei_edge]["color"] == "blue":
    # do this
  else:
    # do that

--
T.




reply via email to

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