The Gateway to Computer Science Excellence
+1 vote
134 views

Can someone work this out?

in Algorithms by (413 points)
edited by | 134 views
0
In graph G1,

min distance from A to B is 2 optimally.

But dijakstra will compute it as 4.

Hence it won't calculate correct shortest path.

Here Question is not about dijakstra works or not.

Hence only G2 is correct.
0
a to b distance is 2 ...that is 8-4-2=2....it compute correctly
0
@shubham At initial stage itself dijakstra will fix the distance a-b as 4 because min of {4,7,8}. Hence no chance to again change that to 2.
0
yes you are correct...

Please log in or register to answer this question.

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,737 questions
57,324 answers
198,405 comments
105,169 users