Skip to content

Commit

Permalink
fix graph/find_shortest_path (keon#389)
Browse files Browse the repository at this point in the history
  • Loading branch information
chruit30 authored and keon committed Aug 15, 2018
1 parent 416edfc commit 763221d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion algorithms/graph/find_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def find_shortest_path(graph, start, end, path=[]):
shortest = None
for node in graph[start]:
if node not in path:
newpath = find_shortest_path(graph, start, end, path)
newpath = find_shortest_path(graph, node, end, path)
if newpath:
if not shortest or len(newpath) < len(shortest):
shortest = newpath
Expand Down

0 comments on commit 763221d

Please sign in to comment.