use connected components
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Some checks reported errors
continuous-integration/drone/push Build encountered an error
This commit is contained in:
parent
0c4842a6f5
commit
ca44105fae
@ -32,7 +32,8 @@ 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:
|
||||||
mnc = nx.minimum_node_cut(G=G)
|
H = max((G.subgraph(c) for c in nx.connected_components(G)), key=len)
|
||||||
|
mnc = nx.minimum_node_cut(G=H)
|
||||||
del_list.append(mnc)
|
del_list.append(mnc)
|
||||||
G.remove_nodes_from(mnc)
|
G.remove_nodes_from(mnc)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user