dijkstra(v):
pq = new PriorityQueue()
pq.insert([dest:v, pred:null, cost:0])
while(!pq.isEmpty()):
[dest, pred, cost] = pq.removeMin()
if dest is unvisited:
mark dest as visited, store pred and cost for dest
for each edge with weight w to unvisited neighbor u of dest:
pq.insert([u, dest, cost+w])