Skip to content

Commit 3948a7f

Browse files
Dijkstra2.py
1 parent a34168a commit 3948a7f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Dijkstra2.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ def get_graph_from_user():
9898
Enter the weight between 'E' and 'D': 3
9999
Enter a neighbor node for 'E' (or 'done' if finished): DONE
100100
Enter a node (or 'done' if finished): DONE
101+
Entered graph:
102+
{'A': {'B': 5, 'C': 2}, 'B': {'A': 5, 'D': 1}, 'C': {'A': 2, 'D': 6}, 'D': {'B': 1, 'C': 6, 'E': 3}, 'E': {'D': 3}}
101103
Enter the start node: A
102104
Enter the destination node: E
103-
Optimal route: ['A', 'C', 'D', 'E']
105+
Optimal route: ['A', 'B', 'D', 'E']
104106
"""

0 commit comments

Comments
 (0)