In implementation of DFS and BFS, CLRS authors distinguish 3 colors for each vertex -- grey, black and white. I understand that black and white signify whether node was visited or not. Why do we need grey color?
My guess is to detect cycles, but can we also detect cycles with just black & white (i.e. w/o the grey)?