def clear ( self ) : self . adj . clear ( ) self . node . clear ( ) self . graph . clear ( )
how to delete nodes from graphs python
Remove all nodes and edges from the graph .
def clear(self):
        """Remove all nodes and edges from the graph.

        Unlike the regular networkx implementation, this does *not*
        remove the graph's name. But all the other graph, node, and
        edge attributes go away.

        """
        self.adj.clear()
        self.node.clear()
        self.graph.clear()