Type of analyses
- Best case: lower bound
- Worst case: upper bound
- Average case: expected cost for random input
Actual data might not match input model?
- Need to understand the input to effectively process it.
- Approach1: design for the worst case.
- Approach2: randomize, depend on probabilistic guarantee
Example:1-SUM
Example:3-SUM
Algorithm Design Approach
Start
- Develop an algorithm
- Prove a lower bound
If there is a gap between between the developed algorithm and the current lower bound?
- lower the upper bound(find new algorithm)
- raise the lower bound(more difficult)
Golden age of algorithm design: 1970s, many known optimal algorithms were discovered then.
Caveats
- Maybe too pessimistic to focus on the worst case, which can is very rarely to meet.
We will use the tilde notation because of its accuracy towards the model and algorithm.