CS252 Algorithms Wednesday, 2 November 2022 + Plan - Notes on "search space" for optimization problems also: objective function, constraints - General structure of DP problem solving - Apply it to wire-cutting - Apply it to knapsack - Apply it to others + Optimization problems, etc. - Given: a search space S and an objective function P:S -> R - Goal: find s in S such that P(s) is as large as possible - Short-term goal: just find the biggest P(s) + General DP plan - State the problem. What are we selecting, what are we optimizing, what are our constraints, input/output, etc. - Preliminaries - Get an example to work with - Think about brute force and the size of the search space - Define a parameterized subproblem that will support (1) computing the problem's final answer; (2) recursive decomposition of the subproblem? - Show recursive decomposition of that subproblem - Iteratively build the subproblem solutions from the bottom up - Get your answer - Want the item in your search space that gave the optimal result? - various kinds of backtracing