def strategy_independent_set(G, colors):
 remaining_nodes = set(G)
 while (len(remaining_nodes) > 0):
  nodes = _maximal_independent_set(G.subgraph(remaining_nodes))
  remaining_nodes -= nodes
  for v in nodes:
   (yield v)

def strategy_independent_set ( G , colors ) : remaining_nodes = set ( G ) while ( len ( remaining_nodes ) > 0 ) : nodes = _maximal_independent_set ( G . subgraph ( remaining_nodes ) ) remaining_nodes -= nodes for v in nodes : ( yield v )
uses a greedy independent set removal strategy to determine the colors .