Which of the following statement(s)is / are correct regarding Bellman-Ford shortest path algorithm?
P: Always finds a negative weighted cycle, if one exist s. Q: Finds whether any negative weighted cycle is reachable from the source.
(A) P Only
(B) Q Only
(C) Both P and Q
(D) Neither P nor Q
Answer: (B)
Explanation: Bellman-Ford shortest path algorithm is a single source shortest path algorithm. So it can only find cycles which are reachable from a given source, not any negative weight cycle. Consider a disconnected where a negative weight cycle is not reachable from the source at all.
If there is a negative weight cycle, then it will appear in shortest path as the negative weight cycle will always form a shorter path when iterated through the cycle again and again.
Quiz of this Question
Recommended Posts:
- GATE | Sudo GATE 2020 Mock II (10 January 2019) | Question 38
- GATE | Sudo GATE 2020 Mock II (10 January 2019) | Question 59
- GATE | Sudo GATE 2020 Mock II (10 January 2019) | Question 60
- GATE | Sudo GATE 2020 Mock II (10 January 2019) | Question 61
- GATE | Sudo GATE 2020 Mock II (10 January 2019) | Question 62
- GATE | Sudo GATE 2020 Mock II (10 January 2019) | Question 63
- GATE | Sudo GATE 2020 Mock II (10 January 2019) | Question 64
- GATE | Sudo GATE 2020 Mock II (10 January 2019) | Question 65
- GATE | Sudo GATE 2020 Mock II (10 January 2019) | Question 58
- GATE | Sudo GATE 2020 Mock II (10 January 2019) | Question 57
- GATE | Sudo GATE 2020 Mock II (10 January 2019) | Question 39
- GATE | Sudo GATE 2020 Mock II (10 January 2019) | Question 40
- GATE | Sudo GATE 2020 Mock II (10 January 2019) | Question 41
- GATE | Sudo GATE 2020 Mock II (10 January 2019) | Question 42
- GATE | Sudo GATE 2020 Mock II (10 January 2019) | Question 43
- GATE | Sudo GATE 2020 Mock II (10 January 2019) | Question 44
- GATE | Sudo GATE 2020 Mock II (10 January 2019) | Question 45
- GATE | Sudo GATE 2020 Mock II (10 January 2019) | Question 46
- GATE | Sudo GATE 2020 Mock II (10 January 2019) | Question 47
- GATE | Sudo GATE 2020 Mock II (10 January 2019) | Question 49

