in Algorithms retagged by
257 views
0 votes
0 votes

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

in Algorithms retagged by
by
257 views

3 Comments

NEGATIVE CYCLE??????
0
0

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.
3
3
They should be mention about from source and destination.
0
0

Please log in or register to answer this question.

Related questions