finish greedy coloring algorithm.