Master Mathematics.

Programming · Graph Algorithms · Problem 1

Classifying an edge in DFS

Consider performing depth-first search (DFS) on an undirected and unweighted graph starting at vertex . For any vertex in , is the length of the shortest path from to . Let be an edge in such that . If the edge is explored first in the direction from to during the above DFS, then becomes a edge.

  1. (A) tree
  2. (B) cross
  3. (C) back
  4. (D) gray

Source: GATE DA