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.

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.