I felt it should be dynamic, but some places are writing its greedy and some places are writing its dynamic. am confused now

Dark Mode

1 vote

Dijkstra always chooses the closest vertex in V-S to add to set S where V= vertex set and S =set of vertices whose final shortest path weights from the source have been obtained.

So Dijkstra's algorithm is a greedy algorithm.Hence answer is option 3.

So Dijkstra's algorithm is a greedy algorithm.Hence answer is option 3.

then what about this.. https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm#Dynamic_programming_perspective

0

0 votes

Option C) Greedy Approach. On every iteration the vertex with the least distance after edge relaxation (**best choice at that point of time i.e Greedy approach)** is added to the list of mapped vertices

it can be dynamic cz each tym it is updated?isnt it?

what about this.. https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm#Dynamic_programming_perspective

0