zion4zion wrote:There can only be one "best" algorithm. And you haven't told what you find a better algorithm: a faster runtime, or an easier to understand algorithm. In the case of an easier to understand algorithm, Bellman-Ford would be a good choice.
i want to find shortest path in a negative weighted graph.
any other best algorithm than Bellman Ford algorithm ?
Also the weight of the edge may change depending upon the traversing...I don't know what you mean by that.
help me in this !!
zion4zion wrote:By ignoring them.
after detecting negative cycles in bellman ford algorithm, how we can eliminate that? plz help me !
my problem is to find shortest path between a source node and a destination node, the cost of the nodes in between may be negative.
And also the cost of the node may vary. for example, if there are 5 blue nodes totally, the cost of blue node that is present first in the shortest path is 5, and the second's is 4 , the thirds is 3.....
you understood ?