Shortest Paths in Graphs Quiz

Last Updated :
Discuss
Comments

Question 1

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:

  • A

    O(| V |2)

  • B

    O (| E | + | V | log | V |)

  • C

    O (| V | log | V |)

  • D

    O ((| E | + | V |) log | V |)

Question 2

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

  • A

    Breadth First Traversal

  • B

    Dijkstra\'s Shortest Path Algorithm

  • C

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

  • D

    Depth First Search

Question 3

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, _________”.

  • A

    for every f:V→R

  • B

    if and only if ∀u∈V, f(u) is positive

  • C

    if and only if ∀u∈V, f(u) is negative

  • D

    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 4

Which of the following is application of Breath First Search on the graph?

  • A

    Finding diameter of the graph

  • B

    Finding bipartite graph

  • C

    Both (a) and (b)

  • D

    None of the above

Question 5

Which one of the following algorithm design techniques is used in finding all pairs of shortest distances in a graph?

  • A

    Dynamic programming

  • B

    Backtracking

  • C

    Greedy

  • D

    Divide and Conquer

Question 6

Which of the following algorithm solves the all-pair shortest path problem?

  • A

    Prim’s algorithm

  • B

    Dijikstra’s algorithm

  • C

    Bellman-Ford’s algorithm

  • D

    Floyd-Warshall’s algorithm

Question 7

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?

  • A

    weight (u, v) < 12

  • B

    weight (u, v) ≀ 12

  • C

    weight (u, v) > 12

  • D

    weight (u, v) ≄ 12

Question 8

The Floyd-Warshall algorithm for all-pair shortest paths computation is based on:

  • A

    Greedy paradigm.

  • B

    Divide-and-Conquer paradigm.

  • C

    Dynamic Programming paradigm.

  • D

    neither Greedy nor Divide-and-Conquer nor Dynamic Programming paradigm.

Question 9

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.

  • A

    8

  • B

    12

  • C

    10

  • D

    11

Question 10

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    

  • A

    4

  • B

    7

  • C

    23

  • D

    99

There are 28 questions to complete.

Take a part in the ongoing discussion