graph coloring algorithm for schedule optimization