Skip to content
Related Articles

Related Articles

Improve Article

GATE | GATE 2017 MOCK II | Question 16

  • Last Updated : 28 Jun, 2021

Consider the following statements about Bellman ford algorithm for finding shortest path in a directed connected graph G having integral edge weights.

Statement I: It will always find out negative edge weight cycle in G reachable from source.

Statement II: It will always give correct answer for the graph G.

Choose from the options given below.

(A) Both statements are true
(B) Both statements are false

(C) Statement I is true and Statement II is false
(D) Statement II is true and Statement I is false

Answer: (C)

Explanation: Statement 1 is true as in the nth iteration of Bellman Ford, if the length of the path of any node reachable from the source is decreased, that means we are having negative edge weight cycle in the graph.

Statement 2 is false as no algorithm can give give correct answer if the Graph is having negative edge weight cycle.

Quiz of this Question

Attention reader! Don’t stop learning now.  Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.

Learn all GATE CS concepts with Free Live Classes on our youtube channel.

My Personal Notes arrow_drop_up
Recommended Articles
Page :