Python, Data Engineering, Algorithms, Computer Science, Data Science.
5, 'D': 1}, } # Step #1 - Initialize the graph visited = [] unvisited = ['A', 'B', 'C', 'D', 'E'] Step 2 — Create a dictionary: shortest_distances Assign a distance to all the nodes in the graph. The starting node will receive a distance of 0 and all other nodes will receive a starting distance of