While the priority queue is not empty:
Pop the top element {, }. This is the closest unprocessed node.
If you have already processed (found shorter path earlier), skip it.
Mark as processed.
For each neighbor of , try to relax the edge: if going through is shorter, update dist[v] and push to the queue. The "skip if processed" check handles duplicates in the priority queue.