This solution works but uses too much memory
Double DFS implementation
Independent double DFS implementation
Fix typo
Better support of partial update for outcast.
Fix outcast selection
Craving ok