'Fast' exponential and Pseudo polynomial algorithms Flashcards
What do we mean by a fast exponential?
Where instead of 2^n runtime, we get a base less than 2. For example, 1.5^n
Why is it more important to develop fast algorithms over getting faster hardware?
As due to the nature of exponentials, even hardware that is 20x faster will be faced with the same problem as slower hardware.
A better algorithm on a slower computer will almost certainly have less runtime than a more naïve algorithm on a faster machine.
What are some design paradigms we have that can be used to develop faster algorithms?
- Greedy algorithms
- Divide and Conquer
- Dynamic Programming
What is the dynamic programming paradigm?
Where we build a solution from the bottom up, using a table to store intermediate results
What is the definition of a pseudo polynomial time algorithm?
An algorithm is said to have pseudo polynomial runtime if its runtime is polynomial in the length of the input and the numbers appearing in the input
What is a pseudo polynomial (PP) time algorithm for the Knapsack problem?
An algorithm that uses a dynamic approach.
However this is only PP if the max weight and weights of the inputs are polynomial