Skip to content Skip to sidebar Skip to footer

Networkx Minimum_node_cut And Node_connectivity

I am using networkx and here is my network. import networkx as nx G = nx.from_edgelist([['a','b'], ['b','c'], ['c','a']]) nx.draw_networkx(G) Can you please tell me why minimum_

Solution 1:

From the documentation:

networkx.minimum_node_cut - If source and target nodes are provided, this function returns the set of nodes of minimum cardinality that, if removed, would destroy all paths among source and target in G.

networkx.node_connectivity - If source and target nodes are provided, this function returns the local node connectivity: the minimum number of nodes that must be removed to break all paths from source to target in G.

The first returns a set of nodes that when removed will break local connectivity, the second returns the minimum number of nodes needed to be removed to break local connectivity.

It seems to me that the set returned by networkx.minimum_node_cut excludes the source and target nodes as the removal of either would trivially break connectivity between them. networkx.node_connectivity rightfully reports that 2 nodes must be removed to break local connectivity.

Post a Comment for "Networkx Minimum_node_cut And Node_connectivity"