def _without_most_central_edges(G, most_valuable_edge):
 original_num_components = nx.number_connected_components(G)
 num_new_components = original_num_components
 while (num_new_components <= original_num_components):
  edge = most_valuable_edge(G)
  G.remove_edge(*edge)
  new_components = tuple(nx.connected_components(G))
  num_new_components = len(new_components)
 return new_components

def _without_most_central_edges ( G , most_valuable_edge ) : original_num_components = nx . number_connected_components ( G ) num_new_components = original_num_components while ( num_new_components <= original_num_components ) : edge = most_valuable_edge ( G ) G . remove_edge ( * edge ) new_components = tuple ( nx . connected_components ( G ) ) num_new_components = len ( new_components ) return new_components
returns the connected components of the graph that results from repeatedly removing the most "valuable" edge in the graph .