An introduction to Approximation Algorithms Presented By Iman Sadeghi.

Slides:



Advertisements
Similar presentations
Instructor Neelima Gupta Table of Contents Approximation Algorithms.
Advertisements

Approximation Algorithms
Design and Analysis of Algorithms Approximation algorithms for NP-complete problems Haidong Xue Summer 2012, at GSU.
Theory of Computing Lecture 18 MAS 714 Hartmut Klauck.
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.
What is Intractable? Some problems seem too hard to solve efficiently. Question 1: Does an efficient algorithm exist?  An O(a ) algorithm, where a > 1,
1 Approximation Algorithm Instructor: YE, Deshi
1 ©D.Moshkovitz Complexity The Traveling Salesman Problem.
1 The TSP : Approximation and Hardness of Approximation All exact science is dominated by the idea of approximation. -- Bertrand Russell ( )
End Topics Approximate Vertex Cover Approximate TSP Tour Computation of FFT P, NP, NP Complete, NP hard.
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
Complexity ©D Moshkovitz 1 Approximation Algorithms Is Close Enough Good Enough?
Combinatorial Algorithms
Lecture 21 Approximation Algorithms Introduction.
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
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 Lecture for CS 302. What is a NP problem? Given an instance of the problem, V, and a ‘certificate’, C, we can verify V is in.
1 Approximation Algorithms CSC401 – Analysis of Algorithms Lecture Notes 18 Approximation Algorithms Objectives: Typical NP-complete problems Approximation.
The Theory of NP-Completeness
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Spring, 2006 Lecture 7 Monday, 4/3/06 Approximation Algorithms.
CS3381 Des & Anal of Alg ( SemA) City Univ of HK / Dept of CS / Helena Wong 8. Approximation Alg Approximation.
Vertex cover problem S  V such that for every {u,v}  E u  S or v  S (or both)
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Spring, 2009 Lecture 7 Tuesday, 4/7/09 Approximation Algorithms.
Approximation Algorithms Motivation and Definitions TSP Vertex Cover Scheduling.
Approximation Algorithms
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
1 Approximation Algorithms. 2 Motivation By now we’ve seen many NP-Complete problems. We conjecture none of them has polynomial time algorithm.
Programming & Data Structures
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
Chapter 12 Coping with the Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
1 The TSP : NP-Completeness Approximation and Hardness of Approximation All exact science is dominated by the idea of approximation. -- Bertrand Russell.
1 Approximation Algorithm Instructor: yedeshi
APPROXIMATION ALGORITHMS VERTEX COVER – MAX CUT PROBLEMS
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
Chapter 15 Approximation Algorithm Introduction Basic Definition Difference Bounds Relative Performance Bounds Polynomial approximation Schemes Fully Polynomial.
TECH Computer Science NP-Complete Problems Problems  Abstract Problems  Decision Problem, Optimal value, Optimal solution  Encodings  //Data Structure.
Approximation Algorithms
Approximation Algorithms
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 Approximate Algorithms (chap. 35) Motivation: –Many problems are NP-complete, so unlikely find efficient algorithms –Three ways to get around: If input.
CSCI 3160 Design and Analysis of Algorithms Chengyu Lin.
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
Unit 9: Coping with NP-Completeness
WK15. Vertex Cover and Approximation Algorithm By Lin, Jr-Shiun Choi, Jae Sung.
Lecture 25 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
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.
NP Completeness Piyush Kumar. Today Reductions Proving Lower Bounds revisited Decision and Optimization Problems SAT and 3-SAT P Vs NP Dealing with NP-Complete.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
Approximation Algorithms by bounding the OPT Instructor Neelima Gupta
Instructor Neelima Gupta Table of Contents Introduction to Approximation Algorithms Factor 2 approximation algorithm for TSP Factor.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Spring, 2010 Lecture 7 Tuesday, 4/6/10 Approximation Algorithms 1.
TU/e Algorithms (2IL15) – Lecture 11 1 Approximation Algorithms.
The Set-covering Problem Problem statement –given a finite set X and a family F of subsets where every element of X is contained in one of the subsets.
An introduction to Approximation Algorithms Presented By Iman Sadeghi
Approximation Algorithms
Approximate Algorithms (chap. 35)
Hamiltonian Cycle and TSP
Hamiltonian Cycle and TSP
Algorithms for hard problems
Approximation Algorithms
Richard Anderson Lecture 28 Coping with NP-Completeness
Introduction to Algorithms Second Edition by
Lecture 24 Vertex Cover and Hamiltonian Cycle
Presentation transcript:

An introduction to Approximation Algorithms Presented By Iman Sadeghi

