Graph Bicoloring algorithm implementation.