Table of Contents
Graph()
DiGraph()
MultiGraph()
MultiDiGraph()
Auto-generated API
MultiGraph.
__iter__
Iterate over the nodes. Use the expression ‘for n in G’.
niter : iterator
An iterator over all nodes in the graph.
Examples
>>> G = nx.path_graph(4) # or DiGraph, MultiGraph, MultiDiGraph, etc >>> [n for n in G] [0, 1, 2, 3]