Dijkstra shortest path yields unintuitive results
In the wikipedia article you linked, the final distance is only computed when the node is visited (step 6). The tentative distance is (re)calculated each time to visit a parent of a node, and overwritten if it's smaller (step 3).

So in your example,


We visit node 0.  We set tentative(1) = 0.2, tentative(3) = 0.5
We visit node 1, since it has the smallest tentative distance. We set tentative(2) = 1000.2
We visit node 3.  Since 0.6 &lt; 1000.2, we set tentative(2) = 0.6
We visit node 2.  Its final distance is tentative(2), which is currently 0.6