recategorized by
18,458 views
45 45 votes

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?

  1. Weight $(u,v) \leq 12$
  2. Weight $(u,v) = 12$
  3. Weight $(u,v) \geq 12$
  4. Weight $(u,v) > 12$

6 Answers

Best answer
58 58 votes
C. Weight $(u,v) \geq 12$

If weight $(u, v) < 12$, then the min. weight of $(s, v) = $weight of $(s, u) + $ weight of $(u, v) = 53 + (<12) $ will be less than $65$.
edited by
8 8 votes

reference : cormen

shortest path : d

since (u,v) is an edge in graph 

d (s,v) <= d (s,u) + w (u,v)               // w : weight of edge (u,v)

65 <= 53 + w (u,v)

w (u,v) >= 12 

This equation simply says that the shortest distance from s to v cannot be more than the (shortest distance from s to u + including the weight of edge uv ( if v is discovered via u in bfs ) ) . It also tells about the bound on the weight of edge uv. This edge is rejected when it doesn’t helps in minimizing the path including vertex u and v from s 

4 4 votes

 

Above is an undirected weighted graph where shortest distance from source $S$ to $U$ is $53$  and $S$ to $V$ is $65$. Let's say $w(u,v)$ i.e edge weight from vertex u to v, is $x$ and take 2 cases.

Case $1:$ $x$ is strictly less than $12$.


When $w(u,v)$ is strictly less than $12$ then this contradicts that shortest distance from $S$ to $V$ is $65$, as now the shortest distance from $S$ to $V$ is $58$ (from $S \to U \to V$).

Therefore option A is false.


Case $2:$  $x$ is $12$ or greater than $12$.

When $w(u,v)$ is exactly $12$, the given info about shortest distances from source $S$ to $U$ and $V$ holds as still shortest distance from $S$ to $U$ is $53$, $S$ to $V$ is $65$, (also $65$ from $S \to U \to V$).

And if shortest distance info holds for $x=12$, then it'll also hold for $x > 12$.

Hence option $C$ is the answer.

edited by
1 flag:
✌ Edit necessary (duckduck “case1: shortest path distance is 65 not 63”)
0 0 votes

Ans = C

Make a graph which has direct edge from ‘s’ to ‘v’ ,now consider this as shortest path from ‘s’ to ‘v’ which is given as 65 ,no we know that if this is the shortest path then the another path from ‘s ‘ to ‘v’ via 'u' will be “ greater then equal to “ as it can be same or greater ,simple logical answer :)

Answer:
Position:
Show:

Related questions

7 7 votes
4 answers 4 answers
8.1k
8.1k views
Ishrat Jahan asked Oct 30, 2014
8,112 views
Consider the following pseudo-code:IF ((A B) AND (C D)) THEN A = A + 1 B = B + 1 ENDIFThe cyclomatic complexity of the pseudo-code is2345
57 57 votes
8 8 answers
18.4k
18.4k views
Ishrat Jahan asked Nov 3, 2014
18,361 views
A user level process in Unix traps the signal sent on a Ctrl-C input, and has a signal handling routine that saves appropriate files before terminating the process. When ...
13 13 votes
3 answers 3 answers
15.3k
15.3k views
Kathleen asked Sep 22, 2014
15,293 views
A common property of logic programming languages and functional languages is:both are procedural languages both are based on $\lambda$-calculusboth are declarativeboth us...
88 88 votes
7 answers 7 answers
38.1k
38.1k views
Rucha Shelke asked Sep 26, 2014
38,109 views
A computer system supports $32$-bit virtual addresses as well as $32$-bit physical addresses. Since the virtual address space is of the same size as the physical address ...