Add all the edges in ebunch as weighted edges with specified weights.
Parameters : | ebunch : container of edges
weight : string, optional (default= ‘weight’)
attr : keyword arguments, optional (default= no attributes)
|
---|
See also
Notes
Adding the same edge twice for Graph/DiGraph simply updates the edge data. For MultiGraph/MultiDiGraph, duplicate edges are stored.
Examples
>>> G = nx.Graph() # or DiGraph, MultiGraph, MultiDiGraph, etc
>>> G.add_weighted_edges_from([(0,1,3.0),(1,2,7.5)])