Approximation Algorithms Using ILP
Total Page:16
File Type:pdf, Size:1020Kb
Introduction Approximation Algorithm Integer Linear Programming Vertex cover problem Set cover problem Rectangle Stabbing Problem Uncapacited Facility Location Approximation Algorithms using ILP Subhas C. Nandy ([email protected]) Advanced Computing and Microelectronics Unit Indian Statistical Institute Kolkata 700108, India. Introduction Approximation Algorithm Integer Linear Programming Vertex cover problem Set cover problem Rectangle Stabbing Problem Uncapacited Facility Location Organization 1 Introduction 2 Approximation Algorithm 3 Integer Linear Programming 4 Vertex cover problem 5 Set cover problem 6 Rectangle Stabbing Problem 7 Uncapacited Facility Location Complexity Classes P: A decision problem that can be solved in polynomial time. NP: A decision problem that, for an input, can be verified in polynomial time. Introduction Approximation Algorithm Integer Linear Programming Vertex cover problem Set cover problem Rectangle Stabbing Problem Uncapacited Facility Location Introduction A problem is said to be tractable if there exists an algorithm for that problem whose worst case time complexity is a polynomial function in n (the input size). Otherwise, the problem is said to be intractable. Introduction Approximation Algorithm Integer Linear Programming Vertex cover problem Set cover problem Rectangle Stabbing Problem Uncapacited Facility Location Introduction A problem is said to be tractable if there exists an algorithm for that problem whose worst case time complexity is a polynomial function in n (the input size). Otherwise, the problem is said to be intractable. Complexity Classes P: A decision problem that can be solved in polynomial time. NP: A decision problem that, for an input, can be verified in polynomial time. Introduction Approximation Algorithm Integer Linear Programming Vertex cover problem Set cover problem Rectangle Stabbing Problem Uncapacited Facility Location NP-Completeness An important question Whether P = NP or P 6= NP ? NP-Complete Class: A class of decision problems in NP such that if one of them can be solved in polynomial time, all other problems can also be solved in polynomial time. NP NPC P Introduction Approximation Algorithm Integer Linear Programming Vertex cover problem Set cover problem Rectangle Stabbing Problem Uncapacited Facility Location NP-Complete Problems Circuit satisfiability, 3-SAT (satisfiability where the expression is in CNF, and each clause is of length at most 3), Clique decision problem, Vertex Cover decision, Travelling salesman problem, Knapsack problem, Bin packing Art gallery problem to name only a few. Heuristic Develop an intuitive algorithm, such that it guarantees to run in polynomial time, but no guarantee on the quality of the solution. Introduction Approximation Algorithm Integer Linear Programming Vertex cover problem Set cover problem Rectangle Stabbing Problem Uncapacited Facility Location Handling the NP-Hard Problems Brute-force algorithm Design a clever enumeration strategy, so that it guarantees the optimality of the solution, but no guarantee on the running time. Introduction Approximation Algorithm Integer Linear Programming Vertex cover problem Set cover problem Rectangle Stabbing Problem Uncapacited Facility Location Handling the NP-Hard Problems Brute-force algorithm Design a clever enumeration strategy, so that it guarantees the optimality of the solution, but no guarantee on the running time. Heuristic Develop an intuitive algorithm, such that it guarantees to run in polynomial time, but no guarantee on the quality of the solution. But, what is a high quality solution? Is the solution = OPT + α, or α × OPT , or (1 + ) × OPT where, OPT ! the optimum solution, α ! a constant, ! a very small constant. Introduction Approximation Algorithm Integer Linear Programming Vertex cover problem Set cover problem Rectangle Stabbing Problem Uncapacited Facility Location Approximation Algorithm Approximation Algorithm Guaranteed to run in polynomial time, and guaranteed to produce a "high quality" solution. Is the solution = OPT + α, or α × OPT , or (1 + ) × OPT where, OPT ! the optimum solution, α ! a constant, ! a very small constant. Introduction Approximation Algorithm Integer Linear Programming Vertex cover problem Set cover problem Rectangle Stabbing Problem Uncapacited Facility Location Approximation Algorithm Approximation Algorithm Guaranteed to run in polynomial time, and guaranteed to produce a "high quality" solution. But, what is a high quality solution? Introduction Approximation Algorithm Integer Linear Programming Vertex cover problem Set cover problem Rectangle Stabbing Problem Uncapacited Facility Location Approximation Algorithm Approximation Algorithm Guaranteed to run in polynomial time, and guaranteed to produce a "high quality" solution. But, what is a high quality solution? Is the solution = OPT + α, or α × OPT , or (1 + ) × OPT where, OPT ! the optimum solution, α ! a constant, ! a very small constant. Difficulty: One needs to prove that the solution is close to optimum, without knowing the optimum solution. Introduction Approximation Algorithm Integer Linear Programming Vertex cover problem Set cover problem Rectangle Stabbing Problem Uncapacited Facility Location Approximation Algorithm Note: Designing approximation algorithm for a problem having polynomial time algorithm is also relevant if the time complexity of the problem is very high. Introduction Approximation Algorithm Integer Linear Programming Vertex cover problem Set cover problem Rectangle Stabbing Problem Uncapacited Facility Location Approximation Algorithm Note: Designing approximation algorithm for a problem having polynomial time algorithm is also relevant if the time complexity of the problem is very high. Difficulty: One needs to prove that the solution is close to optimum, without knowing the optimum solution. Performance ratio: f (n) = A(I )=OPT in case P is a minimization problem OPT =A(I ) in case P is a maximization problem We will show the use of ILP in designing Approximation Algorithms Introduction Approximation Algorithm Integer Linear Programming Vertex cover problem Set cover problem Rectangle Stabbing Problem Uncapacited Facility Location Approximation Algorithm f (n)-approximation Algorithm Let P be a problem of size n. An algorithm A for a problem P is said to be an f (n)-approximation algorithm if and only if for every instance I of P, jA(I ) − OPT j=OPT ≤ f (n). It is assumed that OPT ≥ 0. Note: f (n) can be a constant also. Introduction Approximation Algorithm Integer Linear Programming Vertex cover problem Set cover problem Rectangle Stabbing Problem Uncapacited Facility Location Approximation Algorithm f (n)-approximation Algorithm Let P be a problem of size n. An algorithm A for a problem P is said to be an f (n)-approximation algorithm if and only if for every instance I of P, jA(I ) − OPT j=OPT ≤ f (n). It is assumed that OPT ≥ 0. Note: f (n) can be a constant also. Performance ratio: f (n) = A(I )=OPT in case P is a minimization problem OPT =A(I ) in case P is a maximization problem We will show the use of ILP in designing Approximation Algorithms Introduction Approximation Algorithm Integer Linear Programming Vertex cover problem Set cover problem Rectangle Stabbing Problem Uncapacited Facility Location Integer Linear Programming The Problem Objective Function: Maximize 8x1 + 11x2 + 6x3 + 4x4 Subject to: 5x1 + 7x2 + 4x3 + 3x4 ≤ 14 7x1 + 2x3 + x4 ≤ 10 + xi 2 Z for all i = 1; 2; 3; 4 Introduction Approximation Algorithm Integer Linear Programming Vertex cover problem Set cover problem Rectangle Stabbing Problem Uncapacited Facility Location Vertex Cover Problem Input: G = (V ; E) −! a graph, where each vertex is associated a positive weight. Output: A subset C ⊆ V such that every edge e 2 E is covered by some vertex in C, and w(C) is minimized. ILP Formulation P Minimize: v2V wv xv Subject to: xu + xv ≥ 1 for each edge e = (u; v) 2 E xv 2 f0; 1g for all v 2 V LP Relaxation P Minimize: v2V wv xv Subject to: xu + xv ≥ 1 for each edge e = (u; v) 2 E 0 ≤ xv ≤ 1 for all v 2 V This LP can be solved in polynomial time Let the optimum solution be OPTf Introduction Approximation Algorithm Integer Linear Programming Vertex cover problem Set cover problem Rectangle Stabbing Problem Uncapacited Facility Location Vertex Cover Problem Finally, round the fractional solution x to an integer solution 1 x∗ : C = fvjx ≥ g v 2 Observation 1 C is a feasible solution of the vertex cover problem. Follows from the fact: every edge e = (u; v) satisfies xu + xv ≥ 1 Observation 2 w(C) ≤ 2OPTf ≤ 2OPT P w(C) = v2C w(v) P = v2V jx ≥1=2 w(v) P v ≤ 2 × v2V jx ≥1=2 w(v)x(v) P v ≤ 2 × v2V w(v)x(v) = 2OPTf ≤ 2OPT . Introduction Approximation Algorithm Integer Linear Programming Vertex cover problem Set cover problem Rectangle Stabbing Problem Uncapacited Facility Location Integrality Gap Given a set of instances I of the problem P The integrality gap is defined by OPT (I ) OPT (I ) supI 2I for minimization problem, and infI 2I for OPTf (I ) OPTf (I ) maximization problem. Note: We can not get an approximation factor better than the integrality gap. Introduction Approximation Algorithm Integer Linear Programming Vertex cover problem Set cover problem Rectangle Stabbing Problem Uncapacited Facility Location Integrality Gap 2 Vertex cover problem has integrality gap 2 − n Let G be a complete graph with n vertices n OPTf = 2 However, the optimum solution of the vertex cover problem is n − 1 n−1 Thus, the Integrality Gap is n=2 =2 − frac2n Our approximation bound is Tight Consider