Before the main loop, you need to initialize two things:
Create a distance array dist[N] initialized to infinity (a large number like ). This tracks the shortest known distance to each node.
Set dist[start] = 0. The distance from the start to itself is zero.
Create a priority queue (min-heap) and push (0, start). The pair represents (distance, node).
dist := array of INF, size n
dist[start] := 0
pq := min-heap with (0, start)
Now you are ready for the main Dijkstra loop: repeatedly extract the minimum and relax neighbors.