• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

Top MCQs on Shortest Paths in Graphs with Answers

Question 21

The Floyd-Warshall algorithm for all-pair shortest paths computation is based on:
  • Greedy paradigm.
  • Divide-and-Conquer paradigm.
  • Dynamic Programming paradigm.
  • neither Greedy nor Divide-and-Conquer nor Dynamic Programming paradigm.

Question 22

Consider a weighted undirected graph with positive edge weights and let uv be an edge in the graph. It is known that the shortest path from the source vertex s to u has weight 53 and the shortest path from s to v has weight 65. Which one of the following statements is always true?
  • weight (u, v) < 12
  • weight (u, v) ≤ 12
  • weight (u, v) > 12
  • weight (u, v) ≥ 12

Question 23

Which of the following algorithm solves the all-pair shortest path problem?
  • Prim’s algorithm
  • Dijikstra’s algorithm
  • Bellman-Ford’s algorithm
  • Floyd-Warshall’s algorithm

Question 24

Which one of the following algorithm design techniques is used in finding all pairs of shortest distances in a graph?
  • Dynamic programming
  • Backtracking
  • Greedy
  • Divide and Conquer

Question 25

Which of the following is application of Breath First Search on the graph?
  • Finding diameter of the graph
  • Finding bipartite graph
  • Both (a) and (b)
  • None of the above

Question 26

Which of the following data structure is useful in traversing a given graph by breadth first search?
  • Stack
  • List
  • Queue
  • None of the above.

Question 27

Let G=(V,E) be a directed, weighted graph with weight function w:E→R. For some function f:V→R, for each edge (u,v)∈E, define w′(u,v) as w(u,v)+f(u)−f(v). Which one of the options completes the following sentence so that it is TRUE ? “The shortest paths in G under w are shortest paths under w′ too, _________”.
  • for every f:V→R
  • if and only if ∀u∈V, f(u) is positive
  • if and only if ∀u∈V, f(u) is negative
  • if and only if f(u) is the distance from s to u in the graph obtained by adding a new vertex s to G and edges of zero weight from s to every vertex of G

Question 28

Given a directed graph where weight of every edge is same, we can efficiently find shortest path from a given source to destination using?
 

  • Breadth First Traversal

  • Dijkstra\'s Shortest Path Algorithm

  • Neither Breadth First Traversal nor Dijkstra\'s algorithm can be used

  • Depth First Search

There are 28 questions to complete.

Last Updated :
Take a part in the ongoing discussion