Introduction to Approximation Algorithms

Slides:



Advertisements
Similar presentations
Lecture 24 Coping with NPC and Unsolvable problems. When a problem is unsolvable, that's generally very bad news: it means there is no general algorithm.
Advertisements

1 Partition Into Triangles on Bounded Degree Graphs Johan M. M. van Rooij Marcel E. van Kooten Niekerk Hans L. Bodlaender.
The Theory of NP-Completeness
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
Combinatorial Algorithms
Complexity 16-1 Complexity Andrei Bulatov Non-Approximability.
Introduction to Approximation Algorithms Lecture 12: Mar 1.
Approximation Algorithms
Approximation Algorithms: Combinatorial Approaches Lecture 13: March 2.
1 Optimization problems such as MAXSAT, MIN NODE COVER, MAX INDEPENDENT SET, MAX CLIQUE, MIN SET COVER, TSP, KNAPSACK, BINPACKING do not have a polynomial.
Approximation Algorithms
The Theory of NP-Completeness
Computability and Complexity 24-1 Computability and Complexity Andrei Bulatov Approximation.
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
Approximation Algorithms Motivation and Definitions TSP Vertex Cover Scheduling.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
The Traveling Salesperson Problem Algorithms and Networks.
Approximation Algorithms Department of Mathematics and Computer Science Drexel University.
1 The Theory of NP-Completeness 2012/11/6 P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class of decision.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
1 The TSP : NP-Completeness Approximation and Hardness of Approximation All exact science is dominated by the idea of approximation. -- Bertrand Russell.
1 Approximation Through Scaling Algorithms and Networks 2014/2015 Hans L. Bodlaender Johan M. M. van Rooij.
Design Techniques for Approximation Algorithms and Approximation Classes.
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
Advanced Algorithm Design and Analysis (Lecture 13) SW5 fall 2004 Simonas Šaltenis E1-215b
Lecture 22 More NPC problems
Approximation Algorithms
1 Steiner Tree Algorithms and Networks 2014/2015 Hans L. Bodlaender Johan M. M. van Rooij.
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
Princeton University COS 423 Theory of Algorithms Spring 2001 Kevin Wayne Approximation Algorithms These lecture slides are adapted from CLRS.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
Unit 9: Coping with NP-Completeness
1 Approximation algorithms Algorithms and Networks 2015/2016 Hans L. Bodlaender Johan M. M. van Rooij TexPoint fonts used in EMF. Read the TexPoint manual.
Algorithms for hard problems Introduction Juris Viksna, 2015.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness Proofs.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
Approximation algorithms
TU/e Algorithms (2IL15) – Lecture 11 1 Approximation Algorithms.
The Theory of NP-Completeness
More NP-Complete and NP-hard Problems
8.3.2 Constant Distance Approximations
Lap Chi Lau we will only use slides 4 to 19
Richard Anderson Lecture 26 NP-Completeness
Optimization problems such as
Topics in Algorithms Lap Chi Lau.
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
Richard Anderson Lecture 26 NP-Completeness
Approximation algorithms
Algorithms for hard problems
NP-Completeness Yin Tat Lee
Computability and Complexity
Introduction to Approximation algorithms
Approximation Algorithms for TSP
ICS 353: Design and Analysis of Algorithms
Parameterised Complexity
Richard Anderson Lecture 25 NP-Completeness
Richard Anderson Lecture 28 NP-Completeness
Chapter 34: NP-Completeness
Approximation Algorithms
CS 3343: Analysis of Algorithms
NP-Completeness Yin Tat Lee
NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and Johnson, W.H. Freeman and Company, 1979.
NP-Completeness Yin Tat Lee
No Guarantee Unless P equals NP
The Theory of NP-Completeness
Approximation Algorithms
Lecture 24 Vertex Cover and Hamiltonian Cycle
Presentation transcript:

Introduction to Approximation Algorithms Algorithms and Networks 2017/2018 Johan M. M. van Rooij Hans L. Bodlaender TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA

Polynomial solution algorithms Solution quality Computation time Optimal Bound on quality Good solution, no quality guarantee Polynomial Polynomial solution algorithms Approximation algorithms Construction heuristics Super polynomial and/or no guarantee Exact algorithms: Tree search Dynamic programming Integer linear programming …… Hybrid algorithms Column generation without complete branch-and-price Meta heuristics: Local search Genetic algorithms I borrowed this slide from Marjan van den Akker.

Polynomial solution algorithms Solution quality Computation time Optimal Bound on quality Good solution, no quality guarantee Polynomial Polynomial solution algorithms Approximation algorithms Construction heuristics Super polynomial and/or no guarantee Exact algorithms: Tree search Dynamic programming Integer linear programming …… Hybrid algorithms Column generation without complete branch-and-price Meta heuristics: Local search Genetic algorithms Algorithms and networks Algorithms and networks

