'Remove all nodes and edges from the graph.
This also removes the name, and all graph, node, and edge attributes.
Examples
>>> G = nx.path_graph(4)  # or DiGraph, MultiGraph, MultiDiGraph, etc
>>> G.clear()
>>> list(G.nodes())
>>> list(G.edges())'

def clear(self):

    self._succ.clear()
    self._pred.clear()
    self._node.clear()
    self.graph.clear()
