networkx 2.8.2 Pypi GitHub Homepage
Other Docs
NotesParametersBackRef
remove_edges_from(self, ebunch)

Notes

Will fail silently if an edge in ebunch is not in the graph.

Parameters

ebunch: list or container of edge tuples :

Each edge given in the list or container will be removed from the graph. The edges can be:

  • 2-tuples (u, v) All edges between u and v are removed.

  • 3-tuples (u, v, key) The edge identified by key is removed.

  • 4-tuples (u, v, key, data) where data is ignored.

Remove all edges specified in ebunch.

See Also

remove_edge

remove a single edge

Examples

>>> G = nx.path_graph(4)  # or DiGraph, MultiGraph, MultiDiGraph, etc
... ebunch = [(1, 2), (2, 3)]
... G.remove_edges_from(ebunch)

Removing multiple copies of edges

>>> G = nx.MultiGraph()
... keys = G.add_edges_from([(1, 2), (1, 2), (1, 2)])
... G.remove_edges_from([(1, 2), (2, 1)]) # edges aren't directed
... list(G.edges()) [(1, 2)]
>>> G.remove_edges_from([(1, 2), (1, 2)])  # silently ignore extra copy
... list(G.edges) # now empty graph []
See :

Back References

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

Local connectivity graph

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


GitHub : /networkx/classes/multigraph.py#656
type: <class 'function'>
Commit: