• edited by
18,979 views
67 67 votes

Consider the tree arcs of a BFS traversal from a source node $W$ in an unweighted, connected, undirected graph. The tree $T$ formed by the tree arcs is a data structure for computing

  1. the shortest path between every pair of vertices.
  2. the shortest path from $W$ to every vertex in the graph.
  3. the shortest paths from $W$ to only those nodes that are leaves of $T$.
  4. the longest path in the graph.

9 Answers

0 0 votes
One of the application of BFS algorithm is to find the shortest path between nodes u and v.
But in the given question the BFS algorithm starts from the source vertex w and we can find the shortest path from W to every vertex of the graph.
Answer:
Position:
Show:

Related questions

63 63 votes
5 answers 5 answers
33.3k
33.3k views
go_editor asked Sep 28, 2014
33,329 views
Suppose depth first search is executed on the graph below starting at some unknown vertex. Assume that a recursive call to visit a vertex is made only after first checkin...
51 51 votes
5 answers 5 answers
19.7k
19.7k views
go_editor asked Sep 26, 2014
19,740 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...
48 48 votes
9 answers 9 answers
22.6k
22.6k views
Kathleen asked Sep 14, 2014
22,558 views
Consider an undirected, unweighted graph $G$. Let a breadth-first traversal of $G$ be done starting from a node $r$. Let $d(r,u)$ and $d(r,v)$ be the lengths of the short...
94 94 votes
17 answers 17 answers
30.1k
30.1k views
Ishrat Jahan asked Nov 3, 2014
30,119 views
In a depth-first traversal of a graph $G$ with $n$ vertices, $k$ edges are marked as tree edges. The number of connected components in $G$ is$k$$k+1$$n-k-1$$n-k$