728x90

Algorithm 8

Dijkstra , bellman-ford ,Bi-directional Djikstra

the difference happens how we smartly select edge in the case we Topologically sort the DAG and then select edges in order. since this is dag this works if graph doesn't have cycle and works for negative. in case of dijkstra we pick the edge that has the minimum priority (in this case d[u], the current shortest distance from source). dijkstra works with cycles but all the weight have to be non n..

728x90