All Exams Test series for 1 year @ ₹349 only
Question

Match List - I with List - II.

List - IList - II
(A) Dijkstra’s Algorithms(I) Find the shortest path between all pairs of vertices in a graph with positive or negative edge weights.
(B) Floyd-Warshall Algorithms(II) Finds the shortest path in a weighted graph with non-negative edge weights.
(C) Bellman-frod Algorithms(III) Grows a spanning tree by repeatedly adding the smallest edge to a neighboring vertex.
(D) Prim’s Algorithms(IV) Finds the shortest paths from a single source in a directed graph with negative edge weights.

Choose the correct answer from the options given below :

This question was previously asked in
UGC NET 2024 Computer Science and Applications Question Paper (23-Aug-2024) (Shift 1)
The correct answer is

(A)-(II), (B)-(I), (C)-(IV), (D)-(III)

The list contrasts classic graph algorithms: single-source and all-pairs shortest paths, and a greedy tree-growing method.

(A) Dijkstra’s algorithm — greedy single-source shortest paths; correct only when every edge weight is non-negative: (A)-(II).

(B) Floyd-Warshall algorithm — dynamic programming over intermediate vertices that gives the shortest path between all pairs of vertices, with positive or negative edge weights (no negative cycle): (B)-(I).

(C) Bellman-Ford algorithm — relaxes every edge V−1 times, finds single-source shortest paths in a directed graph even when some edge weights are negative, and detects negative cycles: (C)-(IV).

(D) Prim’s algorithm — grows a minimum spanning tree by repeatedly adding the smallest edge that joins the tree to a neighbouring vertex: (D)-(III).

Codes that give Dijkstra the all-pairs description or Floyd-Warshall the non-negative single-source description swap the two shortest-path methods, and the code (C)-(III), (D)-(IV) gives Bellman-Ford the spanning-tree step and Prim the negative-weight shortest-path task, both of which belong to the other algorithm.

(A)-(II), (B)-(I), (C)-(IV), (D)-(III) option is correct.

Was this answer helpful?

Similar Questions

  1. Floyd-Warshall algorithm utilizes __________ to solve the all-pairs shortest paths problem on a directed graph in __________ time.

  2. An all-pairs shortest-paths problem is efficiently solved using :


Important Questions from Shortest Paths

  1. Let $G$ be a weighted directed acyclic graph with $m$ edges and $n$ vertices. Given $G$ and a source vertex $s$ in $G$, which one of the following options gives the worst case time complexity of the fastest algorithm to find the lengths of shortest paths from $s$ to all vertices that are reachable from $s$ in $G$?
  2. Let $G(V, E)$ be an undirected, edge-weighted graph with integer weights. The weight of a path is the sum of the weights of the edges in that path. The length of a path is the number of edges in that path.
    Let $s \in V$ be a vertex in $G$. For every $u \in V$ and for every $k \ge 0$, let $d_k(u)$ denote the weight of a shortest path (in terms of weight) from $s$ to $u$ of length at most $k$. If there is no path from $s$ to $u$ of length at most $k$, then $d_k(u) = \infty$.
    Consider the statements:
    S1: For every $k \ge 0$ and $u \in V$, $d_{k+1}(u) \le d_k(u)$.
    S2: For every $(u, v) \in E$, if $(u, v)$ is part of a shortest path (in terms of weight) from $s$ to $v$, then for every $k \ge 0$, $d_k(u) \le d_k(v)$.

    Which one of the following options is correct?
  3. Floyd-Warshall algorithm utilizes __________ to solve the all-pairs shortest paths problem on a directed graph in __________ time.

  4. An all-pairs shortest-paths problem is efficiently solved using :

Need Expert Advice?
Upcoming Exams
CTET
December 12, 2026
CBSE UGC NET
December 14, 2026
CSIR UGC NET
December 19, 2026
Test Series
UGC NET img
Teaching
UGC NET (Paper 2) 2026 Mock Test Series
796 Tests 2 Tests Free
219 Attempts
4.4(46)
English
More Questions from UGC NET

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App