ABHELSINKI UNIVERSITY OF TECHNOLOGY

Similar documents
July 18, Approximation Algorithms (Travelling Salesman Problem)

Decision Problems TSP. Instance: A complete graph G with non-negative edge costs, and an integer

Algorithms Design & Analysis. Approximation Algorithm

NP-Complete Problems and Approximation Algorithms

Tractable & Intractable Problems

Traveling Salesman. Given G = (V,V V), find simple cycle C = (v 1,v 2,...,v n,v 1 ) such that n = V and (u,v) C d(u,v) is minimized.

A New Approximation Algorithm for the Asymmetric TSP with Triangle Inequality By Markus Bläser

NP-Completeness. Until now we have been designing algorithms for specific problems

Data Structures and Algorithms (CSCI 340)

Lecture 6 January 21, 2013

Approximation Algorithms for Asymmetric TSP by Decomposing Directed Regular Multigraphs

Data Structures in Java

Bounds on the Traveling Salesman Problem

NP-Completeness. Andreas Klappenecker. [based on slides by Prof. Welch]

CS/COE

2 Notation and Preliminaries

Network Design and Game Theory Spring 2008 Lecture 2

Graduate Algorithms CS F-21 NP & Approximation Algorithms

The minimum G c cut problem

Easy Problems vs. Hard Problems. CSE 421 Introduction to Algorithms Winter Is P a good definition of efficient? The class P

More Approximation Algorithms

ACO Comprehensive Exam October 14 and 15, 2013

Topic: Intro, Vertex Cover, TSP, Steiner Tree Date: 1/23/2007

Hamiltonian Graphs Graphs

Dominating Set. Chapter 7

Approximation Algorithms for Re-optimization

CS 320, Fall Dr. Geri Georg, Instructor 320 NP 1

A simple LP relaxation for the Asymmetric Traveling Salesman Problem

NP Completeness and Approximation Algorithms

VIII. NP-completeness

Scheduling and Optimization Course (MPRI)

Approximability of Connected Factors

Algorithms: COMP3121/3821/9101/9801

Approximating the minimum quadratic assignment problems

NP-Completeness. CptS 223 Advanced Data Structures. Larry Holder School of Electrical Engineering and Computer Science Washington State University

Traveling Salesman Problem

P versus NP. Math 40210, Fall November 10, Math (Fall 2015) P versus NP November 10, / 9

Chapter 11. Approximation Algorithms. Slides by Kevin Wayne Pearson-Addison Wesley. All rights reserved.

On the Role of Partition Inequalities in Classical Algorithms for Steiner Problems in Graphs

Algorithms and Theory of Computation. Lecture 22: NP-Completeness (2)

Dual fitting approximation for Set Cover, and Primal Dual approximation for Set Cover

Chapter 11. Approximation Algorithms. Slides by Kevin Wayne Pearson-Addison Wesley. All rights reserved.

NP-Completeness. ch34 Hewett. Problem. Tractable Intractable Non-computable computationally infeasible super poly-time alg. sol. E.g.

CS675: Convex and Combinatorial Optimization Fall 2016 Combinatorial Problems as Linear and Convex Programs. Instructor: Shaddin Dughmi

P versus NP. Math 40210, Spring April 8, Math (Spring 2012) P versus NP April 8, / 9

Today s Outline. CS 362, Lecture 24. The Reduction. Hamiltonian Cycle. Reduction Wrapup Approximation algorithms for NP-Hard Problems

ECS122A Handout on NP-Completeness March 12, 2018

Limits to Approximability: When Algorithms Won't Help You. Note: Contents of today s lecture won t be on the exam

Approximation Algorithms

Contents Lecture 4. Greedy graph algorithms Dijkstra s algorithm Prim s algorithm Kruskal s algorithm Union-find data structure with path compression

The traveling salesman problem

A Randomized Rounding Approach to the Traveling Salesman Problem

NP Complete Problems. COMP 215 Lecture 20

P versus NP. Math 40210, Spring September 16, Math (Spring 2012) P versus NP September 16, / 9

NP-completeness. Chapter 34. Sergey Bereg

Improving Christofides Algorithm for the s-t Path TSP

from notes written mostly by Dr. Matt Stallmann: All Rights Reserved

Approximation Algorithms and Hardness of Approximation. IPM, Jan Mohammad R. Salavatipour Department of Computing Science University of Alberta

SAT, Coloring, Hamiltonian Cycle, TSP

ON TESTING HAMILTONICITY OF GRAPHS. Alexander Barvinok. July 15, 2014

Recent Progress in Approximation Algorithms for the Traveling Salesman Problem

Notes on MapReduce Algorithms

CS675: Convex and Combinatorial Optimization Fall 2014 Combinatorial Problems as Linear Programs. Instructor: Shaddin Dughmi

