Recent questions tagged graph-search

15 15 votes
5 5 answers
10.3k
10.3k views
Consider the following algorithm someAlgo that takes an undirected graph $G$ as input. ...
3 3 votes
1 1 answer
380
380 views
Let $\text{G = (V, E)}$ be a simple undirected graph, and $s$ be a particular vertex in it called the source. For $x \in \text{V},$ let $d(x)$ denote the shortest distanc...
19 19 votes
3 answers 3 answers
12.4k
12.4k views
​​​​Consider performing depth-first search (DFS) on an undirected and unweighted graph $G$ starting at vertex $s$. For any vertex $u$ in $G, d[u]$ is the length of the sh...
42 42 votes
8 8 answers
21.1k
21.1k views
​​​​Let $G$ be a directed graph and $T$ a depth first search $\text{(DFS)}$ spanning tree in $G$ that is rooted at a vertex $v$. Suppose $T$ is also a breadth first searc...
46 46 votes
14 14 answers
22.5k
22.5k views
The number of edges present in the forest generated by the $\text{DFS}$ traversal of an undirected graph $G$ with $100$ vertices is $40$. The number of connected componen...
0 0 votes
1 1 answer
739
739 views
Consider the following statements:$\text{P}$: There exists no simple, undirected and connected graph with $80$ vertices and $77$ edges.$\text{Q}$: All vertices of Euler g...
56 56 votes
4 4 answers
19.2k
19.2k views
Let $U=\{1,2,3\}$. Let $2^{U}$ denote the powerset of $U$. Consider an undirected graph $G$ whose vertex set is $2^{U}$. For any $A, B \in 2^{U},(A, B)$ is an edge in $G$...
0 0 votes
1 answers 1 answer
2.0k
2.0k views
Consider the following strategy to solve the single source shortest path problem with edge weights from source s.1. Replace each edge with weight w by w edges of weight 1...
1 1 vote
2 2 answers
3.4k
3.4k views
Which of the following statement is true?For a directed graph, the absence of back edges in a DFS tree can have cycle.If all edge in a graph have distinct weight then the...
1 1 vote
4 4 answers
5.1k
5.1k views
In the following graph, discovery time stamps and finishing time stamps of Depth First Search (DFS) are shown as x/yx/y, where x is discovery time stamp and y is finishin...
0 0 votes
1 1 answer
748
748 views
How can we distinguish b/w back edge, the forward edge and cross edge in BFS or DFS traversal in Graphs?
78 78 votes
7 answers 7 answers
44.8k
44.8k views
Let $G$ be a simple undirected graph. Let $T_D$ be a depth first search tree of $G$. Let $T_B$ be a breadth first search tree of $G$. Consider the following statements.No...
0 0 votes
1 1 answer
1.0k
1.0k views
Please explain why first option is wrong Question: 12Choose the true statement.1.Preorder traversal of tree resembles the depth first search of the graph.2.Inorder traver...
1 1 vote
1 1 answer
701
701 views
Consider the following graph:What is maximum depth of recursive calls for processing graph by using DFS?5678
2 2 votes
1 1 answer
956
956 views
I want to know in which condition we should apply BFS and DFS for GRAPH Search ? And why?
40 40 votes
5 answers 5 answers
13.2k
13.2k views
The Breadth First Search (BFS) algorithm has been implemented using the queue data structure. Which one of the following is a possible order of visiting the nodes in the ...
5 5 votes
1 1 answer
6.1k
6.1k views
Which of the following statements are false ?$1.$ A depth-first search of a directed graph always produces the same number of tree edges (i.e., independent of the order i...
20 20 votes
4 answers 4 answers
8.6k
8.6k views
In the graph shown above, the depth-first spanning tree edges are marked with a $’ T’$. Identify the forward, backward, and cross edges.
6 6 votes
1 answers 1 answer
3.6k
3.6k views
Let G be a graph with n vertices and m edges.a. True or false: All its DFS forests (for traversals starting at different vertices) will have the same number of trees?b. T...