Dijkstra's algorithm is an efficient single-source shortest path algorithm. That is, it helps us in finding the shortest distance from the source vertex to all the other vertices in the graph. As opposed to breadth-first search, it efficiently solves the single-source shortest path problem for weighted graphs (graph with weighted edges). For the algorithm to work, all edge weights must be non negative.
Video with Step-by-Step Example
This video describes the problem statement and shows what the Dijkstra's algorithm does step-by-step on a well chosen example.
In this tutorial, we'll learn about heaps, a very interesting data structure. Heaps are a data-structure that efficiently support the following operations
Insert / Push: Insert a new element to a set
Delete-min / Pop: Find and remove the smallest element in the set
Note that the operations can be performed multiple times and in any order. (Also, note that actual implementations also support operation top, which returns the smallest element, but does not remove it from the heap).
The following is a sample interaction we would want with a heap.