This commit is contained in:
Marege 2026-11-17 14:06:46 +01:00
parent 930630815d
commit 9903988d4d

View File

@ -3,3 +3,13 @@ def shortest_path(number_of_nodes, connections):
end = number_of_nodes - 1
if start == end:
return [0]
dist = []
path = []
for i in range(number_of_nodes):
dist.append(None)
path.append([])
dist[start] = 0
path[start] = [start]
return path[end]