Returns the number of nodes in the graph. Returns ------- nnodes : int The number of nodes in the graph. See Also -------- number_of_nodes, __len__ which are identical Examples -------- >>> G = nx.path_graph(3)
(self)
| 812 | return archive.get_size() |
| 813 | |
| 814 | def order(self): |
| 815 | """Returns the number of nodes in the graph. |
| 816 | |
| 817 | Returns |
| 818 | ------- |
| 819 | nnodes : int |
| 820 | The number of nodes in the graph. |
| 821 | |
| 822 | See Also |
| 823 | -------- |
| 824 | number_of_nodes, __len__ which are identical |
| 825 | |
| 826 | Examples |
| 827 | -------- |
| 828 | >>> G = nx.path_graph(3) # or DiGraph |
| 829 | >>> G.order() |
| 830 | 3 |
| 831 | """ |
| 832 | return self.number_of_nodes() |
| 833 | |
| 834 | def has_node(self, n): |
| 835 | """Returns True if the graph contains the node n. |