Holooly Plus Logo

Question 18.2: How many candidates are there for an optimal solution to a s......

How many candidates are there for an optimal solution to a subproblem with the destination v? (Let n denote the number of vertices in the input graph. The in- and outdegree of a vertex is the number of incoming and outgoing edges, respectively.)

a) 2

b) 1 + the in-degree of v

c) 1 + the out-degree of v

d) n

(See Section 18.2.9 for the solution and discussion.)

Step-by-Step
The 'Blue Check Mark' means that this solution was answered by an expert.
Learn more on how do we answer questions.

Correct answer: (b). The optimal substructure lemma (Lemma 18.1) is stated as if there were two candidates for an optimal solution, but Case 2 comprises several subcases, one for each possible final hop (w, v) of an s-v path. The possible final hops are the incoming edges at v. Thus, Case 1 contributes one candidate and Case 2 a number of candidates equal to the in-degree of v. This in-degree could be as large as n − 1 in a directed graph (with no parallel edges), but is generally much smaller, especially in sparse graphs.

Related Answered Questions

Question: 18.P.4

Verified Answer:

With columns indexed by k and rows by vertex pairs...
Question: 18.P.5

Verified Answer:

With columns indexed by k and rows by vertex pairs...
Question: 18.P1

Verified Answer:

With columns indexed by i and rows by vertices: