Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The netwokx package can be used to find the entire minimum separated set.

G=Graph({1:[2,3,4,5],2:[1,3,4,5],3:[1,2,4,5],4:[1,2,3],5:[1,2,3]})
G1 = G.networkx_graph()  
cutsets = list(nx.all_node_cuts(G1))
print(cutsets)

[{1, 2, 3}]

The netwokx package can be used to find the entire minimum separated set.

import networkx as nx
G=Graph({1:[2,3,4,5],2:[1,3,4,5],3:[1,2,4,5],4:[1,2,3],5:[1,2,3]})
G1 = G.networkx_graph()  
cutsets = list(nx.all_node_cuts(G1))
print(cutsets)

[{1, 2, 3}]

The netwokx package can be used to find the entire minimum separated set.

import networkx as nx
G=Graph({1:[2,3,4,5],2:[1,3,4,5],3:[1,2,4,5],4:[1,2,3],5:[1,2,3]})
G1 = G.networkx_graph()  
cutsets = list(nx.all_node_cuts(G1))
print(cutsets)

[{1, 2, 3}]

So G has only one minimum separated set.

The netwokx package can be used to find the entire minimum separated set.

import networkx as nx
G=Graph({1:[2,3,4,5],2:[1,3,4,5],3:[1,2,4,5],4:[1,2,3],5:[1,2,3]})
G1 = G.networkx_graph()  
cutsets = list(nx.all_node_cuts(G1))
print(cutsets)

[{1, 2, 3}]

So G has only one minimum separated set.

all_node_cuts

The netwokx networkx package can be used to find the entire all minimum separated set.separating sets.

sage: import networkx as nx
G=Graph({1:[2,3,4,5],2:[1,3,4,5],3:[1,2,4,5],4:[1,2,3],5:[1,2,3]})
sage: G = Graph({1: [2, 3, 4, 5],
....:            2: [1, 3, 4, 5],
....:            3: [1, 2, 4, 5],
....:            4: [1, 2, 3],
....:            5: [1, 2, 3]})
sage: G1 = G.networkx_graph()  
sage: cutsets = list(nx.all_node_cuts(G1))
print(cutsets)
sage: cutsets
[{1, 2, 3}]

[{1, 2, 3}]

So G has only one minimum separated set.

all_node_cutsSee the documentation: