Skip to content

Commit bf4feb9

Browse files
authored
Merge pull request faif#220 from niyuna/fix-graph-search-find-path
fix graph search find path backtracking
2 parents ada66b7 + 5c6f168 commit bf4feb9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)