NetworkX

Previous topic

networkx.DiGraph.order

Next topic

networkx.DiGraph.__len__

Quick search

networkx.DiGraph.number_of_nodes

DiGraph.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