Networkx Minimum_node_cut And Node_connectivity
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"