def clique_removal(G):
 graph = G.copy(with_data=False)
 (c_i, i_i) = ramsey.ramsey_R2(graph)
 cliques = [c_i]
 isets = [i_i]
 while graph:
  graph.remove_nodes_from(c_i)
  (c_i, i_i) = ramsey.ramsey_R2(graph)
  if c_i:
   cliques.append(c_i)
  if i_i:
   isets.append(i_i)
 maxiset = max(isets, key=len)
 return (maxiset, cliques)

def clique_removal ( G ) : graph = G . copy ( with_data = False ) ( c_i , i_i ) = ramsey . ramsey_R2 ( graph ) cliques = [ c_i ] isets = [ i_i ] while graph : graph . remove_nodes_from ( c_i ) ( c_i , i_i ) = ramsey . ramsey_R2 ( graph ) if c_i : cliques . append ( c_i ) if i_i : isets . append ( i_i ) maxiset = max ( isets , key = len ) return ( maxiset , cliques )
repeatedly remove cliques from the graph .