BFS and DFS now yields (parent, node) tuples, for easier backtracking.