# Dijkstra's Algorithm - two solutions possible?

I did a homework question, which was choosing the shortest path to the other points from a point using Dijkstra's Algorithm.

I ended up with the following, whilst an online applet resulted in something else (upper graph is my try, lower one is the applet's one):

(The vertices in the second image have different names, but I tried to use the same shape of the graph.)

So, instead of B-D I did E-D. For D, the routes B-D and B-E-D are of equal length, so I was wondering whether both are indeed correct.

Thanks.

-

Note that this answer is true also for simple graphs; consider $K_n$ with $w(e) = c$, $c \in \mathbb{R}$. – Raphael Jan 16 '11 at 15:36