mgechev / javascript-algorithms

💻 JavaScript implementations of computer science algorithms
https://mgechev.github.io/javascript-algorithms/
MIT License
7.83k stars 1.27k forks source link

Dijkstra implementation is not correct #122

Closed thunderrun closed 7 years ago

thunderrun commented 7 years ago

In example go with dijkstra(0, 4, distMatrix) and get the result 26.

However the correct distance is 20 (path 0->2->5->4)