1.

A graph is said to have a negative weight cycle when?(a) The graph has 1 negative weighted edge(b) The graph has a cycle(c) The total weight of the graph is negative(d) The graph has 1 or more negative weighted edgesI had been asked this question during an interview.This is a very interesting question from Shortest Path topic in chapter Shortest Path of Data Structures & Algorithms II

Answer»

The correct ANSWER is (c) The total WEIGHT of the graph is negative

For explanation: When the total weight of the graph sums up to a negative NUMBER then the graph is SAID to have a negative weight cycle. Bellmann Ford Algorithm provides no solution for such GRAPHS.



Discussion

No Comment Found

Related InterviewSolutions