Steps:

  1. Formulate the problem precisely
  2. Design an algorithm
  3. Prove the algorithm is correct
  4. Analyze its runtime

Algothrm design techniques:

Complexity:

  • An algorithm is efficient if its running time is a polynomial in the input size
    • The running time is upper bounded by for some constants
    • ex: brute force can solve Gale Shapley Algorithm in
  • 2 main complexities:

Algorithm’s running time:

  • To measure a Efficient Algorithm
  • is asymptotically bounded by
  • Propositions:
    1. if for some constant then
      • Proof: by definition
      • by definition of Big Theta notation, it is true
    2. if then
    3. if then
  • To find which notation a function belongs to, do

Some classes of function:

  • Polynomials:
    • as
  • Logarithms:
    • for every and
    • as
  • Logarithms and Polynomials:
    • for every and every
    • as
  • Exponentials:
    • for every and every
    • as
  • Factorials:

Computational Intractability

P vs NP Problem

Approximation Algorithm