NetworkX

Previous topic

networkx.MultiGraph.remove_node

Next topic

networkx.MultiGraph.add_edge

Quick search

networkx.MultiGraph.remove_nodes_from

MultiGraph.remove_nodes_from(nbunch)

Remove nodes specified in nbunch.

Parameters:

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()
[]