partially finish dfs shortest path