What to do if a problem is NP-complete? We have already seen many options to deal with NP-complete problems. Earlier in this course: FTP and exact exponential-time algorithms. Later in this course: Treewidth. In other courses: local search, ILP, constraint programming, … Approximation algorithms are one of these options. An approximation algorithm is a heuristic with a performance guarantee. We consider polynomial-time approximation algorithms. Non-optimal solutions, but with some performance guarantee compared to the optimal solution. Also useful as a starting point for other approaches: Local search, branch and bound.

What is a polynomial-time approximation algorithm? An algorithm that... ‘Solves’ (applies to) an optimisation problem. A minimisation problem or a maximisation problem. E.g., independent set, vertex cover, knapsack, max-SAT. Not: SAT, 3-SAT, etc. Runs in polynomial time. It has a bound on the quality of the solution. This is called the approximation ratio. E.g.: value of algorithm result / optimal solution value · c. We call such an algorithm a c-approximation.

Approximation ratio For an instance I of an optimisation problem, let OPT(I) be the value of the optimal solution to I. ALG(I) be the value computed by the approximation algorithm. An algorithm for a minimisation problem has an approximation ratio c, if for all instances I: An algorithm for a maximisation problem has an approximation ratio c, if for all instances I: Approximation ratio always strictly bigger than 1. Question: what would be a 1-approximation?

Class of approximation algorithms Class of problems with approximation algorithms whose approximation ratio is a constant: APX. Subclass of NP. We only consider optimisation problems in NP. Other notions of approximability also exist. We see some of them the next lecture. And, one at the end of this lecture. Notions of APX-completeness also exist. As NP-completeness. We will see this at the end of the lectures on approximation algorithms.

This lecture Approximation algorithms for a series of problems: Travelling Salesman Problem. Minimum (Weight) Vertex Cover. Max Satisfiability.

Maximum Satisfiability Approximation algorithms - Algorithms and Networks Maximum Satisfiability

Max satisfiability (decision version) Maximum Satisfiability (Max SAT). Instance: A set of clauses C containing literals of variables from a set X and an integer k. Question: Does there exist a truth assignment to the variables in X such that at least k clauses in C are satisfied? k-Satisfiability (k-SAT): Instance: set of clauses C (logical formula in CNF format) where each clause contains at most k literals. Question: does there exist a satisfying assignment to the variables in C, i.e., a truth assignment such that each clause has at least one literal set to true. Defined similarly: Maximum k-Satisfiability (Max k-SAT)

Approximating Max Satisfiability Algorithm: Take any truth assignment a to the variables X. Let :a be the assignment a with all variables negated. Return from {a,:a} the assignment that satisfies most clauses. This is a 2-approximation. ALG ¸ |C|/2, OPT · |C|. Why? Can you also give approximation algorithms for max k-Satisfiability?

Travelling salesman problem Approximation algorithms - Algorithms and Networks Travelling salesman problem

The travelling salesman problem with triangle inequality Instance: n vertices (cities), distance between every pair of vertices. Question: Find shortest (simple) cycle that visits every city? Restriction on distances: Triangle inequality: for all x, y, z: w(x,y) + w(y,z) ³ w(x,z) 1 2 3 4 4 4 1 2 1 2 3 2 3 2 4 4 Also: symmetric distances 2 2 3 4 3 4 2 2 11 12

A simple algorithm Consider the Travelling Salesman Problem with triangle inequality. Algorithm: Find a minimum spanning tree. Output vertices of tree in preorder. Preorder: visit a node before its children. Take a tour following the MST This algorithm has approximation ratio 2: OPT ≥ MST. 2 MST ≥ ALG. ALG / OPT ≤ 2MST / MST = 2. Ratio: show example on the blackboard.

Can we do better? Yes: Christofides’ algorithm Construct a Minimum Spanning Tree T. Set W = {v | v has odd degree in tree T}. Compute a minimum weight matching M in the graph G[W]. Look at the graph T+M. Note that T+M is Eulerian! Compute an Euler tour C’ in T+M. Add shortcuts to C’ to get a TSP-tour. This is a 3/2-approximation. Proof on the blackboard. Question: Euler tour, can we remember what that was, and when it existed?

Proving approximation ratios We just saw two algorithms for TSP with triangle inequality. We proved approximation ratios in the following way: Use a quantity x that relates to both the optimal solution and the result of the algorithm A minimum spanning tree in both cases. Prove that OPT ¸ c1 x. Prove that ALG · c2 x Combine both inequalities for a bound on ALG / OPT. Next, we consider some more problems.

MINIMUM (weight) VERTEX COVER Approximation algorithms - Algorithms and Networks MINIMUM (weight) VERTEX COVER

