Suppose I want to execute DFS on a graph. Now during Graph I need to label the nodes as 'visited'. After completion of the DFS, all the nodes are labeled 'visited'. The next time if I go for another DFS on the same graph, I will find all the nodes visited. Is there any way that just after completion of the first DFS, the graph comes into its initial state, i.e with no node visited. I know a brute force method that goes to every node and makes it unvisited.