Grpah DFS implementation