Question 1 - DFS

During a Depth-First Search (DFS) on a directed graph G, the following edges are observed:

  • The edge (u, v) connects node u to node v, which has already been visited and fully explored.
  • The edge (x, y) connects node x to node y, which has been visited but not fully explored yet.
  • The edge (a, b) connects node a to node b, which has been fully explored, but b belongs to a different branch in the DFS tree.

Which of the following options correctly classifies these edges according to their type in a DFS traversal?

A) (u, v) is a forward edge, (x, y) is a back edge, (a, b) is a back edge.

B) (u, v) is a cross edge, (x, y) is a forward edge, (a, b) is a tree edge.

C) (u, v) is a forward or cross edge, (x, y) is a back edge, (a, b) is a cross edge.

D) (u, v) is a back edge, (x, y) is a cross edge, (a, b) is a forward edge.

E) (u, v) is a cross edge, (x, y) is a back edge, (a, b) is a tree edge.

Original Idea by Sergio Sanchez

Comentarios

Publicar un comentario

Entradas populares de este blog

Question 2 - Graph Theory

Question 3 - BFS