NetworkX

Previous topic

networkx.MultiDiGraph.neighbors

Next topic

networkx.MultiDiGraph.__getitem__

Quick search

networkx.MultiDiGraph.neighbors_iter

MultiDiGraph.neighbors_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]