ON COST MATRICES WITH TWO AND THREE DISTINCT VALUES OF HAMILTONIAN PATHS AND CYCLES

K-center Hardness and Max-Coverage (Greedy)

Exercises NP-completeness

Outline. 1 NP-Completeness Theory. 2 Limitation of Computation. 3 Examples. 4 Decision Problems. 5 Verification Algorithm

Week Cuts, Branch & Bound, and Lagrangean Relaxation

Algorithms and Theory of Computation. Lecture 19: Class P and NP, Reduction

Polynomial-time Reductions

Dominating Set. Chapter 26

Dominating Set. Chapter Sequential Greedy Algorithm 294 CHAPTER 26. DOMINATING SET

Network Design and Game Theory Spring 2008 Lecture 6

Unit 1A: Computational Complexity

Balancing Minimum Spanning Trees and Multiple-Source Minimum Routing Cost Spanning Trees on Metric Graphs

NP-Complete Problems. More reductions

9.1 HW (3+3+8 points) (Knapsack decision problem NP-complete)

The P versus NP Problem. Ker-I Ko. Stony Brook, New York

Research Collection. Grid exploration. Master Thesis. ETH Library. Author(s): Wernli, Dino. Publication Date: 2012

8.5 Sequencing Problems

APPROXIMATION ALGORITHMS RESOLUTION OF SELECTED PROBLEMS 1

8.3 Hamiltonian Paths and Circuits

Quantum Algorithms for Graph Traversals and Related Problems

Geometric Steiner Trees

