Question:

Difference between Dijkstra's algorithm and Bellman-Ford's algorithm?

by  |  earlier

0 LIKES UnLike

 Tags:

   Report

6 ANSWERS


  1. all is well............. 


  2. dijkstra - greedy approach
               how?.........
               in dijkstra's algo, we actually find out the next new vertex with shortest path. this is greedy in it. means every time we r finding min. path for some vertex, and finally getting for all vertices one by one.
    what other thing we do is , upgrade other vertices cost  also.
    The shortest path from vertex 1 to i(any vertex) is an ordering among a subset of edges. hence it is an ordering problem.  
    Bellman ford -DP
                how?
                in Bellman ford, we make use of the fact that, when there are no cycles of neg. length, there is a shortest path between any 2 vertices of n vertex graph that has at-most n-1 edges on it.
    so we find for each vertex(other than source), if adding some new edge to its path from source, does its path-length reduces and if yes, we upgrade its path-length. we do it for n-1 times because of the above fact(when there are no cycles of neg. length, there is a shortest path between any 2 vertices of n vertex graph that has at-most n-1 edges on it.)

  3. dijkstra - greedy approach
    Bellman ford -DP

  4. Running time of dijkstra's algorithm is lower than that of bellman ford algorithm.preeti rohilla(m.tech)

  5. Running time of dijkstra's algorithm is lower than that of bellman ford algorithm.

  6. The only difference between two is that Bellman Ford is capable also to handle negative weights whereas Dijkstra Algorithm can only handle positives.

Question Stats

Latest activity: earlier.
This question has 6 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.