Similar questions 3 more →
Graph Algorithms


Your answer
Answer & solution
Answer: C (no official key was published)
Step 1: Breadth-first search’s FIFO queue processes all vertices at distance k before any vertex at distance k+1. Thus dequeue/discovery order is nondecreasing in distance from r.
Step 2: Two distinct vertices in the same layer can occur in either order, so visiting u first does not imply a strict inequality. A star centered at r supplies such an equal-distance example.
Therefore d(r,u)≤d(r,v), C, for vertices reached by this BFS. Unreachable vertices are not visited by the traversal from r.