use minimum node cut
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Torma Kristóf 2020-09-24 13:53:44 +02:00
parent aed7f80c42
commit 0c4842a6f5
Signed by: tormakris
GPG Key ID: DC83C4F2C41B1047

View File

@ -32,12 +32,9 @@ del_list = []
G = read_graph(args.graph) G = read_graph(args.graph)
n = len(G.nodes) n = len(G.nodes)
while max_comp_size(G) > n / 2: while max_comp_size(G) > n / 2:
u = np.random.choice(G.nodes) mnc = nx.minimum_node_cut(G=G)
if u not in del_list: del_list.append(mnc)
del_list.append(u) G.remove_nodes_from(mnc)
G.remove_node(u)
# print len(del_list), del_list
for u in del_list: for u in del_list: