150 views

What is meant by wrong path in Dijikstra's algo. Can anyone please explain

NEGATIVE CYCLE??????

Actually Dijikstra's algo is single source shortest path ===> source is fixed

but in the question, source is not given.

i assume source=A

A to B = A-B = 2

A to C = A-C = 7

A to D = A-B-D = 4

A to E = A-C-E = 9

A to F = A-B-D-F = 6

A to G = A-B-D-F-G = 8

these values are calculated by Dijikstra's algo.

But note that

A to G = A-C-E-G = 2

A to D = A-C-E-G-D = 3

A to F = A-C-E-G-D-F = 5

all these paths are wrongly calculated by Dijikstra's algo.

 Dijikstra's algo. may calculate wrongly, if the graph contains negative weight edges.

They should be mention about from source and destination.