Practice Final Solutions. 1. Consider the following algorithm. Assume that n 1. line code 1 alg(n) { 2 j = 0 3 if (n = 0) { 4 return j

Algorithm Design Strategies V

CS 301: Complexity of Algorithms (Term I 2008) Alex Tiskin Harald Räcke. Hamiltonian Cycle. 8.5 Sequencing Problems. Directed Hamiltonian Cycle

Algorithms, Lecture 3 on NP : Nondeterminis7c Polynomial Time

FINAL EXAM PRACTICE PROBLEMS CMSC 451 (Spring 2016)

Lecture 4: NP and computational intractability

More on NP and Reductions

Branch-and-Bound for the Travelling Salesman Problem

Algorithms. Outline! Approximation Algorithms. The class APX. The intelligence behind the hardware. ! Based on

NP-complete problems. CSE 101: Design and Analysis of Algorithms Lecture 20

NP and Computational Intractability

15.083J/6.859J Integer Optimization. Lecture 2: Efficient Algorithms and Computational Complexity

Computability and Complexity Theory

Check off these skills when you feel that you have mastered them. Write in your own words the definition of a Hamiltonian circuit.

Lecturer: Shuchi Chawla Topic: Inapproximability Date: 4/27/2007

CS 583: Algorithms. NP Completeness Ch 34. Intractability

Transcription:

Approximation Algorithms Seminar 1 Set Cover, Steiner Tree and TSP Siert Wieringa siert.wieringa@tkk.fi Approximation Algorithms Seminar 1 1/27

Contents Approximation algorithms for: Set Cover Steiner Tree TSP Approximation Algorithms Seminar 1 2/27

Set Cover Given: A universe U of n elements. A collection of subsets of U, S = {S 1,...,S k }. A cost function c : S Q +. Find a minimum cost subcollection of S that covers all elements of U. Approximation Algorithms Seminar 1 3/27

Set Cover - Example U = {1,2,3,4,5} S = {S 1,S 2,S 3 } S 1 = {4,1,3} S 2 = {2,5} S 3 = {1,4,3,2} c : S Q + c(s 1 ) = 5 c(s 2 ) = 10 c(s 3 ) = 3 Approximation Algorithms Seminar 1 4/27

Set Cover - Example U = {1,2,3,4,5} S = {S 1,S 2,S 3 } S 1 = {4,1,3} S 2 = {2,5} S 3 = {1,4,3,2} S 1 S 2 U S 2 S 3 U c : S Q + c(s 1 ) = 5 c(s 2 ) = 10 c(s 3 ) = 3 Approximation Algorithms Seminar 1 4/27

Set Cover - Example U = {1,2,3,4,5} S 1 S 2 U S 2 S 3 U S = {S 1,S 2,S 3 } S 1 = {4,1,3} c(s 1 )+c(s 2 ) = 15 S 2 = {2,5} c(s 2 )+c(s 3 ) = 13 S 3 = {1,4,3,2} c : S Q + c(s 1 ) = 5 c(s 2 ) = 10 c(s 3 ) = 3 Approximation Algorithms Seminar 1 4/27

Set Cover - Example U = {1,2,3,4,5} S 1 S 2 U S 2 S 3 U S = {S 1,S 2,S 3 } S 1 = {4,1,3} c(s 1 )+c(s 2 ) = 15 S 2 = {2,5} c(s 2 )+c(s 3 ) = 13 S 3 = {1,4,3,2} So S 2 S 3 is a set c : S Q + c(s 1 ) = 5 c(s 2 ) = 10 c(s 3 ) = 3 cover for U Approximation Algorithms Seminar 1 4/27

Set Cover - Greedy algorithm 1/4 cost(s) S C is the cost-effectiveness of a set S. 1 C /0 2 While C U do Find the set S with the highest α = cost(s) S C For all e S C, set price(e) = α. C C S. 3 Output the picked sets. Number the elements e of U in the order in which they where covered, e 1,...,e k. Approximation Algorithms Seminar 1 5/27

Set Cover - Greedy algorithm 2/4 Lemma 2.3 For each k {1,...,n}, price(e k ) OPT n k+1. Proof In every iteration the leftover sets of the optimal solution can cover the remaining elements at a cost of at most OPT. Therefore, amongst those sets there must be an element with cost at most OPT C with C the set of uncovered elements. C contains at least n k+ 1 elements. price(e k ) OPT C OPT n k+ 1 Approximation Algorithms Seminar 1 6/27

Set Cover - Greedy algorithm 3/4 Theorem 2.4 The greedy algorithm is an H n factor approximation algorithm for the minimum set cover problem, where H n = 1+ 1 2 + + 1 n. Proof The total cost is equal to n k=1 price(e k). By Lemma 2.3, this is at most (1+ 1 2 + + 1 n ) OPT. Approximation Algorithms Seminar 1 7/27

Set Cover - Greedy algorithm 4/4 books.google.com (first 20 pages) Approximation Algorithms Seminar 1 8/27

Vertex Cover The vertex cover problem is a special case of set cover with the highest element occurence frequency f = 2. For vertex cover there is a factor 2 approximation. Set cover approximation algorithms, either factor O(log n) or f. Approximation Algorithms Seminar 1 9/27

Vertex Cover as Set Cover Consider a graph G = (V,E) with: V = { V 1, V 2, V 3 } E = { (1,2), (2,3), (1,3) } We might define each vertex by the set of edges connected to it. Now we have a set cover problem with: U = { (1,2), (2,3), (1,3) } S = { { (1,2), (1,3) }, { (1,2), (2,3) }, { (2,3), (1,3) } } Approximation Algorithms Seminar 1 10/27

Set Cover - Layering algorithm Factor f approximation algorithm for set cover. Let w : V Q + be the function assigning weights to the vertices of a graph G = (V,E). A weight function is degree-weighted if there is a constant c > 0 such that the weight of each vertex v V is c deg(v). Approximation Algorithms Seminar 1 11/27

Set Cover - Layering algorithm Lemma 2.6 Let w : V Q + be a degree-weighted function. Then the cost of selecting all vertices w(v) 2 OPT. Proof Let c be the constant such that w(v) = c deg(v), and let U be an optimal vertex cover in G. v U deg(v) E w(u) c E The sum of the degree of all vertices of a graph is 2 E so w(v) = 2c E 2 OPT. Approximation Algorithms Seminar 1 12/27

Vertex Cover - Layering algorithm 1 G 0 = G, k = 0 2 while G k = (V,E) has vertices v V with deg(v) > 0 ( ) 3 c = min w(v) over all v V with deg(v) > 0 deg(v) 4 D k = { v v V and deg(v) = 0 } 5 W k = { v v V and w(v) = c deg(v) } 6 G k+1 = the graph induced on V (D k W k ) 7 k = k+ 1 8 return C = W 0 W k 1 Approximation Algorithms Seminar 1 13/27

Vertex Cover - Layering algorithm 1 G 0 = G, k = 0 2 while G k = (V,E) has vertices v V with deg(v) > 0 ( ) 3 c = min w(v) over all v V with deg(v) > 0 deg(v) 4 D k = { v v V and deg(v) = 0 } 5 W k = { v v V and w(v) = c deg(v) } 6a V k+1 = V (D k W k ) 6b E k+1 = E { (i, j) i (D k W k ) or j (D k W k ) } 6c G k+1 = (V k+1,e k+1 ) 7 k = k+ 1 8 return C = W 0 W k 1 Approximation Algorithms Seminar 1 13/27

Vertex Cover - Layering algorithm 1 G 0 = G, k = 0 2 while G k = (V,E) has vertices v V with deg(v) > 0 ( ) 3 c = min w(v) over all v V with deg(v) > 0 t k (v) = c deg(v) deg(v) 4 D k = { v v V and deg(v) = 0 } 5 W k = { v v V and w(v) = c deg(v) } 6a V k+1 = V (D k W k ) 6b E k+1 = E { (i, j) i (D k W k ) or j (D k W k ) } 6c G k+1 = (V k+1,e k+1 ) 7 k = k+ 1 8 return C = W 0 W k 1 Approximation Algorithms Seminar 1 13/27

Layering algorithm - Proof? Consider a vertex v C. If v W j, its weight can be decomposed as: w(v) = t i (v)???? i j Approximation Algorithms Seminar 1 14/27

Set Cover - Layering algorithm 1 U 0 = U, S 0 = S, k = 0 2 while S k has elements s with s > 0 ( ) 3 c = min w(s) over all s S k with s > 0 s 4 D k = { s s S k and s = 0 } 5 W k = { s s S k and w(s) = c s } 6a U k+1 = U (D k W k ) 6b S k+1 = { s s S k, s = s (D k W k ) } 7 k = k+ 1 8 return C = W 0 W k 1 Approximation Algorithms Seminar 1 15/27

Steiner Tree Given: An undirected graph G = (V,E) with nonnegative edge cost. A partitioning of the vertices V into required, and Steiner edges. Find a minimum cost tree in G that contains all the required vertices and any subset of Steiner vertices. Approximation Algorithms Seminar 1 16/27

Metric Steiner Tree A restriction of the Steiner Tree problem to those graphs that satisfy the triangle inequality. That is, G has to be a complete undirected graph, and for any three vertices u, v and w, cost(u,v) cost(u,w)+cost(v,w). Theorem 3.2 There is an approximation factor preserving reduction from the Steiner tree problem to the metric Steiner tree problem. Approximation Algorithms Seminar 1 17/27

Metric Steiner Tree MST Theorem 3.3 The cost of a Minimal Spanning Tree on the required vertices is within 2 OPT. Approximation Algorithms Seminar 1 18/27

Traveling salesman problem (TSP) Given a complete graph with nonnegative edge costs, find a minimum cost cycle visiting evey vertex exactly once. Theorem 3.6 For any polynomial computable function α(n), TSP can not be approximated within a factor of α(n), unless P = NP. Approximation Algorithms Seminar 1 19/27

Traveling salesman problem (TSP) Proof Using a polynomial factor α(n) approximation algorithm for TSP we can decide the Hamiltonian cycle problem which is NP-Hard in polynomial time. The existence of such an algorithm would therefore imply that P = NP. (continued) Approximation Algorithms Seminar 1 20/27

Traveling salesman problem (TSP) Reduction of Hamiltonian Cycle to polynomial factor approximation of TSP. Assign a weight of 1 to edges of G. Extend G to the complete graph G and give all added "nonedges" weight α(n) n. If G has a Hamiltonian cycle, then the corresponding tour in G has cost n. If G has no Hamiltonian cycle, any tour in G must use an edge of cost α(n) n and it therefore has cost > α(n) n. Approximation Algorithms Seminar 1 21/27

Metric TSP - Factor 2 approx. The proof on the previous slide used edge weights that did not satisfy the triangle inequality. Metric TSP is also NP-Complete, but not hard to approximate. Cost of a MST is OPT. Factor 2 approximation algorithm by using similar approach as in proof of Steiner Tree algorithm approximation factor. Approximation Algorithms Seminar 1 22/27

Metric TSP - Factor 3 2 approx. For Eulerian path to exists all vertices must have even number of edges. Can be forced by doubling edges, smarter approach only concerns vertices with odd degree, V. 1 Add maximum matching of V to the graph. 2 Find Euler tour in this graph. 3 Output "short-cutted" Euler tour. Note: V must be even since sum of the degree of all vertices is even (2 E ). Approximation Algorithms Seminar 1 23/27

Metric TSP - Factor 3 2 approx. Lemma 3.11 Let V V, such that V is even, and let M be a minimum cost perfect matching on V. Then, cost(m) OPT 2 Proof Consider an optimal TSP tour τ of G. Let τ be the tour on V obtained by short-cutting τ. By the triangle inequality, cost(τ ) cost(τ). The tour τ can be seen as the union of two perfect matchings on V. The cheapest of those two matchings has cost cost(τ ) 2 OPT 2. So, the optimal matching must also be of cost OPT 2. Approximation Algorithms Seminar 1 24/27

Metric TSP - Factor 3 2 approx. Lemma 3.12 The presented algorithm achieves an approximation guarantee of 3 2 for metric TSP. Proof The cost of the Euler tour is OPT. By the cost(t)+cost(m) OPT + 2 1OPT = 3 2 triangle inequality the cost of the path is also smaller than 3 2 OPT. Approximation Algorithms Seminar 1 25/27

Summary We have: Seen approximation algorithms for a number of problems. Studied the approximation factors of those algorithms. Seen tight examples for the algorithms. Approximation Algorithms Seminar 1 26/27

Questions? Approximation Algorithms Seminar 1 27/27