NetworkX

Previous topic

networkx.MultiGraph.neighbors

Next topic

networkx.MultiGraph.__getitem__

Quick search

networkx.MultiGraph.neighbors_iter

MultiGraph.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]