Question
Write the Dijkstra’s shortest path algorithm. Also, find the time complexity of this shortest path algorithm. Find the shortest paths from the vertex ‘A’ using Dijkstra’s shortest path algorithm for the graph given in Figure 1. Show all the steps of computation.
Answer :
Word Count : 298
### **Algorithm Steps** 1. Assign tentative distance for all vertices: 0 for source, ∞ for others. 2. Set source as current. For all neighbors not yet visited, update their distance if path through current is smaller. 3. Mark current as visited. Set next unvisited vertex with smallest tentative distance as current. 4. Repeat until all vertices visited. **Time Complexity:** - With Min Heap: $$O((V+E)\log V)$$ - With array: $$O(V^2)$$ *** ### **Apply Dijkstra’s Algorithm ________ ___ ___ __________ ______.
__________ ________ ___ ____ _____ _____.
_______ __________ ________ _______ ______ ___.
____ ______ ____ ________ _______ ________ ___ ___ _______ ___.
______ ___ ____ _____ ___ ________ ________ _______ ________ ________.
_____ _________ ___ ________ ________ ___ _____ ____ ____ __________ __________ ______.
_______ ____ _________ __________ ________ ________ ______ _______ ___ ___.
______ ____ _________ ________ _____ ___ ____ ______ __________.
___ _____ _________ ______ ____ __________ _______ _________ ________ _______ ______ ________.
_________ _____ _____ ___ ________ _______ ________ ______.
________ ________ ___ ___ ______.
______ ___ __________ ____ __________ __________ ____ _______.
________ ___ ________ ___ _____ ______ ____ _________ _____ _______.
__________ ______ _____ ______ _______ ___ ______.
_________ ______ ________ ______ ____ ________ _________ ________ _______ ___ _______.
______ ___ ____ ___ _____ _________ ________.
___ ______ ______ _____ ___ ___ ___.
_______ _______ ____ ______ _____ ____ ____ ________ ________ __________ _______ ___.
__________ ________ _________ ________ _________ ___ ___ _____ ____.
______ _______ ______ ______ _______ ______ __________ ______ ___ ________.
_____ ___ _______ _______ __________ __________ ______.
_________ _________ _______ __________ ____ _______ ___.
__________ _________ _______ ________ ____.
_____ ____ ___ _______ ________.
________ ________ ____ ______ _________ _______ _________ ________ _________ _____ _______ ___.
______ ____ ___ __________ _____ ___ _________ ________.
______ ____ _________ ____ ____ ____.
Get Full Answer on WhatsApp
### **Algorithm Steps** 1. Assign tentative distance for all vertices: 0 for source, ∞ for others. 2. Set source as current. For all neighbors not yet visited, update their distance if path through current is smaller. 3. Mark current as visited. Set next unvisited vertex with smallest tentative distance as current. 4. Repeat until all vertices visited. **Time Complexity:** - With Min Heap: $$O((V+E)\log V)$$ - With array: $$O(V^2)$$ *** ### **Apply Dijkstra’s Algorithm ________ ___ ___ __________ ______.
__________ ________ ___ ____ _____ _____.
_______ __________ ________ _______ ______ ___.
____ ______ ____ ________ _______ ________ ___ ___ _______ ___.
______ ___ ____ _____ ___ ________ ________ _______ ________ ________.
_____ _________ ___ ________ ________ ___ _____ ____ ____ __________ __________ ______.
_______ ____ _________ __________ ________ ________ ______ _______ ___ ___.
______ ____ _________ ________ _____ ___ ____ ______ __________.
___ _____ _________ ______ ____ __________ _______ _________ ________ _______ ______ ________.
_________ _____ _____ ___ ________ _______ ________ ______.
________ ________ ___ ___ ______.
______ ___ __________ ____ __________ __________ ____ _______.
________ ___ ________ ___ _____ ______ ____ _________ _____ _______.
__________ ______ _____ ______ _______ ___ ______.
_________ ______ ________ ______ ____ ________ _________ ________ _______ ___ _______.
______ ___ ____ ___ _____ _________ ________.
___ ______ ______ _____ ___ ___ ___.
_______ _______ ____ ______ _____ ____ ____ ________ ________ __________ _______ ___.
__________ ________ _________ ________ _________ ___ ___ _____ ____.
______ _______ ______ ______ _______ ______ __________ ______ ___ ________.
_____ ___ _______ _______ __________ __________ ______.
_________ _________ _______ __________ ____ _______ ___.
__________ _________ _______ ________ ____.
_____ ____ ___ _______ ________.
________ ________ ____ ______ _________ _______ _________ ________ _________ _____ _______ ___.
______ ____ ___ __________ _____ ___ _________ ________.
______ ____ _________ ____ ____ ____.
Get Full Answer on WhatsApp
IGNOU NEWS
Assignment Submission Last Date Extended Till 30 June 2026 Click Here★★★IGNOU June 2026 TEE Date Sheet Released Click Here★★★