• retagged by
20,418 views
47 47 votes

Consider the following directed graph:

Which of the following is/are correct about the graph?

  1. The graph does not have a topological order
  2. A depth-first traversal starting at vertex $S$ classifies three directed edges as back edges
  3. The graph does not have a strongly connected component
  4. For each pair of vertices $u$ and $v$, there is a directed path from $u$ to $v$

4 Answers

Best answer
34 34 votes

Lets put numberings to the nodes as follows:

The back edges are those edges from $v$ to $u$ in set $(u,v)$ where $u$ came first (i.e. already explored) in the DFS tree/forest.

  • $3$ to $2$
  • $12$ to $11$
  • $9$ to $S$

The DFS tree:

The graph has two cycles one at bottom left and one at bottom right. And every cycle forms SCC (Strongly connected component, since from every vertex $u,$ there is a path to $v, \bf{u \to v})$. C is false

The entire graph doesn’t have SCC. So, definitely D is false. 

Due to the presence of cycles Topological Sort is not possible.

Hence, the answer is A and B.

D would have been correct if it was For some pair of vertices u and v there is a directed path from u to v.

• selected by
25 25 votes

Option A: The graph does not have a topological order. $TRUE$ as there are cycles in the graph which means there are back edges.

Option B: A depth-first traversal starting at vertex S classifies three directed edges as back edges. $TRUE$ as shown in the below image.

Option C: The graph does not have a strongly connected component. $FALSE$ as shown in the below image there are 7 strongly connected components.

Option D: For each pair of vertices u and v, there is a directed path from u to v. $FALSE$ as its not true for all the edges.

So option A & B are correct.

10 10 votes

A) The graph does not have a topological order , because there’s a cycle in the bottom left corner of the graph

B) Yes, there are only 3 back edges, if started from S.

C) The graph does have a strongly connected component , it has cycle .

D) False , you can observe and find that not all rectangular/square components forms a cycle.

So answer : A) , B)

• edited by
4 4 votes

Note: Topological Sorting for a graph is not possible if the graph is not a DAG.

Hence Option(A) is correct

Option(B) is correct .There are 3 back edges from Vertex S  (Back edge: It is an edge (u, v) such that v is the ancestor of node u but is not part of the DFS tree).

Option(D) is incorrect as for each pair of vertices there is not a directed path available

Option(C) is incorrect because Strongly connected component is present in the graph

example of strongly connected graph is 

scc_fianldrawio

 

Answer:
Position:
Show:

Related questions

43 43 votes
4 answers 4 answers
16.5k
16.5k views
Arjun asked Feb 18, 2021
16,450 views
In a directed acyclic graph with a source vertex $\textsf{s}$, the $\textit{quality-score}$ of a directed path is defined to be the product of the weights of the edges on...
43 43 votes
6 answers 6 answers
25.0k
25.0k views
Arjun asked Feb 18, 2021
24,955 views
Let $G$ be a connected undirected weighted graph. Consider the following two statements.$S_1$: There exists a minimum weight edge in $G$ which is present in every minimum...
46 46 votes
3 answers 3 answers
16.6k
16.6k views
Arjun asked Feb 18, 2021
16,582 views
Suppose the following functional dependencies hold on a relation $U$ with attributes $P,Q,R,S$, and $T$:$P \rightarrow QR$$RS \rightarrow T$Which of the following functio...
47 47 votes
3 answers 3 answers
16.9k
16.9k views
Arjun asked Feb 18, 2021
16,868 views
For a string $w$, we define $w^R$ to be the reverse of $w$. For example, if $w=01101$ then $w^R=10110$.Which of the following languages is/are context-free?$\{ wxw^Rx^R \...