step

speed

Dijkstra(u):

 Initialize distances, parents, & priority queue Q

 while Q is not empty:

  v = Q.extractMin()

  for each edge e = (v,w):

   if w.distance > v.distance + e.weight:

    w.distance = v.distance + e.weight

    w.parent = v

   else, ignore this edge