Computer Science · Graph Algorithms
Which of the following accurately describes the precise mechanism by which the Bellman-Ford algorithm computes shortest paths and detects negative weight cycles in a weighted graph?
- 1It relies on a First-In-First-Out queue to process vertices in layers exactly |V|-1 times, automatically converting any detected negative edge weight into a positive value to prevent cycle formation.
- 2It computes strongly connected components through a sequence of |V|-1 edge relaxations and confirms a negative cycle when the overall sum of vertex in-degrees and out-degrees becomes negative.
- 3It iteratively expands the shortest paths by exploring vertices in non-decreasing order of distance using a min-heap, terminating the |V|-1 loops early if a negative edge weight is encountered.
- 4It computes shortest paths by sequentially relaxing all edges exactly |V|-1 times, and guarantees the detection of a negative weight cycle if a subsequent relaxation further reduces any vertex distance.✓
Correct answer
It computes shortest paths by sequentially relaxing all edges exactly |V|-1 times, and guarantees the detection of a negative weight cycle if a subsequent relaxation further reduces any vertex distance.
Download Single Question PDF
Save this question and verified answer as a clean study sheet with live clickable link.
Share with Friends & Study Groups
Challenge your peer aspirants on WhatsApp or Telegram to solve this question!
Preparing for Computer Science?
Practice full-length mock tests with real exam timers, instant score analysis, and all-India ranking.
Want more practice questions on Graph Algorithms?
Solve complete topic-wise tests with detailed solutions on GkGet.
Related Practice Questions
Recommended practice questions in Computer Science · Graph Algorithms