Prove weighted independent set DP has optimal substructure
Analyze the prove weighted independent set dp has optimal substructure.
Examples
Input:"proof_case_1"
Output:true
Input:"proof_case_2"
Output:true
Hints
Recall the definition of optimal substructure and how it applies to dynamic programming solutions.
Consider how the solution to a problem of size n can be constructed from solutions to smaller subproblems in the weighted independent set problem.
Analyze the recursive case of the DP solution for the weighted independent set problem and prove that the optimal solution for a problem of size n includes the optimal solutions to its subproblems.
Prove weighted independent set DP has optimal substructure
Analyze the prove weighted independent set dp has optimal substructure.