Skip to content

Commit 5fafa2a

Browse files
committed
showing only the distances instead of the path
1 parent 402090f commit 5fafa2a

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Graph_Algorithms/src/Dijkstra/Dijkstra.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ def add_edge(self, init_node, final_node, value):
1818

1919
def dijkstra(graph, initial):
2020
visited = {initial: 0}
21-
path = {}
2221

2322
nodes = set(graph.nodes)
2423

@@ -44,9 +43,8 @@ def dijkstra(graph, initial):
4443
weight = current_weight + math.inf
4544
if arch not in visited or weight < visited[arch]:
4645
visited[arch] = weight
47-
path[arch] = min_node
4846

49-
return visited, path
47+
return visited
5048

5149

5250
def main():

0 commit comments

Comments
 (0)