|
From: | Tamas Nepusz |
Subject: | Re: [igraph] I am not understanding something..... |
Date: | Wed, 18 Jun 2008 13:17:16 +0200 |
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().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....
E.g.: >>> g = Graph.Tree(10,3) >>> g.neighbors(0) [1, 2, 3] -- T.
[Prev in Thread] | Current Thread | [Next in Thread] |