NetworkX

Previous topic

networkx.Graph.number_of_nodes

Next topic

networkx.Graph.size

Quick search

networkx.Graph.__len__

Graph.__len__()

Return the number of nodes. Use “len(G)”.

Examples

>>> G=nx.path_graph(4)
>>> print len(G)
4