Skip to content

Commit

Permalink
showing only the distances instead of the path
Browse files Browse the repository at this point in the history
  • Loading branch information
bettoarcaya committed Oct 3, 2019
1 parent 402090f commit 5fafa2a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions Graph_Algorithms/src/Dijkstra/Dijkstra.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ def add_edge(self, init_node, final_node, value):

def dijkstra(graph, initial):
visited = {initial: 0}
path = {}

nodes = set(graph.nodes)

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

return visited, path
return visited


def main():
Expand Down

0 comments on commit 5fafa2a

Please sign in to comment.