This commit is contained in:
parent
aed7f80c42
commit
0c4842a6f5
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user