Is Dijkstra's algorithm, dynamic programming

前端 未结 4 1149
既然无缘
既然无缘 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:08

    You address two questions:

    Dynamic Algorithms mean breaking a procedure down into simpler tasks. Several dynamic algorithms iclude the idea of recursion but are not limited too..

    Considering Dijkstra's algorithm the clasic solution is given by a for loop and is not a dynamic algorithm solution.

    However, From a dynamic programming point of view, Dijkstra's algorithm is a successive approximation scheme that solves the dynamic programming functional equation for the shortest path problem by the Reaching method.

    In fact, Dijkstra's explanation of the logic behind the algorithm, namely:

    Problem 2. Find the path of minimum total length between two given nodes P and Q.
    

    Note: taken from Wikipedia

提交回复
热议问题