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.
The IMF and the World Bank were conceived as institutions to-
What does S stands for in Real Time Gross ____ (RTGS)?
Which entity’s license was recently in the news for being cancelled or suspended by SEBI for regulatory non-compliance?
What is CIBIL score?
Which of the following is the most volatile foreign capital?
Sale of a security that is not owned by the seller is called? Â
What is VaR-
The share of net demand and time liabilities that banks must maintain in safe and liquid assets, such as, government  securities, cash and gold with...
The National Payments Corporation of India (NPCI) is an initiative taken by the _________________ to operate the retail payments and settlement systems ...
When the central bank (RBI) sells stocks and bonds in the market, the amount of money in the bank _______.