rewrite graph_mcolor