friend=[]
nei_edges = g.adjacent(v1, type="in")
for nei_edge in nei_edges:
if g.es[nei_edge]["color"] == "blue":
friend.append(g.es[nei_edge].tuple[0])
cheers,
Simone
2009/1/22 Tamas Nepusz <address@hidden>:
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.
_______________________________________________
igraph-help mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/igraph-help
_______________________________________________
igraph-help mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/igraph-help