Dijkstra’s shortest-path algorithm what if there are paths with same distance?

algorithm, dijkstra, shortest-path

Solution

It depends on your actual implementation and the way your input graph was described (e.g. edges can go in different order and this will have an impact on the result if there are many).

However, it's guaranteed that it will find some path which has optimal length.

Your table seems to be wrong at E and F vertices. The parent vertex for E is D (AB->BD->DE = 3 + 4 + 2 = 9), so is for F.

Problem

In this network Dijkstra’s shortest-path algorithm is used. The question is which path will A use to reach D because both are equal? is that table missing?

Original source