Ask your own question, for FREE!
Computer Science 26 Online
OpenStudy (anonymous):

why djikstra algorithm can't solve graph with negative edge

OpenStudy (anonymous):

hello

OpenStudy (shadowfiend):

The mechanics of the algorithm don't really allow it to. Dijkstra's algorithm immediately removes a node from consideration when the sum of existing weights and the shortest path weight to the node are higher than those of other nodes. With negative edge weights, a future edge could make one of those nodes viable again, but Dijkstra's algorithm will already have knocked it out of the running, so it won't be able to go through that node to find the shortest path. Does that make sense?

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!