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.
A
Step-by-Step Solution
Insight: In an undirected graph, DFS only produces tree edges and back edges. If and we explore from to (meaning is unvisited), it must be a tree edge.
Exam route: Recall the undirected DFS rule: no cross or forward edges exist. Since is unvisited when explored from , it's a tree edge by definition.
Learning route:
- The graph is undirected and unweighted. is the shortest path distance from to .
- In undirected DFS, every edge is either a tree edge or a back edge. (Forward and cross edges are impossible.)
- "Explored first in the direction from to " means when examines , is unvisited, so DFS traverses to .
- By definition, an edge to an unvisited vertex is a tree edge.
- The condition is consistent: if is a tree edge, is a child of , so . Since , we have .
- Could it be a back edge? If were a back edge, would be an ancestor of , meaning was visited before . But the problem says the edge is explored from to first, implying was unvisited. Contradiction.
Answer: tree (A).