NetworkX

Previous topic

networkx.LabeledGraph.order

Next topic

networkx.LabeledGraph.__len__

Quick search

networkx.LabeledGraph.number_of_nodes

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