Warning

This documents an unmaintained version of NetworkX. Please upgrade to a maintained version and see the current NetworkX documentation.

# number_of_edges¶

DiGraph.number_of_edges(u=None, v=None)

Return the number of edges between two nodes.

Parameters : u,v : nodes, optional (default=all edges) If u and v are specified, return the number of edges between u and v. Otherwise return the total number of all edges. nedges : int The number of edges in the graph. If nodes u and v are specified return the number of edges between those nodes.

size

Examples

>>> G = nx.Graph()   # or DiGraph, MultiGraph, MultiDiGraph, etc