Arcs in digraphs may carry negative weights. if there’s a cycle of negative weight, there are no shortest paths. Otherwise, there might be.
Dijkstra’s (non-negative weights)
used for link-state routing
fails if there are negative weights
to implement efficiently, you need Fibonacci heap data structure
the goal is shortest path to a node from every other node
algorithm (given that c is goal):
Svisited = {}, Hunvisited = {a,b,…}, Cgoal(0, F)
S = {b,c}, H = {a,d,e,f,g,h}
S = {a,b,c}, H = {d,e,f,g,h}
S = {a,b,c,d}, H = {e,f,g,h}
Bellman-Ford algorithm