This documents the development version of NetworkX. Documentation for the current release can be found here.
Remove all nodes and edges from the graph.
This also removes the name, and all graph, node, and edge attributes.
>>> G = nx.path_graph(4) # or DiGraph, MultiGraph, MultiDiGraph, etc