Classic Optimization Problems
In Computer Science, the classic optimization problems are the problems that an objective function that is to be maximized or minimized, with a set of constraints that must be honored.
They just look like “math puzzles”.
- The change-making problem addresses the question of finding
the minimum number of coins (of certain denominations) that add
up to a given amount of money.
Given unlimited amounts of coins of denominations d1 > … > dm , give change for amount n with the least number of coins.
- Example problem: d1 = 25c, d2 =10c, d3 = 5c, d4 = 1c and n = 48c (How about n=90c?)
- Knapsack problem: Given a set of items, each with a weight and a value, determine which items to include in the collection so that the total weight is less than or equal to a given limit and the total value is as large as possible.
1st, we are not trying to figure out
the answer for this specific question, but this type of question.
2nd, we are not trying to get an
answer, but a way of solving the problem
3rd, we are not just getting an
answer, but have to make sure it is correct.
Methods
Brute Force
Greedy Algorithm
Dynamic Programming
Brute Force
Greedy Algorithm
Dynamic Programming