To replace/update edge data, use the optional key argument
to identify a unique edge. Otherwise a new edge will be created.

NetworkX algorithms designed for weighted graphs cannot use
multigraphs directly because it is not clear how to handle
multiedge weights. Convert to Graph using edge attribute
‘weight’ to enable weighted graph algorithms.

Default keys are generated using the method new_edge_key().
This method can be overridden by subclassing the base class and
providing a custom new_edge_key() method.