[Top][All Lists]
[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 11:33:58 +0100 |
hi again,
this suggests another question for me:
I need to access the weight value of the link that connects mynode and
myneighbor:
for mynode in g.vs:
neighborhood = igraph.GraphBase.neighbors(mynode.index, type="OUT")
for myneighbor in neighborhood:
myExperience.append( "the weight of the link between mynode
and myneighbor" )
many thanks for the help,
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
>
- [igraph] how to iterate a vertex seq to find neighbors, Simone Gabbriellini, 2008/12/22
- Re: [igraph] how to iterate a vertex seq to find neighbors, Tamas Nepusz, 2008/12/22
- Re: [igraph] how to iterate a vertex seq to find neighbors, Simone Gabbriellini, 2008/12/22
- Re: [igraph] how to iterate a vertex seq to find neighbors,
Simone Gabbriellini <=
- Re: [igraph] how to iterate a vertex seq to find neighbors, Tamas Nepusz, 2008/12/23
- Re: [igraph] how to iterate a vertex seq to find neighbors, Simone Gabbriellini, 2008/12/23
- Re: [igraph] how to iterate a vertex seq to find neighbors, Tamas Nepusz, 2008/12/23
- Re: [igraph] how to iterate a vertex seq to find neighbors, Simone Gabbriellini, 2008/12/23
- Re: [igraph] how to iterate a vertex seq to find neighbors, Tamas Nepusz, 2008/12/23