Table of Contents
Graph()
DiGraph()
MultiGraph()
MultiDiGraph()
Auto-generated API
Graph.
__len__
Return the number of nodes. Use the expression ‘len(G)’.
nnodes : int
The number of nodes in the graph.
Examples
>>> G = nx.path_graph(4) # or DiGraph, MultiGraph, MultiDiGraph, etc >>> len(G) 4