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

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

This question was previously asked in
UGC NET 2015 Paper 2 History Question Paper (28-Jun-2015)
The correct answer is

Floyd-Warshall algorithm

The all-pairs shortest-paths problem asks for the shortest distance between every ordered pair of vertices.

The Floyd-Warshall algorithm solves it directly by dynamic programming over intermediate vertices in \(O(V^{3})\) time, even with negative edge weights (no negative cycles).

Dijkstra and Bellman-Ford are single-source algorithms that must be repeated for each vertex, and Kruskal builds a minimum spanning tree, not shortest paths.

So the efficient all-pairs method is Floyd-Warshall.

Hence, Floyd-Warshall algorithm.

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. 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 :


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. 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 :

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