Note
This documents the development version of NetworkX. Documentation for the current release can be found here.
Graph.
clear_edges
Remove all edges from the graph without altering nodes.
Examples
>>> G = nx.path_graph(4) # or DiGraph, MultiGraph, MultiDiGraph, etc >>> G.clear_edges() >>> list(G.nodes) [0, 1, 2, 3] >>> list(G.edges) []