Spring 2003Approximation Algorithmes2 Overview Introduction Introduction Performance ratios Performance ratios The vertex-cover problem The vertex-cover problem Traveling salesman problem Traveling salesman problem Set cover problem Set cover problem

Spring 2003Approximation Algorithmes3 Introduction There are many important NP-Complete problems There are many important NP-Complete problems There is no fast solution ! There is no fast solution ! But we want the answer … But we want the answer … If the input is small use backtrack. If the input is small use backtrack. Isolate the problem into P-problems ! Isolate the problem into P-problems ! Find the Near-Optimal solution in polynomial time. Find the Near-Optimal solution in polynomial time.

Spring 2003Approximation Algorithmes4 Performance ratios We are going to find a Near-Optimal solution for a given problem. We are going to find a Near-Optimal solution for a given problem. We assume two hypothesis : We assume two hypothesis : Each potential solution has a positive cost. Each potential solution has a positive cost. The problem may be either a maximization or a minimization problem on the cost. The problem may be either a maximization or a minimization problem on the cost.

Spring 2003Approximation Algorithmes5 Performance ratios … If for any input of size n, the cost C of the solution produced by the algorithm is within a factor of ρ(n) of the cost C* of an optimal solution: If for any input of size n, the cost C of the solution produced by the algorithm is within a factor of ρ(n) of the cost C* of an optimal solution: Max ( C/C*, C*/C ) ≤ ρ(n) We call this algorithm as an ρ(n)- approximation algorithm. We call this algorithm as an ρ(n)- approximation algorithm.

Spring 2003Approximation Algorithmes6 Performance ratios … In Maximization problems: In Maximization problems: 0<C≤C*, ρ(n) = C*/C In Minimization Problems: In Minimization Problems: 0<C*≤C, ρ(n) = C/C* ρ(n) is never less than 1. ρ(n) is never less than 1. A 1-approximation algorithm is the optimal solution. A 1-approximation algorithm is the optimal solution. The goal is to find a polynomial-time approximation algorithm with small constant approximation ratios. The goal is to find a polynomial-time approximation algorithm with small constant approximation ratios.

Spring 2003Approximation Algorithmes7 Approximation scheme Approximation scheme is an approximation algorithm that takes Є>0 as an input such that for any fixed Є>0 the scheme is (1+Є)-approximation algorithm. Approximation scheme is an approximation algorithm that takes Є>0 as an input such that for any fixed Є>0 the scheme is (1+Є)-approximation algorithm. Polynomial-time approximation scheme is such algorithm that runs in time polynomial in the size of input. Polynomial-time approximation scheme is such algorithm that runs in time polynomial in the size of input. As the Є decreases the running time of the algorithm can increase rapidly: As the Є decreases the running time of the algorithm can increase rapidly: For example it might be O(n 2/Є ) For example it might be O(n 2/Є )

Spring 2003Approximation Algorithmes8 Approximation scheme We have Fully Polynomial-time approximation scheme when its running time is polynomial not only in n but also in 1 / Є We have Fully Polynomial-time approximation scheme when its running time is polynomial not only in n but also in 1 / Є For example it could be O(( 1 / Є ) 3 n 2 ) For example it could be O(( 1 / Є ) 3 n 2 )

Spring 2003Approximation Algorithmes9 Some examples: Vertex cover problem. Vertex cover problem. Traveling salesman problem. Traveling salesman problem. Set cover problem. Set cover problem.

Spring 2003Approximation Algorithmes10 The vertex-cover problem A vertex-cover of an undirected graph G is a subset of its vertices such that it includes at least one end of each edge. A vertex-cover of an undirected graph G is a subset of its vertices such that it includes at least one end of each edge. The problem is to find minimum size of vertex-cover of the given graph. The problem is to find minimum size of vertex-cover of the given graph. This problem is an NP-Complete problem. This problem is an NP-Complete problem.

Spring 2003Approximation Algorithmes11 The vertex-cover problem … Finding the optimal solution is hard (its NP!) but finding a near-optimal solution is easy. Finding the optimal solution is hard (its NP!) but finding a near-optimal solution is easy. There is an 2-approximation algorithm: There is an 2-approximation algorithm: It returns a vertex-cover not more than twice of the size optimal solution. It returns a vertex-cover not more than twice of the size optimal solution.

Spring 2003Approximation Algorithmes12 The vertex-cover problem … APPROX-VERTEX-COVER(G) 1 C ← Ø 2 E′ ← E[G] 3 while E′ ≠ Ø 4 do let (u, v) be an arbitrary edge of E′ 5 C ← C U {u, v} 6 remove every edge in E′ incident on u or v 7 return C

