Skip to content

Commit 5c6f168

Browse files
committed
fix graph search find path backtracking
1 parent ada66b7 commit 5c6f168

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

other/graph_search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def find_path(self, start, end, path=None):
1919
return path
2020
for node in self.graph.get(start, []):
2121
if node not in path:
22-
newpath = self.find_path(node, end, path)
22+
newpath = self.find_path(node, end, path[:])
2323
if newpath:
2424
return newpath
2525

0 commit comments

Comments
 (0)