'Modifications of DFS algorithm to check vertices in a graph

Just need a pseudo code, not the entire run code. Give the modifications needed to either the DFS algorithm so that it can check if the vertices in a graph can be labeled with 0's and 1's such that there is not an edge between vertices with the same label.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source