Dijkstra's algorithm may not always yields the optimal solution
Answers
Answer:
Dijkstra’s algorithm normally employs a priority queue, you could not accomplish this in a setting where you would exclusively need dynamic programming.
Typically it is considered a greedy algorithm as it fundamentally uses the greedy choice property to obtain the optimum. But, one can implement Dijkstra’s algorithm as a dynamic programming algorithm. It is important to understand that these two categories are not disjoint, the algorithm has properties that one could debate about this. Normally when people discuss dynamic programming algorithms, they talk about deriving a recurrence relation and filling in a table to obtain the optimal value, then (sometimes) applying backtracing to obtain the actual solution.
Answer:
------------------------------------------------------------------
Dijkstra's algorithm normally employs a priority
queue, you could not accomplish this in a setting
would exclusively need dynamic where you programming.
Typically it is considered a greedy algorithm as it fundamentally uses the greedy choice property to obtain the optimum. But, one can implement Dijkstra's algorithm as a dynamic programming algorithm. It is important to understand that these two categories are not disjoint, the algorithm has properties that one could debate about this. Normally when people discuss dynamic programming algorithms, they talk about deriving a recurrence relation and filling in a table to obtain the optimal value, then (sometimes) applying backtracing to obtain the actual solution.