networkx.Graph.size
networkx.Graph.number_of_selfloops
Return the number of edges between two nodes.
u,v : nodes
If u and v are specified, return the number of edges between u and v. Otherwise return the total number of all edges.
Examples
>>> G=nx.path_graph(4) >>> G.number_of_edges() 3 >>> G.number_of_edges(0,1) 1 >>> e=(0,1) >>> G.number_of_edges(*e) 1