# size¶

MultiGraph.size(weight=None)

Return the number of edges.

Parameters: weight : string or None, optional (default=None) The edge attribute that holds the numerical value used as a weight. If None, then each edge has weight 1. nedges : int The number of edges or sum of edge weights in the graph.

Examples

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

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