Approximation for minimum vertex cover Algorithm: Let E’ = E, C = ;. While E’  ;. Let {u,v} be any edge from E’. C := C [ {u,v}. Remove every edge incident to u or v from E’. Return C. Approximation algorithm? Runs in polynomial time. Returns a vertex cover. How good is this vertex cover?

2-approximation for vertex cover Theorem: The algorithm on the previous slide is a 2-approximation. Proof: Let A be the set of edges which endpoints we picked. OPT ¸ |A|, because every edge in A must be covered. ALG = 2|A| · 2OPT, hence ALG/OPT · 2. Vraag bewijs aan studenten. Na de TSP voorbeelden moeten ze deze zelf kunnen.

Minimum weight vertex cover Vertex cover where each vertex has a weight. We look for the minimum weight vertex cover. 2-approximation for vertex cover no longer works. We may select very heavy vertices using that algorithm. Next, we will give a 2-approximation for minimum weights vertex cover using LP rounding.

An ILP formulation of the problem Consider the following ILP: In the LP relaxation of this problem, the last constraint isreplaced by: 0 · xv · 1. Linear programming can be solved in polynomial time. Not by the simplex algorithm!! Ellipsoid method / interior point methods.

2-Approximation algorithm for minimum weight vertex cover Compute the optimal solution to the LP relaxation. Output all v with xv ¸ ½. This algorithm returns a vertex cover. For every edge, sum of incident vertices at least 1. Hence at least one of the vertex variables at least ½. Approximation algorithm? Runs in polynomial time and produces a vertex cover. How good is this vertex cover? Proof of 2-approximation on the blackboard! Before click 1: does this algorithm return a vertex cover?

Approximation algorithms - Algorithms and Networks CONCLUSION

Conclusion We have seen several different approximation algorithms for different problems: 2-approximations for Max Satisfiability (and Max k-SAT) 1.5- and 2-approximations for TSP. 2-approximations for vertex cover and weighted vertex cover. c-approximations, for a constant c, are called constant factor approximation algorithms. There are more different types of approximations. These we will see after the break.

The Landscape of Approximation Algorithms Algorithms and Networks 2017/2018 Johan M. M. van Rooij Hans L. Bodlaender TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA

What is a polynomial-time approximation algorithm? An algorithm that... Solves an optimisation problem. Runs in polynomial time. It has a bound on the quality of the solution. Approximation ratio c: ALG/OPT · c for minimisation problems. OPT/ALG · c for maximisation problems. Ratio always bigger or equal to 1.

Different forms of approximation algorithms (outline of two lectures) Qualities of polynomial-time approximation algorithms: Absolute constant difference. |OPT – ALG| · c FPTAS: Fully polynomial-time approximation scheme. Approximation ratio 1+² for any ² > 0, while the algorithm runs in time polynomial in n and 1/². PTAS: Polynomial-time approximation scheme. Approximation ratio 1+² for any ² > 0, while the algorithm runs in polynomial time for any fixed ². APX: Constant-factor approximation. Approximation ratio: ALG/OPT · c for minimisation problems. Approximation ratio: OPT/ALG · c for maximisation problems. f(n)-APX: Approximation by a factor of f(n). f(n) depends only on the size of the input. From top to bottom: best approximation to worst approximation. We have seen several examples of constant factor approximation in the last lecture.

Absolute constant difference Qualities of poly-time approximation algorithms: Absolute constant difference. FPTAS: Fully polynomial-time approximation scheme. PTAS: Polynomial-time approximation scheme. APX: Constant-factor approximation. f(n)-APX: Approximation by a factor of f(n). Approximation algorithms - Algorithms and Networks Absolute constant difference

Absolute constant difference Algorithms that run in worst-case polynomial time, with: |OPT – ALG| · c Example: Planar graph colouring. Algorithm that tests 1 and 2-colourability and if no solution is found outputs 4. Algorithm has an error of at most 1, because of the four colour theorem. Four colour theorem: Any planar graph G can be coloured with at most four colours.

Absolute constant difference for edge colouring Vizings Theorem: Any graph G can be edge coloured with at most ¢(G)+1 colours, where ¢(G) is the maximum degree of G. Note that any edge colouring of a graph G requires at least ¢(G) colours. Corollary: Edge colouring is approximable with an absolute constant error of one. Algorithm: Return ¢(G)+1. Still, these examples of approximation with additive constant difference are very rare!

Absolute constant difference: very rare Suppose we could approximate maximum independent set within an additive integer constant c > 0. Then, we can solve an NP-complete problem in polynomial time (proof on the blackboard). Similar construction exist for many more problems. Answer: make multiple disjoint copies – if we can approximate within additive factor k, then with more than k copies, we can solve at least one of the disjoint copies.

Fully polynomial-time approximation scheme Qualities of poly-time approximation algorithms: Absolute constant difference. FPTAS: Fully polynomial-time approximation scheme. PTAS: Polynomial-time approximation scheme. APX: Constant-factor approximation. f(n)-APX: Approximation by a factor of f(n). Approximation algorithms - Algorithms and Networks Fully polynomial-time approximation scheme

Knapsack We will introduce the FPTAS (Fully Polynomial-Time Approximation Scheme) using an example first. Knapsack: Given: n items each with a positive integer weight w(i) and integer value v(i) (1 ≤ i ≤ n), and an integer W. Question: select items with total weight at most W such that the total value is as large as possible.

Dynamic programming for knapsack Let P be the maximum value of any item. We can solve the problem in O(n2P) time with dynamic programming: Tabulate M(i,Q): minimum total weight of a subset of items 1,…,i with total value Q for Q at most nP. M(0,0) = 0 M(0,Q) = ∞, if Q>0 M(i+1,Q) = min{ M(i,Q), M(i,Q-v(i+1)) + w(i+1) } This algorithm is clearly correct and runs in the given time. This is a pseudo-polynomial-time algorithm. Pseudo polynomial: polynomial in n and the weights P (or W). Super-polynomial running time if P is (exponentially) large compared to n.

Scaling for knapsack We will turn the pseudo-polynomial time algorithm into an approximation algorithm. Algorithm for knapsack: Throw away all items that have weight larger than W (they are never used). Build a new instance: Let c be some positive constant. Do not change weights, but set new values v’(i) = ëv(i) / cû. Solve scaled instance with DP optimally. Output this solution: approximate solution to the original instance.

The question is…. As we scale values, not weights, the output is always feasible. The question is: how do we set c, such that… Approximation ratio good enough? Polynomial time? Approximation quality (blackboard): ALG ¸ OPT – nc. Running time: O(n2P/c).

A different kind of approximation algorithm For any constant ² > 0, we use c = eP/(2n). Largest value of an item is at most P/c = P / (eP/(2n)) = 2n/e . Running time is O(n2 * 2n/e) = O(n3/e). Approximation ratio (on blackboard): 1+e. Arbitrary good approximation. For fixed epsilon, these run in polynomial time. Running time grows exponentially in number of bits precision. This is a Polynomial Time Approximation Scheme (PTAS). That is, an algorithm, that gets two inputs: the “usual” input X, and a real value e>0. And, for each fixed e>0, the algorithm is a (1+e)-approximation algorithm.

PTAS and FPTAS For any constant ² > 0, we have an algorithm with: Running time is O(n3/e). Approximation ratio: 1+e. Actually, this is a Fully Polynomial Time Approximation Scheme (FPTAS). That is, an algorithm, that gets two inputs: the “usual” input X, and a real value e>0. And, for each fixed e>0, the algorithm is a (1+e)-approximation algorithm. And, the algorithm uses polynomial time in both n and 1/e.

Polynomial-time approximation scheme Qualities of poly-time approximation algorithms: Absolute constant difference. FPTAS: Fully polynomial-time approximation scheme. PTAS: Polynomial-time approximation scheme. APX: Constant-factor approximation. f(n)-APX: Approximation by a factor of f(n). Approximation algorithms - Algorithms and Networks Polynomial-time approximation scheme

PTAS and FPTAS A Polynomial Time Approximation Scheme is an algorithm, that gets two inputs: the “usual” input X, and a positive real value e>0. For each fixed e>0, the algorithm: Is an (1+e)-approximation algorithm. Uses polynomial time. A Fully Polynomial Time Approximation Scheme is an algorithm, that gets two inputs: the “usual” input X, and a positive real value e>0. The algorithm uses polynomial time in the size of X and in 1/e.

PTAS that are not an FPTAS It is not always possible to construct an FPTAS (even if we have a PTAS). Example: maximum independent set has no FPTAS. Suppose that it has, for each fixed e>0, some algorithm: Is an (1+e)-approximation algorithm. Uses polynomial time in the size of X and in 1/e. Let ² = 1/n and run the algorithm. The algorithm uses polynomial time. The algorithm solves the problem optimally as: Hence, no such algorithm exists unless P=NP.

PTAS that are not FPTAS are often found in a geometric setting Proof that no FPTAS exists also works if we restrict the class of graphs. The only property of max independent set that we have used is that the optimum is bounded by n. The same proof works for any problem with a polynomial bound p(n) on the size/quality of an optimal solution. Use ² = 1/p(n). That’s why we call this the ‘polynomial-bound technique’. There exists a PTAS for maximum independent set restricted to: Planar graphs (next!). Unit-disk graphs (we will not consider these in the lectures).

Planar graphs and k-outerplanar graphs Given a planar embedding of a graph G, we define the level of a vertex as follows: All nodes that lie on the exterior face have level 1. For any i, if we remove from the embedding all nodes of level smaller than i, then all nodes that lie on the border of the exterior face have level i. A k-outerplanar graph is a graph that allows a planar embedding consisting of at most k levels. Lemma (that we will not prove in this lecture): For any k, maximum independent set restricted to k-outerplanar graphs can be solved optimally in O(8kn) time. Voorbeeld van graaf op bord zetten!

PTAS for maximum independent set on planar graphs Algorithm (input: graph G, approximation ratio r>1) Let k = d1/(r-1)e. Compute a planar embedding of G. Compute the level numbers for all vertices in G. For i = 0 to k: Let Vi be V with all nodes that modulo k+1 have level i removed. Let Gi be the graph induced by Vi (note: it is k-outerplanar). Compute a maximal independent set in Gi using the lemma. Return the largest independent set found over all k tries. Consider the maximum independent set I in G. At least one Vi has |Vi Å I| · |I|/(k+1). Thus the resulting sets is of size at least: |I| k/(k+1). Approximation ratio r.

PTAS for maximum independent set on planar graphs Algorithm (input: graph G, approximation ratio r>1) Let k = d1/(r-1)e. Compute a planar embedding of G. Compute the level numbers for all vertices in G. For i = 0 to k: Let Vi be V with all nodes that modulo k+1 have level i removed. Let Gi be the graph induced by Vi (note: it is k-outerplanar). Compute a maximal independent set in Gi using the lemma. Return the largest independent set found over all k tries. Running time: O(8kkn). Since k = d1/(r-1)e, this is polynomial for a fixed approximation ratio r. Other PTASses in a geometric setting often use the same principle: divide the graph into smaller parts on which we can solve it optimally fast.

Approximation algorithms - Algorithms and Networks CONCLUSION

Conclusion Absolute constant difference. |OPT – ALG| · c Examples: Planar graph colouring, edge colouring. Negative example: maximum independent set. FPTAS: Fully polynomial-time approximation scheme. Approximation ratio 1+² for any ² > 0, while the algorithm runs in time polynomial in n and 1/². Example: knapsack (scaling). PTAS: Polynomial-time approximation scheme. Approximation ratio 1+² for any ² > 0, while the algorithm runs in polynomial time for any fixed ². Example: maximum independent set on planar graphs.

The Landscape of Approximation Algorithms Part 2 Algorithms and Networks 2017/2018 Johan M. M. van Rooij Hans L. Bodlaender Intro: 5 min ABS: 5 min PTAS/FPTAS: 15 min APX: 5 min F(n)-APX: 15 min TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA

Different forms of approximation algorithms (outline of two lectures) Qualities of polynomial-time approximation algorithms: Absolute constant difference. |OPT – ALG| · c FPTAS: Fully polynomial-time approximation scheme. Approximation ratio 1+² for any ² > 0, while the algorithm runs in time polynomial in n and 1/². PTAS: Polynomial-time approximation scheme. Approximation ratio 1+² for any ² > 0, while the algorithm runs in polynomial time for any fixed ². APX: Constant-factor approximation. Approximation ratio: ALG/OPT · c for minimisation problems. Approximation ratio: OPT/ALG · c for maximisation problems. f(n)-APX: Approximation by a factor of f(n). f(n) depends only on the size of the input. From top to bottom: best approximation to worst approximation. We have seen an example of an FPTAS (and thus PTAS) last lecture, and several examples of constant factor approximation.

What we have seen already Absolute constant difference. |OPT – ALG| · c Examples: Planar graph colouring, edge colouring. Negative example: maximum independent set. FPTAS: Fully polynomial-time approximation scheme. Approximation ratio 1+² for any ² > 0, while the algorithm runs in time polynomial in n and 1/². Example: knapsack (scaling). PTAS: Polynomial-time approximation scheme. Approximation ratio 1+² for any ² > 0, while the algorithm runs in polynomial time for any fixed ². Example: maximum independent set on planar graphs.

APX Approximation algorithms - Algorithms and Networks Qualities of poly-time approximation algorithms: Absolute constant difference. FPTAS: Fully polynomial-time approximation scheme. PTAS: Polynomial-time approximation scheme. APX: Constant-factor approximation. f(n)-APX: Approximation by a factor of f(n). Approximation algorithms - Algorithms and Networks APX

APX: constant factor approximation APX: class of problems for which approximation algorithms exists with a constant approximation ratio. This is different from the PTAS / FPTAS setting where we can get arbitrarily good approximations. Problems with an (F)PTAS are in APX. We have seen enough examples of this last week. 2-approximation for Max Satisfiability (and Max k-SAT) 1.5- and 2-approximations for TSP. 2-approximations for vertex cover and weighted vertex cover. Negative examples, after first considering the last class of approximation algorithms.

F(n)-APX Approximation algorithms - Algorithms and Networks Qualities of poly-time approximation algorithms: Absolute constant difference. FPTAS: Fully polynomial-time approximation scheme. PTAS: Polynomial-time approximation scheme. APX: Constant-factor approximation. f(n)-APX: Approximation by a factor of f(n). Approximation algorithms - Algorithms and Networks F(n)-APX

Approximation by a factor of f(n) Approximation ratio of f(n). Approximation ratio depends on the size of the input (and can be very bad) Set Cover Given: finite set U and a family F of subsets of U. Question: Does there exists a subset C of F of size at most k such that [S2C S = U? Greedy algorithm: While U  ;: Select S 2 F that maximises |S Å U|. Add S to C and let U := U \ S.

An (ln(n)+1)-approximation algorithm for set cover Theorem: The greedy set cover algorithm is an (ln(n)+1)-approximation. Proof: The algorithm runs in polynomial time and returns a set cover. Let Si be the ith set from F picked by the algorithm. We assign cost cx to elements from U: Let x be firstly covered by set Si while running the algorithm. And, let Xi = Si \ (S1 [ S2 [ ... [ Si-1) Define: cx = 1 / |Xi|. Now we have: ... Write main points on blackboard!

Proof of the (ln(n)+1)-approximation algorithm for set cover The nth Harmonic number H(n) is defined as: From mathematics (bounding using integrals): On the blackboard, we will prove that for any S 2 F: From this we derive our approximation ratio: Where C* is the optimal set cover.

Conclusion approx. algorithms Approximation algorithms - Algorithms and Networks Conclusion approx. algorithms

Conclusion Qualities of polynomial-time approximation algorithms: Absolute constant difference. Planar graph colouring. FPTAS: Fully polynomial-time approximation scheme. Scaling for Knapsack. PTAS: Polynomial-time approximation scheme. APX: Constant-factor approximation. TSP with triangle inequality. (Weighted) vertex cover. f(n)-APX: Approximation by a factor of f(n). Set cover.

Introduction to Approximation Complexity Algorithms and Networks 2017/2018 Johan M. M. van Rooij Hans L. Bodlaender This is not a break signal!! TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA

Approximation complexity We know how to prove that a problem can be solved in polynomial time. Give a polynomial-time algorithm and prove correctness. We also know how to prove that a problem ‘most likely’ cannot be solved in polynomial time. Prove NP-hardness: give a polynomial-time reduction from a known NP-compete / NP-hard problem. NP-complete: in NP and NP-hard. How does this work for approximation algorithms? Positive results: give algorithm and prove that it is the appropriate type of approximation algorithm. Negative results?? Well... we have seen some of them already.

How to prove that an algorithm from one of the categories does not exist? Qualities of polynomial-time approximation algorithms: Absolute constant difference. FPTAS: Fully polynomial-time approximation scheme. PTAS: Polynomial-time approximation scheme. APX: Constant-factor approximation. f(n)-APX: Approximation by a factor of f(n). We have already proved that ‘most likely’: Absolute constant difference approximation is not possible for maximum independent set. There is no FPTAS for maximum independent set. But can we do more?

How to prove that an algorithm from one of the categories does not exist? We have already proved that ‘most likely’: Absolute constant difference approximation is not possible for maximum independent set. There is no FPTAS for maximum independent set. But can we do more? We will briefly review: The gap technique. The polynomial-bound technique. Both already seen in earlier lectures.

Approximation algorithms - Algorithms and Networks THE GAP TECHNIQUE

The gap technique The gap technique: Example: An NP-hardness proof that creates a (wide) gap between YES-instance and NO-instances. Example: There is no polynomial time algorithm A for TSP without triangle inequality that approximates within a ratio c, for any constant c>1. Reduction: Take instance G=(V,E) of Hamiltonian Circuit. Build instance of TSP: A city for each v 2 V. If (v,w) 2 E, then d(v,w) = 1, otherwise d(v,w) = nc+1. A finds a tour with distance at most nc, if and only if, G has a Hamiltonian circuit.

Using the gap technique The gap technique can (sometimes) be used to prove: Absolute constant difference approximation is not possible. Constant-factor approximation is not possible. PTAS is not possible. We have seen two examples of the gap technique: One to prove non-existence of absolute constant difference approximation of independent set (second lecture) One to prove non-existence of constant-factor approximation of TSP without triangle inequality.

Another example: knapsack We know there exists an FPTAS for knapsack. If we can rule out an absolute constant difference approximation, then we know how difficult knapsack is from the viewpoint of approximation. Knapsack: Given: n items each with a positive integer weight w(i) and integer value v(i) (1 ≤ i ≤ n), and an integer W. Question: select items with total weight at most W such that the total value is as large as possible.

Another example: knapsack We know there exists an FPTAS for knapsack. If we can rule out an absolute constant difference approximation, then we know how difficult knapsack is from the viewpoint of approximation. Suppose there is an absolute constant difference approximation algorithm for knapsack with absolute integer error c¸1: Take an instance of knapsack. Multiply the value of all items by c+1. This does not change the set of feasible solutions. However, the only solution with a difference in value of at most c from the optimal solution, is the optimal solution itself. An absolute constant difference approximation will thus solve this knapsack instance optimally, contradicting the assumption P  NP.

THE polynomial-bound technique Approximation algorithms - Algorithms and Networks THE polynomial-bound technique

The polynomial bound technique Prove that there is no FTPAS by using the a problem has a bound of p(n) on any optimal solution. Example (from earlier lecture): maximum independent set. Use p(n) = n. Suppose that the problem has an FPTAS, then for each fixed e>0, there is some algorithm that: Is a (1+e)-approximation algorithm. Uses polynomial time in the size of X and in 1/e. Let ² = 1/p(n) and run the algorithm. The algorithm uses polynomial time. The algorithm solves the problem optimally as: Hence, no such algorithm exists unless P=NP. OPT * p(n)/(p(n)+1) = OPT – opt/(p(n)+1) by adding +1 and -1 to the numerator of the first fraction.

Approximation Complexity Algorithms and Networks 2017/2018 Johan M. M. van Rooij Hans L. Bodlaender Let op: binnen 10 minuten wil je het over APX-completeness hebben! TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA

How to prove that an algorithm from one of the categories does not exist? Qualities of polynomial-time approximation algorithms: Absolute constant difference. FPTAS: Fully polynomial-time approximation scheme. PTAS: Polynomial-time approximation scheme. APX: Constant-factor approximation. f(n)-APX: Approximation by a factor of f(n). Previous lecture: The gap technique. The polynomial-bound technique.

How to prove that an algorithm from one of the categories does not exist? Qualities of polynomial-time approximation algorithms: Absolute constant difference. FPTAS: Fully polynomial-time approximation scheme. PTAS: Polynomial-time approximation scheme. APX: Constant-factor approximation. f(n)-APX: Approximation by a factor of f(n). This lecture: Proving that no PTAS exists for some problems by proving APX-completeness. Proving that a problem does not belong to APX.

This lecture Recap on NP-completeness. The complexity class APX and APX-completeness. Inapproximability of maximum independent set. Maximum independent set is not in APX. Note: All cases proving that some algorithm ‘most likely’ does not exists are based on the ‘likely’ assumption PNP.

A RECAP ON NP-completeness Approximation algorithms - Algorithms and Networks A RECAP ON NP-completeness

P and NP A decision problem belongs to the class P if: There is an algorithm solving the problem with a running time that is polynomial in the input size. A decision problem belongs to the class NP if: Any solution y (called a certificate) can be encoded in polynomial space with respect to the size of the input x. Checking whether a given certificate y resembles a `yes’-instance can be done in polynomial time with respect to the size of x and y. Clearly P is contained in NP. We can ignore the certificate y. When checking y, just solve x in polynomial time.

Reducibility Definition: Problem P1 is polynomial-time reducible to problem P2 (or: P1 £P P2 ), if there exists a polynomial time computable function f mapping instances I1 of P1 to instances I2 of P2 such that: I1 is a ‘yes’-instance, if and only if, I2 is a ‘yes’-instance. Lemma: If P1 £P P2 then: if P2 Î P, then P1 Î P. Run an algorithm for P2 on f(I) for instance I for problem P1. If P1 £P P2 and P2 £P P3 then: P1 £P P3. Reductions can be composed together.

NP-completeness A problem P is NP-complete if: The problem belongs to NP. All problems in NP are polynomial-time reducible to P. From a viewpoint of polynomial-time computability, NP-complete problems are the hardest problems in NP. If one of them can be solved in polynomial time, all problems in NP can be solved in polynomial time. A problem P is NP-hard if:

Proving that ‘most likely’ no polynomial-time algorithms exist NP-complete/NP-hard problems ‘most likely’ have no polynomial-time algorithms. We often assume PNP. Proving NP-completeness for problem P: Take a known NP-complete problem Q. Show that their exists a polynomial-time reduction from Q to P. This implies that all problems in NP can be reduced to P. Cook-Levin theorem: Satisfiability is NP-complete. This was the ‘first known’ NP-complete problem. Stop here for a moment for questions: does everyone remember this?

APX and APX-completeness Approximation algorithms - Algorithms and Networks APX and APX-completeness

APX and APX-completeness APX: class of problems for which approximation algorithms exists with a constant approximation ratio. Thus, problems with an (F)PTAS are also in APX. APX-completeness: Hardest problems in APX with respect to having a PTAS. If one APX-complete has a PTAS, then all APX-complete problems have a PTAS. Max-3SAT is APX-complete. Consequence of the famous PCP theorem, that we will not discuss further. Corollary: any APX-complete problem has no PTAS unless P=NP. PCP theorem: every decision problem in the NP complexity class has probabilistically checkable proofs (proofs that can be checked by a randomized algorithm with high probability of correctness) of constant query complexity and logarithmic randomness complexity (uses a logarithmic number of random bits).

L-reduction P1 is L-reducible to P2 (P1 £L P2) if there exist: Lemma: a function f mapping instances x of P1 to instances f(x) of P2, a function g mapping solutions of f(x) to solutions of x, two constants a and b such that: f and g are computable in polynomial-time computable. For any instance x of P1: OPT( f(x) ) · a ¢ OPT(x). For any instance x of P1 and any solution y of f(x): |OPT(x) – VAL(g(y))| · b ¢ |OPT(f(x)) – VAL(y)|. Lemma: If P1 £L P2 then: if P2 has a PTAS, then P1 has a PTAS. Run an algorithm for P2 on f(x) for instance x for problem P1. L-Reduction preserves approximation. For a minimisation problem (absolute value symbols exist to work for both max en min problems): VAL(g(y)) - OPT(x) \leq b ( VAL(y) - OPT(f(x)) ) [by def part 3] \leq b ( (1+epsilon) OPT f(x) - OPT(f(x)) ) [by def (1+epsilon)-approx of PTAS] \leq b epsilon OPT f(x) [simplify] \leq b epsilon a OPT(x) [by def part 2] Thus a (1 + b epsilon a)-approximation

L-reduction P1 is L-reducible to P2 (P1 £L P2) if there exist: Lemma: a function f mapping instances x of P1 to instances f(x) of P2, a function g mapping solutions of f(x) to solutions of x, two constants a and b such that: f and g are computable in polynomial-time computable. For any instance x of P1: OPT( f(x) ) · a ¢ OPT(x). For any instance x of P1 and any solution y of f(x): |OPT(x) – VAL(g(y))| · b ¢ |OPT(f(x)) – VAL(y)|. Lemma: If P1 £L P2 and P2 £L P3 then: P1 £L P3. Reductions can be composed together. Copy to blackboard

Proving APX-completeness Proving APX-completeness of problem P: Give a c-approximation (prove that P is in APX). Give an L-reduction from an APX-complete problem to P. Proving APX-hardness of problem P: Give an L-reduction from an APX-hard problem to P. Similar to NP-completeness. PNP implies PTAS  APX.

NP-completeness and APX-completeness NP-complete: if one problem is polynomial-time solvable, then all are. Polynomial-time reductions. Cook’s theorem: SAT is NP-complete. APX-complete: if one problem has a PTAS, then all have. L-reductions. PCP theorem implies Max 3-SAT is APX-complete.

Example L-reduction Theorem: Max 3-SAT £L Max 2-SAT. Proof: Transformation f: replace any clause (x,y,z) by: (x), (y), (z), (v), (:x,:y), (:x,:z), (:y,:z), (x,:v), (y,:v), (z, :v). Here v is a new variable (each clause gets a different one). Transformation g: restrict the truth assignment to the original variables. a=13, b=1. To prove: For any instance I of P1: OPT( f(I) ) · a ¢ OPT(I). For any instance x of P1 and any solution y of f(x): |OPT(x) – VAL(g(y))| · b ¢ |OPT(f(x)) – VAL(y)|. Truth table on blackbord: (x,y,z) all false -> new clauses 6 true, otherwise new clauses 7 true.

APX-completeness of Max 2-SAT Corollary: Max 2-SAT is APX-complete. APX-hard by the L-reduction from Max 3-SAT. There is a 2-approximation for MaxSat that we have seen in an earlier lecture. Hence, there also is a 2-approximation for Max 2-SAT, i.e., Max 2-SAT is in APX.

INAPPROXIMABILITY OF MAX INDEPENDENT SET Approximation algorithms - Algorithms and Networks INAPPROXIMABILITY OF MAX INDEPENDENT SET

Inapproximability of maximum independent set We have seen that max independent set does not allow absolute constant difference approximation, nor an FPTAS. Next, we show that there also is no PTAS, by proving APX-hardness. L-reduction from Max 2-SAT: No, we will not prove APX-completeness. Max independent set also not in APX as we will conclude thereafter.

L-reduction from max 2-SAT to maximum independent set L-Reduction: Max 2-SAT £L Maximum Independent Set. Transformation f: Replace any clause (x,y) by two vertices x and y connected by an edge. For all variables x: connect all pairs (x,:x) by an edge. Transformation g: Set x to true if any x vertex in the solution, to false if any :x vertex in the solution. Choose arbitrarily otherwise. a=1, b=1. To prove: For any instance I of P1: OPT( f(I) ) · a ¢ OPT(I). For any instance x of P1 and any solution y of f(x): |OPT(x) – VAL(g(y))| · b ¢ |OPT(f(x)) – VAL(y)|. Op blackbord voorbeeld geven.

No PTAS for maximum independent set Corollary: There is no approximation algorithm for maximum independent set that, for each fixed e>0: Is an (1+e)-approximation algorithm. Uses polynomial time. Next step is to prove that we cannot find a c-approximation for maximum independent set. We will use a self reduction.

Self reduction for maximum independent set Lemma: If independent set can be approximated with approximation ratio c, then it can be approximated with ratio √c. Proof: Given a graph G, we construct G x G: It has nodes (u,v) corresponding to tuples of vertices from G. It has edge (u,v)-(u’,v’) iff: u = u’, and (v,v’) an edge in G. (u,u’) an edge in G. Claim G has an independent set of size k, if and only if, G x G has an independent set of size k2. Run the c-approximation on G x G with result J: The result in G x G has OPT2 · c |J|. Thus in G: √OPT · √c √|J| Example again on the blackboard.

No PTAS for maximum independent set If independent set can be approximated with approximation ratio c, then it can be approximated with ratio √c. Corollary: If independent set can be approximated with approximation ratio c, then it can be approximated with ratio 1 + ² (it has a PTAS). For fixed ², we can repeat the square root trick often enough (but a fixed number of times) until the ratio is good enough. Maximum independent set is not in APX. It has no PTAS assuming PNP, hence also no c-approximation.

Concluding remarks on independent set Maximum independent set is in f(n)-APX, where: Things can be even worse: TSP without triangle inequality cannot be approximated by any polynomial-time approximation algorithm with an approximation ratio p(n) for any polynomial p(n) unless P=NP.

Approximation algorithms - Algorithms and Networks CONCLUSION

Conclusion on approximation Qualities of polynomial-time approximation algorithms: Absolute constant difference. FPTAS: Fully polynomial-time approximation scheme. PTAS: Polynomial-time approximation scheme. APX: Constant-factor approximation. f(n)-APX: Approximation by a factor of f(n). Proving that a quality of approximation algorithm ‘most likely’ does not exist: Gap technique. Polynomial-bound technique. APX-completeness / APX-hardness. Self reduction.