Description:

  • Polynomial time algorithms for an NP-hard problem X does not exist, unless P=NP
  • Use to optimize finding a solution in NP-hard if the decision version of it is NP-complete
  • Notation:
    • An optimization problem: X
    • Instance of X: x
    • solution of x returned by an algorithm A: A(x)
    • the value of a possible solution y of x: val(y)
    • the optimal value of instance x: Opt(x)
  • example: knapsack problem ( or ), any solution with weight less than W is a solution but there can be only 1 optimal solution
  • Difficulty:
    • Prove an approximation is guaranteed
    • Compare the solution return by the algorithm with an optimal solution that is computationally very hard to find

approximation algorithm:

  • An algorithm A is said to be an -approximation algorithm for an optimization problem X if for every instance x of X, A runs in poly-time and outputs a solution y such that:
    • val(y) Opt(x) if X is a maximization problem
    • val(y) Opt(x) if X is a minimization problem
  • for maximization and for minimization problem
  • If is close to 1, then y is close to the optimum solution; then A is the exact algorithm

Trade-offs:

  • One of these 3 can not be guaranteed:
    • Runs in polynomial times
    • Solves arbitrary instances of the probnlem
    • Find optimal solution to problem
  • -approximation algorithm:
    • Has polynomial run-time
    • Can solve arbitrary instances of the problem
    • Find solution whose value is within of optimum

Techniques for designing approximation algorithms:

Greedy Algorithm:
  • Fractional Knapsack Problem is -approximation algorithm for KP
    • Proof. Let (a 0-1 vector) be an optimal solution, and be respectively the total profit of the optimal solution and the solution returned by the greedy
    • Let be the first item not included by the greedy algorithm.
    • The profit at that point is
    • The overall occupancy at this point is
    • We will show that
    • Hence,
    • Proof. We will show that
    • We have that
    • Since , we obtain
  • Load balancing
    • Instance: n identical machines, and m jobs, each job i having a processing time
    • A machine can process at most one job at a time
    • Goal: The amount of processing time is as equal as possible, minimize the makespan, which is
      • where is the processing time of ith machine
    • NP hard, reduced from Partition Problem
    • Let T* be optimal makespan
    • Solution:
      • List-scheduling:
        1. Consider m jobs in some fixed order.
        2. Assign job i to machine whose load is smallest so far
        • if the almost last job is very large, it would make the machine assigned to that job have large T while others will be small
        • Claims:
          • T*
          • T*
          • proof: Total processing time of all jobs is T1 + T2 and Some machine must do at least half (or average) of the total workload
        • List-scheduling is a 2-approximation algorithm for lb
          • Proof. Suppose that machine 1 have the maximum load , and let be the last job scheduled on machine 1
          • At the time j was scheduled, machine 1 must have had the least load; load on 1 before assigning job is
          • Since 1 has the least load, we know and
          • . Hence,
      • To improve: LPT rule:
        • Sort the jobs in descending order of processing time, and process jobs using greedy algorithm
        • Claim: If there are more than 2 jobs then T* for 2 machines
        • Then it is -approximation algorithm for LB
          • proof: Suppose that machine 1 have the maximum load and let be the last job scheduled on machine 1
          • If machine 1 has only one job then schedule is optimal
          • If 1 has at least 2 jobs, it must be the case that , or
          • Hence,
Linear programming:
Dynamic Programming