1. Dijkstra(graph, start, end)
2. create dist map, all nodes to ∞
3. create prev map, all nodes to null
4. create PriorityQueue (pq)
5. dist[start] = 0
6. pq.enqueue(start, 0)
7. while (pq is not empty)
8. let node = pq.dequeue()
9. if (node == end) break
10. for (neighbor of node.neighbors)
11. let newDist = dist[node] + weight
12. if (newDist < dist[neighbor])
13. dist[neighbor] = newDist
14. prev[neighbor] = node
15. pq.enqueue(neighbor, newDist)
16. // Reconstruct path from end