[Math] Condition to detect cycle in graph

graph theory

Which of the following condition is sufficient to detect cycle in a directed graph?

A. There is an edge from currently being visited node to an already visited node.

B. There is an edge from currently being visited node to an ancestor of currently visited node in DFS forest.

C. Every node is seen twice in DFS.

A is false,
B is true.

However, i saw this answer in this website in here I don't understand why option C is false. Can you please provide me with a counter example?

Best Answer

Can we consider the following example:

$G=(V,E)$ with $V=\{1,2,3\}$, $E=\{(1,2),(2,3),(1,3)\}$ and root designated to $1$, in which there is no cycle but $3$ is visited more than twice.