Dijkstra Solution
Dijkstra Solution
Find the shortest path from Node 1 to Node 4 using Dijkstra's Algorithm.
Step 2: Initialization
- Set the distance of Node 1 to 0 (starting point).
- Set the distance of all other nodes to INF (infinity).
Shortest path from Node 1 to Node 4: 1 -> 2 -> 3 -> 4 with total distance = 32