Let d(r,u) and d(r,v) be the lengths of the shortest paths from r to u and v respectively in G.
it creates confusion lets make it clear
length of path=no. of edges in the path
cost of path = sum of all weights of edges in the path
here it clearly talks about length so in BFS a node is visited before its children are visited
if u is visited before v it means
- either u comes become v
- or u and v are at same level
to measure there distance from a node r
d(r,u)<=d(r,v)
then only in BFS we will first visit u
so option C