Consider the Bellman-Ford equation . If node has exactly 4 direct neighbors, what is the minimum number of terms that must be evaluated in the function to compute the least cost path to a destination ?
A
Step-by-Step Solution
Key idea: The Bellman-Ford equation evaluates the minimum cost over the set of all direct neighbors of node .
Step 1: Identify the number of direct neighbors of node , which is explicitly given as 4.
Step 2: The function iterates over the set of direct neighbors . It does not include node itself, as a node is not its own neighbor.
Step 3: Therefore, exactly 4 terms must be evaluated, one for each of the 4 neighbors.
Answer: A