NetworkX

Previous topic

networkx.DiGraph.add_cycle

Next topic

networkx.DiGraph.nodes

Quick search

networkx.DiGraph.clear

DiGraph.clear()

Remove all nodes and edges.

This also removes the name.

Examples

>>> G=nx.path_graph(4)
>>> G.clear()
>>> G.nodes()
[]
>>> G.edges()
[]