what are the differences between Djistra’s and Bellman-Ford's shortest-path algorithm. Where are they used? An?
?
2010-10-16 02:16:09 UTC
what are the differences between Djistra’s and Bellman-Ford's shortest-path algorithm. Where are they used? An?
Three answers:
siamese_scythe
2010-10-16 02:25:10 UTC
Dijkstra's algorithm requires all edge costs to be nonnegative, whereas the Bellman-Ford algorithm does not. They are used to find shortest paths, so for example, you could use such an algorithm to suggest shortest driving routes.
Chris
2010-10-18 12:21:16 UTC
Dijkstra's algorithm only works when all edge costs are non negative, while Bellman-Ford works with negative costs too. Dijkstra's algorithm is faster and more widely used, as in most real-world graphs all edge costs are non negative.
Both algorithms are very similar, the only difference is that Bellman-Ford's algorithm relaxes all edges, v-1 times (where v is the number of vertices in the graph) while Dijkstra's algorithm greedily selects the not-yet-visited minimum-weight node.
venessa
2016-10-19 03:17:02 UTC
Dijkstra's set of rules in basic terms works whilst all part fees are non destructive, whilst Bellman-Ford works with destructive fees too. Dijkstra's set of rules is faster and greater drastically used, as in maximum real-international graphs all part fees are non destructive. the two algorithms are very comparable, the only distinction is that Bellman-Ford's set of rules relaxes all edges, v-one million circumstances (the place v is the form of vertices interior the graph) whilst Dijkstra's set of rules greedily selects the not-yet-visited minimum-weight node.
ⓘ
This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.