Skip to content

Commit 763221d

Browse files
chruit30keon
authored andcommitted
fix graph/find_shortest_path (keon#389)
1 parent 416edfc commit 763221d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

algorithms/graph/find_path.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def find_shortest_path(graph, start, end, path=[]):
4343
shortest = None
4444
for node in graph[start]:
4545
if node not in path:
46-
newpath = find_shortest_path(graph, start, end, path)
46+
newpath = find_shortest_path(graph, node, end, path)
4747
if newpath:
4848
if not shortest or len(newpath) < len(shortest):
4949
shortest = newpath

0 commit comments

Comments
 (0)