edited by
18,280 views
51 votes
51 votes

Let $G = (V, E)$ be a simple undirected graph, and $s$ be a particular vertex in it called the source. For $x \in 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. $-1$
  2. $0$
  3. $1$
  4. $2$
edited by

10 Answers

0 votes
0 votes
NOTE IF QSN MENTION ABOUT SHORTEST PATH IS WEIGHTED GRAPH
 THEN ALL WEIGHTS ARE EQUAL


BECAUSE BFS NOT COMPUTE SHORTEST PATH FOR DIFFERENT WEIGHTS GRAPH


SO IN EXAMPLE TAKE ALL WEIGHTS AS EQUAL U WILL FIND OPTION D AS CORRECT
Answer:

Related questions

34 votes
34 votes
4 answers
9
go_editor asked Sep 26, 2014
12,220 views
Let $G$ be a graph with $n$ vertices and $m$ edges. What is the tightest upper bound on the running time of Depth First Search on $G$, when $G$ is represented as an adjac...
49 votes
49 votes
8 answers
10