1 6117CIT - Adv Topics in Computing Sci at Nathan
Algorithms
The intelligence behind the hardware
Outline ! Approximation Algorithms • The class APX ! Some complexity classes, like PTAS and FPTAS ! Illustration of some PTAS
! Based on • P. Schuurman and G. Woeginger (2001), Approximation Schemes - A Tutorial. • M. Mastrolilli course notes
2 © V. Estivill-Castro
The class APX ! (an abbreviation of "approximable") . ! The set of NP optimization problems that allow polynomial-time approximation algorithms with approximation ratio bounded by a constant (or constant-factor approximation algorithms for short). ! Problems in this class have efficient algorithms that can find an answer within some fixed percentage of the optimal answer. ! An approximation algorithm is called a !- approximation algorithm for some constant ! if it can be proven that the solution that the algorithm finds is at most ! times worse than the optimal solution. 3 © V. Estivill-Castro
1 !Review from week 2
! The vertex cover problem and traveling salesman problem with triangle inequality each have simple 2- approximation algorithms. ! The traveling salesman problem with arbitrary edge-lengths can not be approximated with approximation ratio bounded by a constant as long as the Hamiltonian- path problem can not be solved in polynomial time.
4 © V. Estivill-Castro
Alternative view on PTAS ! If there is a polynomial-time algorithm to solve a problem within every fixed percentage (one algorithm for each percentage), then the problem is said to have a polynomial-time approximation scheme (PTAS) • Unless P=NP, it can be shown that there are problems that are in APX but not in PTAS; that is, problems that can be approximated within some constant factor, but not every constant factor.
5 © V. Estivill-Castro
More on APX
! A problem is said to be APX-hard if there is a PTAS reduction from every problem in APX to that problem, ! A problem is APX-complete if the problem is APX-hard and also in APX. ! As a consequence of PTAS ! APX, no APX-hard problem is in PTAS.
6 © V. Estivill-Castro
2 Focus on Optimization Problems
! Notation • We use I for an instance of an optimization problem • We use |I|=n, for the length of the input instance • We use Opt(I) for the value of the optimal solution ! We focus on minimization problems in this lecture, but all concepts are symmetric for maximization problems.
7 © V. Estivill-Castro
!- Approximation Algorithm We denote A(I) = solution value.
An algorithm is an “!-Approximation Algorithm” if A(I) " ! Opt(I) for all instances and the running time is polynomial in |I|
! = worst-case approximation ratio ! >= 1 Good: ! close to 1
8 © V. Estivill-Castro
PTAS: Polynomial Time Approximation Scheme
This is a family {A#}#>0 of (1+#)-approximation algorithms with running time polynomial in |I|
•As observed in last lecture, the scheme fits the
definition if the running time is exponential in 1/# :
e.g. O(|I|1/#) NOTE: FPTAS: Fully PTAS running time also polynomial in 1/# : e.g. O(|I|/#3)
9 © V. Estivill-Castro
3 Strongly and Weakly NP-hard
! If a problem is NP-hard even if the input is encoded in unary, then it is called strongly NP-hard = NP-hard in the strong sense = unary NP-hard ! If a problem is polynomially solvable under a unary encoding, then it is solvable in pseudo-polynomial time.
! NP-Hard in the strong sense is contained within NP-Hard in the weak sense
10 © V. Estivill-Castro
Complexity Classes Relationships
NP Pseudo-Poly APX
PTAS FPTAS P
11 © V. Estivill-Castro
Some Known Approximation Algorithms Non-constant worst-case ratio • Graph coloring O(n1/2-e) • Total flow time O(n1/2) • Set covering O(log n) •Vertex cover O(log n) Constant worst-case ratio • TSP with triangle-inequalities 3/2 • Max Sat 1.2987
PTAS • Bin packing
FPTAS • Makespan on 2 machines 12 © V. Estivill-Castro
4 The first Approximation Algorithm (Graham ‘66)