 algorithm finds all the shortest paths from the source
vertex to every other vertex by iteratively &quot;growing&quot; the set of
vertices <i>S</i> to which it knows the shortest path. At each step of
the algorithm, the next vertex added to <i>S</i> is determined by a
priority queue.  The queue contains the vertices in <i>V - S</i><a
href="#1">[1]</a> prioritized by their distance label, which is the
length of the shortest path seen so far for each vertex. The vertex
<i>u</i> at the top of the priority que