NetworkX

Previous topic

networkx.MultiGraph.add_nodes_from

Next topic

networkx.MultiGraph.remove_nodes_from

Quick search

networkx.MultiGraph.remove_node

MultiGraph.remove_node(n)

Remove node n.

Removes the node n and adjacent edges in the graph. Attempting to remove a non-existent node will raise an exception.

Examples

>>> G=nx.complete_graph(3)  # complete graph on 3 nodes, K3
>>> G.edges()
[(0, 1), (0, 2), (1, 2)]
>>> G.remove_node(1)
>>> G.edges()
[(0, 2)]