Added BFS, edited DFS cancel if no valid path