igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] how to iterate a vertex seq to find neighbors


From: Simone Gabbriellini
Subject: Re: [igraph] how to iterate a vertex seq to find neighbors
Date: Tue, 23 Dec 2008 01:14:05 +0100

thanks a lot Tamas,

merry Xmas,
Simone

2008/12/22 Tamas Nepusz <address@hidden>:
> Hi Simone,
>
>>
>> I am wondering how to use the neighbors function... I do:
>>
>> g = igraph.Graph.Read_Pajek(filename)
>>
>> for node in g.vs:
>>    vicinato = igraph.GraphBase.neighbors(node, type="IN")
>
> Strangely enough, .neighbours() requires a vertex index and not a Vertex
> object, so this will work:
>
> for node in g.vs:
>  vicinato = g.neighbors(node.index, type="IN")
>
> or this one:
>
> for i in xrange(g.vcount()):
>  vicinato = g.neighbors(i, type="IN")
>
> --
> T.
>
>
>
> _______________________________________________
> 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]