Similar questions 3 more →
Graph Algorithms

Answer & solution
Official answer: A
Method
If an undirected DFS edge led to a still-unvisited vertex, DFS would explore it before returning, making that vertex a descendant. If the vertex is already on the recursion stack it is an ancestor; an edge to a completed unrelated subtree would have discovered the current vertex earlier. For BFS, shortest-path distances differ by at most 1 across an edge. A triangle rooted at one vertex places the other two at depth 1 and still has an edge between them, disproving “exactly”.
Solution
In undirected DFS, an edge to an undiscovered vertex is explored before the current DFS call completes, so every non-tree edge joins an ancestor and descendant; no cross edges, making I true. BFS edges can connect equal-depth vertices, for example the edge joining the two non-root vertices of a triangle. The necessary inequality is |i−j|≤1, not equality 1. Thus only I, A.