[Top][All Lists]

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

Re: [igraph] I am not understanding something.....

From: Tamas Nepusz
Subject: Re: [igraph] I am not understanding something.....
Date: Wed, 18 Jun 2008 13:17:16 +0200

I am not understanding how to cycle on every node of a graph, and once
"i am looking" at a one node, how to cycle between the neighbors of
that node....
Given a Graph object g, g.neighbors(i) gives you the neighbors of node i. g.successors(i) gives you the successors of that node (following outgoing edges), while g.predecessors(i) gives you the predecessors (following the incoming edges). Note that you'll have to supply vertex IDs to g.neighbors().


>>> g = Graph.Tree(10,3)
>>> g.neighbors(0)
[1, 2, 3]


reply via email to

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