Return an iterator over the nodes.
Parameters : | data : boolean, optional (default=False)
|
---|---|
Returns : | niter : iterator
|
Notes
If the node data is not required it is simpler and equivalent to use the expression ‘for n in G’.
>>> G = nx.Graph() # or DiGraph, MultiGraph, MultiDiGraph, etc
>>> G.add_path([0,1,2])
Examples
>>> G = nx.Graph() # or DiGraph, MultiGraph, MultiDiGraph, etc
>>> G.add_path([0,1,2])
>>> [d for n,d in G.nodes_iter(data=True)]
[{}, {}, {}]