NetworkX

Previous topic

networkx.MultiDiGraph.get_edge

Next topic

networkx.MultiDiGraph.neighbors_iter

Quick search

networkx.MultiDiGraph.neighbors

MultiDiGraph.neighbors(n)

Return a list of the nodes connected to the node n.

Notes

It is sometimes more convenient (and faster) to access the adjacency dictionary as G[n]

>>> G=nx.Graph()
>>> G.add_edge('a','b','data')
>>> G['a']
{'b': 'data'}

Examples

>>> G=nx.path_graph(4)
>>> G.neighbors(0)
[1]