9,729 views

2 Answers

12 12 votes

Yes. It works in dynamic programming approach.

  • It calculates shortest paths in bottom-up manner.
  • Intermediate values are stored and used for next level values.
  • It first calculates the shortest distances for the shortest paths which have at-most one edge in the path. Stores it. 
  • Then, it calculates shortest paths with at-most 2 edges, and so on.
  • After the ith iteration of outer loop, the shortest paths with at most i edges are calculated.

Hence it follows Dynamic programming approach

For more details , please refer : http://www.geeksforgeeks.org/dynamic-programming-set-23-bellman-ford-algorithm/

0 0 votes
Bellman-ford we use data structure an array of size as no. of vertex and we update it looking at graph data structure in adj. matrix or adj. list. We run n times RELAX function for each edge. We never accept on each iteration the RELAXed value to be answer. We wait to run it n times. And we use the updated value of vertex weight in each iteration of data structure. i.e. This algorithm is completely rely on updating and using the stored value.

While Djkastra is based on finding best solution in each round. Which after n run combines to bring us the solution.
Position:
Show:

Related questions

1 1 vote
1 answers 1 answer
1.9k
1.9k views
Sandy Sharma asked Aug 3, 2018
1,874 views
What is the reason behind it? How do we find an optimal substructure and overlapping sub problems in this ? In which line of code memoization is done? BELLMAN-FORD(G,w,s)...
0 0 votes
2 answers 2 answers
3.6k
3.6k views
iarnav asked May 17, 2018
3,579 views
Is it Dynamic programming?
2 2 votes
0 0 answers
1.1k
1.1k views
Chhotu asked Nov 3, 2017
1,106 views
Hi Guys,As everyone knows Bellman Ford Algorithm works on DP approach. The algorithm calculate shortest paths in bottom-up manner. It first calculates the shortest distan...
4 4 votes
1 1 answer
2.3k
2.3k views
Sara Nimlon asked Jul 10, 2016
2,319 views
We have a Directed Graph with 100 vertexes. v1 v2 ... v100 and all edges weights is equal to 1. we want to used bellman-ford for finding all shortest paths from v1 to...