remove_edge(self, u, v, key=None)
Remove an edge between nodes u and v.
Used to distinguish multiple edges between a pair of nodes. If None remove a single (arbitrary) edge between u and v.
If there is not an edge between u and v, or if there is no edge with the specified key.
Remove an edge between u and v.
remove_edges_from
remove a collection of edges
>>> G = nx.MultiGraph()
... nx.add_path(G, [0, 1, 2, 3])
... G.remove_edge(0, 1)
... e = (1, 2)
... G.remove_edge(*e) # unpacks e from an edge tuple
For multiple edges
>>> G = nx.MultiGraph() # or MultiDiGraph, etc
... G.add_edges_from([(1, 2), (1, 2), (1, 2)]) # key_list returned [0, 1, 2]
>>> G.remove_edge(1, 2) # remove a single (arbitrary) edge
... G.remove_edge(2, 1) # edges are not directed
For edges with keys
>>> G = nx.MultiGraph() # or MultiDiGraph, etc
... G.add_edge(1, 2, key="first") 'first'
>>> G.add_edge(1, 2, key="second") 'second'
>>> G.remove_edge(1, 2, key="second")See :
The following pages refer to to this document either explicitly or contain code examples using this.
networkx.classes.multigraph.MultiGraph.remove_edge
networkx.classes.multigraph.MultiGraph.remove_edges_from
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them