NetworkX

Previous topic

networkx.MultiDiGraph.remove_nodes_from

Next topic

networkx.MultiDiGraph.add_edges_from

Quick search

networkx.MultiDiGraph.add_edge

MultiDiGraph.add_edge(u, v, data=1)

Add a single directed edge to the digraph.

x is an arbitrary (not necessarily hashable) object associated with this edge. It can be used to associate one or more, labels, data records, weights or any arbirary objects to edges. The default is the Python None.

For example, after creation, the edge (1,2,”blue”) can be added

>>> G=nx.MultiDiGraph()
>>> G.add_edge(1,2,"blue")

Two successive calls to G.add_edge(1,2,”red”) will result in 2 edges of the form (1,2,”red”) that can not be distinguished from one another.