bfs graph path reconstructed