NetworkX

Previous topic

networkx.MultiDiGraph.nodes

Next topic

networkx.MultiDiGraph.__iter__

Quick search

networkx.MultiDiGraph.nodes_iter

MultiDiGraph.nodes_iter()

Return an iterator for the nodes.

Notes

It is simpler and equivalent to use the expression “for n in G”

>>> G=nx.path_graph(3)
>>> for n in G:
...     print n,
0 1 2

Examples

>>> G=nx.path_graph(3)
>>> for n in G.nodes_iter():
...     print n,
0 1 2

You can also say

>>> G=nx.path_graph(3)
>>> for n in G:
...     print n,
0 1 2