Is Dijkstra's algorithm, dynamic programming

前端 未结 4 1150
既然无缘
既然无缘 2021-02-12 17:59

All implementation of Dijkstra\'s algorithms I have seen do not have a recursive function, but I have also read that by definition dynamic programming is an algorithm with a rec

4条回答
  •  情深已故
    2021-02-12 18:29

    Dijkstra's Algorithm is like a water filling algorithm. At each step it chooses local minima that's the reason why many consider it as Greedy Algorithm. If you will try this same algorithm with choosing any arbitrary path not the local minima, then you will come to know that it's still working. Choosing a local minima is just because of filling water optimally as I mentioned earlier that it's like water filling algorithm. So, the main concept behind Dijkstra's Algorithm is to store the previous result to predict the upcoming result and that is what Dynamic Approach is.

    For more details refer below link

    Why does Dijkstra's algorithm work?

提交回复
热议问题