Spring 2003Approximation Algorithmes13 The vertex-cover problem … Optimal Size=3 Near Optimal size=6

Spring 2003Approximation Algorithmes14 The vertex-cover problem … This is a polynomial-time This is a polynomial-time 2-aproximation algorithm. (Why?) Because: Because: APPROX-VERTEX-COVER is O(V+E) APPROX-VERTEX-COVER is O(V+E) |C*| ≥ |A| |C*| ≥ |A| |C| = 2|A| |C| ≤ 2|C*| Optimal Selected Edges Selected Vertices

Spring 2003Approximation Algorithmes15 Traveling salesman problem Given an undirected weighted Graph G we are to find a minimum cost Hamiltonian cycle. Given an undirected weighted Graph G we are to find a minimum cost Hamiltonian cycle. Satisfying triangle inequality or not this problem is NP-Complete. Satisfying triangle inequality or not this problem is NP-Complete. We can solve Hamiltonian path. We can solve Hamiltonian path.

Spring 2003Approximation Algorithmes16 Traveling salesman problem Exact exponential solution: Exact exponential solution: Branch and bound Branch and bound Lower bound: Lower bound: (sum of two lower degree of vertices)/2

Spring 2003Approximation Algorithmes17 Traveling salesman problem A: 2+3 B: 3+3 C: 4+4 D: 2+5 E: 3+6 = 35 Bound: 17,5 d c e ba

Spring 2003Approximation Algorithmes18 Traveling salesman problem

Spring 2003Approximation Algorithmes19 Traveling salesman problem Near Optimal solution Near Optimal solution Faster Faster More easy to impliment. More easy to impliment.

Spring 2003Approximation Algorithmes20 Traveling salesman problem with triangle inequality. APPROX-TSP-TOUR(G, c) 1 select a vertex r Є V[G] to be root. 2 compute a MST for G from root r using Prim Alg. 3 L=list of vertices in preorder walk of that MST. 4 return the Hamiltonian cycle H in the order L.

Spring 2003Approximation Algorithmes21 Traveling salesman problem with triangle inequality. rootMST Pre-Order walkHamiltonian Cycle

Spring 2003Approximation Algorithmes22 Traveling salesman problem This is polynomial-time 2-approximation algorithm. (Why?) This is polynomial-time 2-approximation algorithm. (Why?) Because: Because: APPROX-TSP-TOUR is O(V 2 ) APPROX-TSP-TOUR is O(V 2 ) C(MST) ≤ C(H*) C(MST) ≤ C(H*)C(W)=2C(MST)C(W)≤2C(H*)C(H)≤C(W)C(H)≤2C(H*) Optimal Pre-order Solution

Spring 2003Approximation Algorithmes23 Traveling salesman problem In General Theorem: Theorem: If P ≠ NP, then for any constant ρ≥1, there is no polynomial time ρ-approximation algorithm. c(u,w) ={uEw ? 1 : ρ|V|+1} c(u,w) ={uEw ? 1 : ρ|V|+1} ρ|V|+1+|V|-1>ρ|V| Selected edge not in E Rest of edges

Spring 2003Approximation Algorithmes24 The set-Cover Generalization of vertex-cover problem. Generalization of vertex-cover problem. We have given (X,F) : We have given (X,F) : X : a finite set of elements. X : a finite set of elements. F : family of subsets of X such that every element of X belongs to at least one subset in F. F : family of subsets of X such that every element of X belongs to at least one subset in F. Solution C : subset of F that Includes all the members of X. Solution C : subset of F that Includes all the members of X.

Spring 2003Approximation Algorithmes25 The set-Cover … Minimal Covering set size=3

Spring 2003Approximation Algorithmes26 The set-Cover … GREEDY-SET-COVER(X,F) 1 M ← X 2 C ← Ø 3 while M ≠ Ø do 4 select an SЄF that maximizes |S ח M| 5M ← M – S 6C ← C U {S} 7 return C

Spring 2003Approximation Algorithmes27 The set-Cover … 3 rd chose 1 st chose 2 nd chose 4 th chose Greedy Covering set size=4

Spring 2003Approximation Algorithmes28 This greedy algorithm is polynomial- time ρ(n)-approximation algorithm This greedy algorithm is polynomial- time ρ(n)-approximation algorithm ρ(n)=H(max{|S| : S Є F}) ρ(n)=H(max{|S| : S Є F}) H d H d The proof is beyond of scope of this presentation. The proof is beyond of scope of this presentation. The set-Cover … =∑ i=1 d

Spring 2003Approximation Algorithmes29 Any Question? Thank you for your attendance and attention.