Skip to content

Commit

Permalink
Merge pull request faif#220 from niyuna/fix-graph-search-find-path
Browse files Browse the repository at this point in the history
fix graph search find path backtracking
  • Loading branch information
faif authored Apr 9, 2018
2 parents ada66b7 + 5c6f168 commit bf4feb9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion other/graph_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def find_path(self, start, end, path=None):
return path
for node in self.graph.get(start, []):
if node not in path:
newpath = self.find_path(node, end, path)
newpath = self.find_path(node, end, path[:])
if newpath:
return newpath

Expand Down

0 comments on commit bf4feb9

Please sign in to comment.