1 Approximation Algorithm Updated on 2012/12/25. 2 Approximation Algorithm Up to now, the best algorithm for solving an NP-complete problem requires exponential.

Slides:



Advertisements
Similar presentations
CSE 211 Discrete Mathematics
Advertisements

The Primal-Dual Method: Steiner Forest TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA A A AA A A A AA A A.
Instructor Neelima Gupta Table of Contents Approximation Algorithms.
22C:19 Discrete Math Graphs Fall 2010 Sukumar Ghosh.
Introduction to Graph Theory Instructor: Dr. Chaudhary Department of Computer Science Millersville University Reading Assignment Chapter 1.
22C:19 Discrete Math Graphs Fall 2014 Sukumar Ghosh.
Greedy Algorithms Spanning Trees Chapter 16, 23. What makes a greedy algorithm? Feasible –Has to satisfy the problem’s constraints Locally Optimal –The.
Approximation Algorithms for TSP
S. J. Shyu Chap. 1 Introduction 1 The Design and Analysis of Algorithms Chapter 1 Introduction S. J. Shyu.
Combinatorial Algorithms
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
Approximation Algorithms: Combinatorial Approaches Lecture 13: March 2.
The Evolution Trees From: Computational Biology by R. C. T. Lee S. J. Shyu Department of Computer Science Ming Chuan University.
Approximation Algorithms: Concepts Approximation algorithm: An algorithm that returns near-optimal solutions (i.e. is "provably good“) is called an approximation.
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.
Approximation Algorithms for the Traveling Salesperson Problem.
NP-Complete Problems (Fun part)
Vertex cover problem S  V such that for every {u,v}  E u  S or v  S (or both)
9-1 Chapter 9 Approximation Algorithms. 9-2 Approximation algorithm Up to now, the best algorithm for solving an NP-complete problem requires exponential.
9-1 Chapter 9 Approximation Algorithms. 9-2 Approximation algorithm Up to now, the best algorithm for solving an NP-complete problem requires exponential.
Graphs. Graph A “graph” is a collection of “nodes” that are connected to each other Graph Theory: This novel way of solving problems was invented by a.
Steiner trees Algorithms and Networks. Steiner Trees2 Today Steiner trees: what and why? NP-completeness Approximation algorithms Preprocessing.
Approximation Algorithms Motivation and Definitions TSP Vertex Cover Scheduling.
1 NP-Complete Problems (Fun part) Polynomial time vs exponential time –Polynomial O(n k ), where n is the input size (e.g., number of nodes in a graph,
Approximation Algorithms
Discrete Mathematics Lecture 9 Alexander Bukharovich New York University.
GRAPH Learning Outcomes Students should be able to:
Take a Tour with Euler Elementary Graph Theory – Euler Circuits and Hamiltonian Circuits Amro Mosaad – Middlesex County Academy.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
Management Science 461 Lecture 9 – Arc Routing November 18, 2008.
Theory of Computing Lecture 10 MAS 714 Hartmut Klauck.
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.
The Traveling Salesman Problem Approximation
University of Texas at Arlington Srikanth Vadada Kishan Kumar B P Fall CSE 5311 Solving Travelling Salesman Problem for Metric Graphs using MST.
Graph Theory Topics to be covered:
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
Can you connect the dots as shown without taking your pen off the page or drawing the same line twice.
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
Chapter 15 Approximation Algorithm Introduction Basic Definition Difference Bounds Relative Performance Bounds Polynomial approximation Schemes Fully Polynomial.
Princeton University COS 423 Theory of Algorithms Spring 2001 Kevin Wayne Approximation Algorithms These lecture slides are adapted from CLRS.
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
Projects Network Theory VLSI PSM 1. Network 1. Steiner trees
1 Approximation Algorithm Updated at 2011/01/03. 2 Approximation Algorithm Up to now, the best algorithm for solving an NP-complete problem requires exponential.
WK15. Vertex Cover and Approximation Algorithm By Lin, Jr-Shiun Choi, Jae Sung.
Approximation Algorithms for TSP Tsvi Kopelowitz 1.
Graph theory and networks. Basic definitions  A graph consists of points called vertices (or nodes) and lines called edges (or arcs). Each edge joins.
M Clements Formal Network Theory. Introduction Practical problem – The Seven Bridges of Königsberg Network graphs Nodes & edges Degrees Rules/ axioms.
Introduction to Graph Theory
1) Find and label the degree of each vertex in the graph.
Approximation Algorithms Guo QI, Chen Zhenghai, Wang Guanhua, Shen Shiqi, Himeshi De Silva.
Approximation Algorithms
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.
Approximation Algorithms
Approximation Algorithms
Hamiltonian Cycle and TSP
Hamiltonian Cycle and TSP
Graph theory Definitions Trees, cycles, directed graphs.
EECS 203 Lecture 20 More Graphs.
Approximation Algorithms
Approximation Algorithms for TSP
Richard Anderson Lecture 28 Coping with NP-Completeness
Approximation Algorithms
Approximation Algorithm
Presentation transcript:

1 Approximation Algorithm Updated on 2012/12/25

2 Approximation Algorithm Up to now, the best algorithm for solving an NP-complete problem requires exponential time in the worst case. It is too time- consuming. To reduce the time required for solving a problem, we can relax the problem, and obtain a feasible solution “ close ” to an optimal solution

3 Approximation Algorithm One compromise is to use heuristic solutions. The word “heuristic” may be interpreted as “educated guess.”

4 Approximation Algorithm

5 Approximation ratio bound

6  -approximation algorithm An approximation algorithm with an approximation ratio bound of  is called a  -approximation algorithm or a (1+  )- approximation algorithm. Note that  is always larger than 1 and  =  -1.

7 Vertex Cover Problem Let G=(V, E). The subset S of V that meets every edge of E is called the vertex cover. The Vertex Cover problem is to find a vertex cover of the minimum size. It is NP-hard or the optimization version of an NP-Complete decision problem.

8 Examples of vertex cover

9

10

11 C*: optimal solution C: approximate solution A: the set of edges selected in step 4 No two edges in A share a common endpoint due to step 6. When one edge is selected, 2 vertices are added into C.

12 Bin Packing Problem Given n items of sizes a 1, a 2, …, a n, 0  a i  1 for 1  i  n, which have to be placed in bins of unit capability, the bin packing problem is to determine the minimum number of bins to accommodate all items. If we regard the items of different sizes to be the lengths of time of executing different jobs on a standard processor, the problem becomes to use minimum number of processors which can finish all of the jobs within a fixed time. //You can assume the longest job takes one unit time, which equals to the fixed time.

13 Example of Bin Packing Problem E.g. Given n = 5 items with sizes 0.3, 0.5, 0.8, , the optimal solution is 3 bins. The bin packing problem is NP-hard.

14 An approximation algorithm for the bin packing problem An approximation algorithm: (first-fit) place item i into the lowest-indexed bin which can accommodate it. OPT: the number of bins of the optimal solution FF: the number of bins in the first-fit algorithm C(B i ): the sum of the sizes of items packed in bin B i in the first-fit algorithm Let FF=m.

15 An approximation algorithm for the bin packing problem OPT , ceiling of sum of sizes of all items C(B i ) + C(B i+1 )  1 (a)(Otherwise, the items in B i+1 will be put in B i.) C(B 1 ) + C(B m )  1 (b)(Otherwise, the items in B m will be put in B 1. ) For m nonempty bins, C(B 1 )+C(B 2 )+ … +C(B m )  m/2, (a)+(b)for i=1,..,m  FF = m < 2 = 2  2 OPT FF < 2 OPT C(Bi): the sum of sizes of items packed in bin Bi

16

17

18

19

20 An approximation algorithm for Euclidean traveling salesperson problem (ETSP) The ETSP is to find a shortest closed path through a set S of n points in the plane. The ETSP is NP-hard.

21 Approximation Algorithm for ETSP Input: A set S of n points in the plane. Output: An approximate traveling salesperson tour of S. Step 1: Find a minimum spanning tree T of S. Step 2: Find a minimum Euclidean weighted matching M on the set of vertices of odd degrees in T. Let G=M ∪ T. Step 3: Find an Eulerian cycle of G and then traverse it to find a Hamiltonian cycle as an approximate tour of ETSP by bypassing all previously visited vertices.

22 Eulerian Cycle An Eulerian path (Eulerian trail, Euler walk) in a graph is a path that uses each edge precisely once. If such a path exists, the graph is called traversable. An Eulerian cycle (Eulerian circuit, Euler tour) in a graph is a cycle with uses each edge precisely once. If such a cycle exists, the graph is called Eulerian.

23 L. Euler showed that an Eulerian cycle exists if and only if all vertices in the graph are of even degree and all edges are contained in the same component. L. Euler also showed an Eulerian path exists, if and only if at most two vertices in the graph are of odd degree and all edges are contained in the same component.

24 Leonhard Euler (April 15, September 18, 1783) (pronounced "oiler") was a Swiss mathematician and physicist. He is considered (together with Gauss) to be the greatest mathematician ever. Leonhard Euler stated and solved the problem of Seven Bridges of K ö nigsberg in 1736, which is the first formally discussed problem in graph theory.

25 Eulerian Cycle exists because degree(V1) = 4 degree(V2) = 2 degree(V3) = 4 degree(V4) = 4.

26 This is the Eulerian Cycle.

27 A Hamiltonian path (also called traceable path) is a path that visits each vertex exactly once. A Hamiltonian cycle (also called Hamiltonian circuit, vertex tour or graph cycle) is a cycle that visits each vertex exactly once, except for the starting vertex.

28 Minimum Euclidean Weighted Matching (MEWM) Problem Given a set of points in the plane, the minimum Euclidean weighted matching problem is to join the points in pairs by line segments such that the total length is minimum.

29 Approximation Algorithm for ETSP E.g. Step1:

30 Approximation Algorithm for ETSP Step2:The number of points with odd degrees must be even., which is even One edge contributes 2 degrees

31 Approximation Algorithm for ETSP Step3: P3 and P4 are visited twice. By bypassing P3 and P4 and connecting P6 to P1 directly, we obtain a Hamiltonian cycle.

32 Approximation Algorithm for ETSP Time complexity: O(n 3 ) Step 1: O(n log n) Step 2: O(n 3 ) Step 3: O(n) How close the approximate solution to an optimal solution?

33 How good is the solution ? The approximate tour is within 3/2 of the optimal one. Reasoning: L: optimal ETSP tour, T: MST, Lp: a path derived by removing one edge from L (Lp is also a spanning tree)  length(T)  length(Lp)  length(L) Let Lp=j 1 … i 1 j 2 … i 2 j 3 … i 2m, where {i 1, i 2, …, i 2m } is the set of odd-degree vertices in T where indices of vertices in the set are arranged in the same order as they are in the optimal ETSP tour L.

34 How good is the solution ? Let M be the minimum Euclidean weighted matching (MEWM). Consider the two matchings: M 1 ={[i 1,i 2 ],[i 3,i 4 ], …,[i 2m-1,i 2m ]} and M 2 ={[i 2,i 3 ],[i 4,i 5 ], …,[i 2m,i 1 ]}. We have (by triangular inequality) length(L)  length(M 1 ) + length(M 2 )  2 length(M )  length(M)  1/2 length(L ) G = T ∪ M  length(T) + length(M)  length(L) + 1/2 length(L) = 3/2 length(L)

Q&A 35