Let G = (V,E) be an input graph. What is L_{0.v.w} in the case where: (i) v = w; (ii) (v,w) is an edge of G; and (iii) v ≠ w and (v,w) is not an edge of G?
a) 0, 0, and +\infty
b) 0, \ell_{v w} , and \ell_{v w}
c) 0, \ell_{v w} , and +\infty
d) +\infty , \ell_{v w} , and +\infty
(See Section 18.4.6 for the solution and discussion.)
Correct answer: (c). If v = w, the only v-w path with no internal vertices is the empty path (with length 0). If (v,w) ∈ E, the only such path is the one-hop path v → w (with length \ell_{v w}). If v ≠ w and (v,w) ∉ E, there are no v-w paths with no internal vertices and { L}_{0,v,w}=+\infty.