networkx.Graph.remove_node
networkx.Graph.add_edge
Remove nodes specified in nbunch.
nbunch : list, iterable
A container of nodes that will be iterated through once (thus it should be an iterator or be iterable). Each element of the container should be a valid node type: any hashable type except None.
Examples
>>> G=nx.complete_graph(3) # complete graph on 3 nodes, K3 >>> e=G.nodes() >>> e [0, 1, 2] >>> G.remove_nodes_from(e) >>> G.nodes() []