Question
Which of the following algorithms is best suited for
finding the shortest path in a weighted graph where some edges may have negative weights but no negative cycles?Solution
The Bellman-Ford Algorithm (C) is best suited for finding the shortest path in graphs that may have negative weights but no negative cycles. It works by relaxing the edges up to (V-1) times, where V is the number of vertices, ensuring it can handle negative weights and detect negative cycles. Why Other Options Are Wrong: A) Dijkstra's Algorithm: Dijkstra’s algorithm is faster than Bellman-Ford for graphs with non-negative weights but fails when negative weights are present, as it assumes all edge weights are positive. B) Kruskal's Algorithm: This is a Minimum Spanning Tree (MST) algorithm used to connect all nodes in a graph with minimum weight, not to find the shortest path between two nodes. D) Prim’s Algorithm: Like Kruskal’s, Prim’s algorithm is used for finding an MST, not for finding the shortest path in a graph with negative weights. E) Floyd-Warshall Algorithm: This algorithm computes shortest paths between all pairs of vertices and works for both positive and negative weights, but it is not optimal for solving single-source shortest path problems.
Which statements accurately describe the new frog species discovered in Arunachal Pradesh?
1. The new species is named Xenophrys apatani in honor...
What is the new category created by the Reserve Bank of India (RBI) for commercial banks as part of the revised investment norms?
With which state, 'Praja Palana Guarantee Darakasthu' is related?
In which city is the JFarm Adaptive Agriculture Research & Extension Centre being established by TAFE and ICRISAT?
Who inaugurated MILMEDICON-2025, where was it held, and what was the conference’s thematic focus?
The ADB has revised India's growth outlook due to global headwinds. Which of the following economic indicators were adjusted for FY26?Â
I. GDP g...
In the human body, what part is made of neither bones nor skin?
BimaKavach has received a direct insurance broking licence from the Insurance Regulatory and Development Authority of India (IRDAI), enabling the firm t...
According to Australia-based think tank Lowy Institute's 2023 Asia Power Index,which country holds the most power in Asia?
The government has approved the export of approximately 0.9 million tonne (MT) of broken rice to five African and Asian countries through National Coope...