Here's my interpretation of how Dijkstra's algorithm as described by wikipedia will deal with the graph below.
First, he marks the shortest distance to all neighboring nodes, so A gets 1, and C gets 7. Then he chooses a neighbor with the current shortest path. This A. Origin is marked as visited and will no longer be viewed. The shortest (and only) path from start to B through A is now 12. A is marked as visited. The shortest path from start to destination via B is 13. B is marked as visited. The shortest path from Origin to C through destination is 14, but this is the double previous shortest path to C, which is 7, so 14 is discarded. Destination is now marked as visited.
The destination is marked marked, so the algorithm is completed. Here is the result:

So did I misinterpret the description? Is the wikipedia description incorrect? Or did I somehow stumble upon a case that shows that Dijkstra's algorithm is incorrect (which I really doubt)? I noticed that the chosen path is chosen greedily, but, apparently, this is one of the defining characteristics of the algorithm, however in this case it seems to give the wrong result.
source share