Dijkstra algorithm in graph is more similar to DFS or BFS? -
i have answer question dont know more similar. saw dijkstra algorithm similar in ways bfs dfs. may explain me answer , why? thanks!
neither.
dijkstra indeed dynamic programming dp[v] = min{dp[u] + w(u,v)} u has calculated , w(u, v) edge value
.
it can proved using greedy right.
bfs , dfs methods search graph need. kind of things need?
if want distance node edge value 1, ok bfs special case of dijkstra.
if other algorithm or want other things bfs or dfs, there's noting dijkstra, or not similar them.
Comments
Post a Comment