Imagine filling a 35-pound knapsack. An optimal solution is a feasible choice of items that produces the highest possible value. Choosing the most expensive item first may look sensible, but the stereo earns $3,000 while the laptop and guitar together earn $3,500. section 10.2
The difference is between a merely good or approximate result and the best possible result. Trying every possible set can find the optimum, but the number of sets doubles with each added item, making this approach impractical for large inputs. section 11.2
When a local choice is globally optimal
For classroom scheduling, repeatedly choosing the class that ends soonest produces three compatible classes. Here, each locally optimal choice leads to the globally optimal schedule. section 10.1
Use these questions to distinguish optimal solutions from attractive shortcuts:
- Does the solution maximize the objective, or is it only close to the maximum? section 10.2 section 11.2
- Must the container be filled completely? No: a valuable diamond can leave unused capacity and still belong to the optimal set. section 11.13


