Implement graph coloring algorithm