e weight, <i>d</i> is the distance label,
and <i>p</i> is the predecessor of each vertex which is used to encode
the shortest paths tree. <i>Q</i> is a priority queue that supports the
DECREASE-KEY operation.  The visitor event points for the algorithm are
indicated by the labels on the right.
</p>

<table>
<tr>
<td valign="top">
<pre>
DIJKSTRA(<i>G</i>, <i>s</i>, <i>w</i>)
  <i>d[s] := 0</i> 
  INSERT(<i>Q</i>, <i>s</i>)
  <b>while</b> (<i>Q != &Oslash;</i>)
    <i>u :=</i> EXTRACT-MIN(<i>Q</i>)
    <b>for