• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

Top MCQs on Shortest Paths in Graphs with Answers

Question 11

Match the following
              
Group A                                                Group B
a) Dijkstra\'s single shortest path algo               p) Dynamic Programming
b) Bellmen Ford\'s single shortest path algo           q) Backtracking  
c) Floyd Warshell\'s all pair shortest path algo.      r) Greedy Algorithm
  • a-r, b-q, c-p
  • a-p, b-p, c-p
  • a-r, b-p, c-p
  • a-p, b-r, c-q

Question 12

Is the following statement valid?.

Given a weighted graph where weights of all edges are unique (no two edge have same weights), there is always a unique shortest path from a source to destination in such a graph.
  • True
  • False

Question 13

Is the following statement valid?.

Given a graph where all edges have positive weights, the shortest paths produced by Dijsktra and Bellman Ford algorithm may be different but path weight would always be same.
  • True
  • False

Question 14

Which of the following statement(s)is / are correct regarding Bellman-Ford shortest path algorithm?
P: Always finds a negative weighted cycle, if one exist s.
Q: Finds whether any negative weighted cycle is reachable 
   from the source. 
  • P Only
  • Q Only
  • Both P and Q
  • Neither P nor Q

Question 15

Let G(V, E) an undirected graph with positive edge weights. Dijkstra\'s single-source shortest path algorithm can be implemented using the binary heap data structure with time complexity:
  • O(| V |2)
  • O (| E | + | V | log | V |)
  • O (| V | log | V |)
  • O ((| E | + | V |) log | V |)

Question 16

Let G = (V, E) be an undirected graph with a subgraph G1 = (V1, El). Weights are assigned to edges of G as follows :

GATECS2003Q67 
A single-source shortest path algorithm is executed on the weighted graph (V, E, w) with an arbitrary vertex ν1 of V1 as the source. Which of the following can always be inferred from the path costs computed?
  • The number of edges in the shortest paths from ν1 to all vertices of G
  • G1 is connected
  • V1 forms a clique in G
  • G1 is a tree

Question 17

Let G (V, E) be a directed graph with n vertices. A path from vi to vj in G is sequence of vertices (vi, vi+1, ......., vj) such that (vk, vk+1) ∈ E for all k in i through j - 1. A simple path is a path in which no vertex appears more than once. Let A be an n x n array initialized as follow
GATECS2003Q70 
Consider the following algorithm.
for i = 1 to n
   for j = 1 to n
      for k = 1 to n
         A [j , k] = max (A[j, k] (A[j, i] + A [i, k]); 
Which of the following statements is necessarily true for all j and k after terminal of the above algorithm ?
  • A[j, k] ≤ n
  • If A[j, k] ≥ n - 1, then G has a Hamiltonian cycle
  • If there exists a path from j to k, A[j, k] contains the longest path lens from j to k
  • If there exists a path from j to k, every simple path from j to k contain most A[j, k] edges

Question 18

Let G = (V, E) be a simple undirected graph, and s be a particular vertex in it called the source. For x ∈ V, let d(x) denote the shortest distance in G from s to x. A breadth first search (BFS) is performed starting at s. Let T be the resultant BFS tree. If (u, v) is an edge of G that is not in T, then which one of the following CANNOT be the value of d(u) – d(v)?
  • -1
  • 0
  • 1
  • 2

Question 19

Let G be a directed graph whose vertex set is the set of numbers from 1 to 100. There is an edge from a vertex i to a vertex j if either j = i + 1 or j = 3i. The minimum number of edges in a path in G from vertex 1 to vertex 100 is    

  • 4

  • 7

  • 23

  • 99

Question 20

Consider the weighted undirected graph with 4 vertices, where the weight of edge {i, j} g is given by the entry Wij in the matrix W
gt164
The largest possible integer value of x, for which at least one shortest path between some pair of vertices will contain the edge with weight x is ________
  Note : This question was asked as Numerical Answer Type.
  • 8
  • 12
  • 10
  • 11

There are 28 questions to complete.

Last Updated :
Take a part in the ongoing discussion