Question: Consider the following modification of Dijkstras algorithm: h ... initialization ... i H := makequeue(V ) while H is not empty v := deletemin(H) for
Consider the following modification of Dijkstras algorithm: h ... initialization ... i H := makequeue(V ) while H is not empty v := deletemin(H) for each e = (v, z) E if dist(v) + w(v,z) < dist(z) then dist(z) = dist(v) + w(v,z)
if z is in the queue H then decreasekey(H,z) else insert(H,z)
The modified algorithm correctly computes the distances in graphs with no negative cycles (negative edges allowed). (Remember, original Dijkstras algorithm does not correctly compute distances if negative edges are allowed.) Say something interesting about the running time of the modified Dijkstras algorithm. Prove your statement.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
