NetworkX

Previous topic

networkx.Graph.order

Next topic

networkx.Graph.__len__

Quick search

networkx.Graph.number_of_nodes

Graph.number_of_nodes()

Return the number of nodes.

Notes

This is the same as

>>> len(G)
4

and

>>> G.order()
4

Examples

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