Finish the basic implementation with stable DFS and BFS on the graph