NetworkX

Previous topic

networkx.DiGraph.successors

Next topic

networkx.DiGraph.predecessors

Quick search

networkx.DiGraph.successors_iter

DiGraph.successors_iter(n)

Return an iterator over all neighbors of node n.

Notes

It is faster to iterate over the using the idiom >>> print [n for n in G[0]] [1]

Examples

>>> G=nx.path_graph(4)
>>> print [n for n in G.neighbors(0)]
[1]