Design and Analysis of Algorithms Approximation algorithms for NP-complete problems Haidong Xue Summer 2012, at GSU.

Slides:



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

Approximation Algorithms
Greedy Algorithms Spanning Trees Chapter 16, 23. What makes a greedy algorithm? Feasible –Has to satisfy the problem’s constraints Locally Optimal –The.
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.
Reducibility Class of problems A can be reduced to the class of problems B Take any instance of problem A Show how you can construct an instance of problem.
Approximation Algorithms for TSP
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 ( )
Design and Analysis of Algorithms Single-source shortest paths, all-pairs shortest paths Haidong Xue Summer 2012, at GSU.
Combinatorial Algorithms
Lecture 21 Approximation Algorithms Introduction.
Minimum Spanning Trees Kun-Mao Chao ( 趙坤茂 ) Department of Computer Science and Information Engineering National Taiwan University, Taiwan
Introduction to Approximation Algorithms Lecture 12: Mar 1.
Complexity Theory CSE 331 Section 2 James Daly. Reminders Project 4 is out Due Friday Dynamic programming project Homework 6 is out Due next week (on.
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.
Design and Analysis of Algorithms Minimum Spanning trees
An introduction to Approximation Algorithms Presented By Iman Sadeghi.
Approximation Algorithms Motivation and Definitions TSP Vertex Cover Scheduling.
The Travelling Salesman Algorithm A Salesman has to visit lots of different stores and return to the starting base On a graph this means visiting every.
Programming & Data Structures
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
The Traveling Salesman Problem Approximation
SPANNING TREES Lecture 21 CS2110 – Spring
1 The TSP : NP-Completeness Approximation and Hardness of Approximation All exact science is dominated by the idea of approximation. -- Bertrand Russell.
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
6.1 Hamilton Circuits and Paths: Hamilton Circuits and Paths: Hamilton Path: Travels to each vertex once and only once… Hamilton Path: Travels to each.
Princeton University COS 423 Theory of Algorithms Spring 2001 Kevin Wayne Approximation Algorithms These lecture slides are adapted from CLRS.
CSCI 3160 Design and Analysis of Algorithms Chengyu Lin.
CSE332: Data Abstractions Lecture 24.5: Interlude on Intractability Dan Grossman Spring 2012.
Lecture 19 Greedy Algorithms Minimum Spanning Tree Problem.
The Traveling Salesman Problem Over Seventy Years of Research, and a Million in Cash Presented by Vladimir Coxall.
Minimum Spanning Trees CS 146 Prof. Sin-Min Lee Regina Wang.
WK15. Vertex Cover and Approximation Algorithm By Lin, Jr-Shiun Choi, Jae Sung.
Approximation Algorithms for TSP Tsvi Kopelowitz 1.
SPANNING TREES Lecture 20 CS2110 – Fall Spanning Trees  Definitions  Minimum spanning trees  3 greedy algorithms (incl. Kruskal’s & Prim’s)
Graphs and MSTs Sections 1.4 and 9.1. Partial-Order Relations Everybody is not related to everybody. Examples? Direct road connections between locations.
MCS 312: NP Completeness and Approximation algorthms Instructor Neelima Gupta
Design and Analysis of Algorithms NP-Completeness Haidong Xue Summer 2012, at GSU.
Lecture 25 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
Prims Algorithm for finding a minimum spanning tree
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.
Spanning Trees Dijkstra (Unit 10) SOL: DM.2 Classwork worksheet Homework (day 70) Worksheet Quiz next block.
EMIS 8373: Integer Programming Combinatorial Optimization Problems updated 27 January 2005.
1 Minimum Spanning Tree: Solving TSP for Metric Graphs using MST Heuristic Soheil Shafiee Shabnam Aboughadareh.
TU/e Algorithms (2IL15) – Lecture 11 1 Approximation Algorithms.
Approximation Algorithms
NP-completeness Ch.34.
Optimization problems such as
Lecture 2-2 NP Class.
Minimum Spanning Tree Chapter 13.6.
An introduction to Approximation Algorithms Presented By Iman Sadeghi
Approximation Algorithms
Hamiltonian Cycle and TSP
Hamiltonian Cycle and TSP
Approximation Algorithms
Approximation Algorithms for TSP
CS200: Algorithm Analysis
Connected Components Minimum Spanning Tree
Minimum Spanning Trees
Approximation Algorithms
Minimum Spanning Trees
Minimum Spanning Trees
Spanning Trees Lecture 20 CS2110 – Spring 2015.
Approximation Algorithms
Minimum Spanning Trees
Lecture 24 Vertex Cover and Hamiltonian Cycle
Presentation transcript:

Design and Analysis of Algorithms Approximation algorithms for NP-complete problems Haidong Xue Summer 2012, at GSU

Approximation algorithms for NPC problems If a problem is NP-complete, there is very likely no polynomial-time algorithm to find an optimal solution The idea of approximation algorithms is to develop polynomial-time algorithms to find a near optimal solution

Approximation algorithms for NPC problems E.g.: develop a greedy algorithm without proving the greedy choice property and optimal substructure. Are those solution found near-optimal? How near are they?

Approximation algorithms for NPC problems

E.g.: – If the total weigh of a MST of graph G is 20 – A algorithm can produce some spanning trees, and they are not MSTs, but their total weights are always smaller than 25 – What is the approximation ratio? 25/20 = 1.25 – This algorithm is called? A 1.25-approximation algorithm

Approximation algorithms for NPC problems

Vertex-cover problem and a 2-approximation algorithm

Are the red vertices a vertex-cover? No. why? Edges (5, 6), (3, 6) and (3, 7) are not covered by it

Vertex-cover problem and a 2-approximation algorithm Are the red vertices a vertex-cover? No. why? Edge (3, 7) is not covered by it

Vertex-cover problem and a 2-approximation algorithm Are the red vertices a vertex-cover? Yes What is the size? 4

Vertex-cover problem and a 2-approximation algorithm Are the red vertices a vertex-cover? Yes What is the size? 7

Vertex-cover problem and a 2-approximation algorithm Are the red vertices a vertex-cover? Yes What is the size? 5

Vertex-cover problem and a 2-approximation algorithm Are the red vertices a vertex-cover? Yes What is the size? 3

Vertex-cover problem and a 2-approximation algorithm Vertex-cover problem – Given a undirected graph, find a vertex cover with minimum size.

Vertex-cover problem and a 2-approximation algorithm A minimum vertex-cover

Vertex-cover problem and a 2-approximation algorithm

It is then a vertex cover 6 Size? How far from optimal one?Max(6/3, 3/6) = 2

Vertex-cover problem and a 2-approximation algorithm

It is then a vertex cover 4 Size? How far from optimal one?Max(4/3, 3/4) = 1.33

Vertex-cover problem and a 2-approximation algorithm APPROX-VERTEX-COVER(G) is a 2- approximation algorithm When the size of minimum vertex-cover is s The vertex-cover produced by APPROX- VERTEX-COVER is at most 2s

Vertex-cover problem and a 2-approximation algorithm

Traveling-salesman problem Traveling-salesman problem (TSP): – Given a weighted, undirected graph, start from certain vertex, find a minimum route visit each vertices once, and return to the original vertex

Traveling-salesman problem TSP is a NP-complete problem There is no polynomial-time approximation algorithm with a constant approximation ratio Another strategy to solve NPC problem: – Solve a special case

Traveling-salesman problem Triangle inequality: – Weight(u, v) <= Weight(u, w) + Weight(w, v) E.g.: – If all the edges are defined as the distance on a 2D map, the triangle inequality is true For the TSPs where the triangle inequality is true: – There is a 2-approximation polynomial time algorithm

Traveling-salesman problem APPROX-TSP-TOUR(G) Find a MST m; Choose a vertex as root r; return preorderTreeWalk(m, r);

Traveling-salesman problem Can we apply the approximation algorithm on this one? No. The triangle inequality is violated.

Traveling-salesman problem Use Prim’s algorithm to get a MST a b c d e f g h For any pair of vertices, there is a edge and the weight is the Euclidean distance Triangle inequality is true, we can apply the approximation algorithm

Traveling-salesman problem Use Prim’s algorithm to get a MST a b c d e f g h For any pair of vertices, there is a edge and the weight is the Euclidean distance Triangle inequality is true, we can apply the approximation algorithm Choose “a” as the root Preorder tree walk abchdefg

Traveling-salesman problem Use Prim’s algorithm to get a MST a b c d e f g h Choose “a” as the root Preorder tree walk abchdefg The route is then… Because it is a 2-approximation algorithm A TSP solution is found, and the total weight is at most twice as much as the optimal one

The set-covering problem

a bch de X: F: f1: ab f2: b f3: c h f4: de f5: a {f1, f3, f4} is a subset of F covering X {f1, f2, f3, f4} is a subset of F covering X {f2, f3, f4, f5} is a subset of F covering X Here, {f1, f3, f4} is a minimum cover set

The set-covering problem

a bch de X: F: f1: ab f2: b f3: c h f4: de f5: a U: C: abchde We can choose from f1, f3 and f4 f1: ab Choose f1 We can choose from f3 and f4 Choose f3 f3: c h We can choose from f4 Choose f4 f4: de

Summary P problems NP problems NP-complete problems NP-Hard problems The relation between P and NP Polynomial approximation algorithms