Let \(G = (V,E)\) be a directed, weighted graph with weight function \(w: E…

PYQ GATE 2020

Let G=(V,E)G = (V,E) be a directed, weighted graph with weight function w:E→Rw: E \rightarrow \mathbb{R}. For some function f:V→Rf: V \rightarrow \mathbb{R}, for each edge (u,v)∈E (u,v)∈E, define w′(u,v)w′(u,v) as w(u,v)+f(u)−f(v)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 GG under w are shortest paths under w′w′ too, _________”.

  1. A.

    for every f:V→Rf: V \rightarrow \mathbb{R}

  2. B.

    if and only if ∀u∈V, f(u)\forall u \in V, \: f(u) is positive

  3. C.

    if and only if ∀u∈V, f(u)\forall u \in V, \: f(u) is negative

  4. D.

    if and only if f(u)f(u) is the distance from ss to uu in the graph obtained by adding a new vertex ss  to GG and edges of zero weight from ss to every vertex of GG

Attempted by 183 students.

Sign up free to check your answer

Sign up free

Explore the full course: Algorithms

Loading lesson…