CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.

Slides:



Advertisements
Similar presentations
Great Theoretical Ideas in Computer Science
Advertisements

Instructor Neelima Gupta Table of Contents Approximation Algorithms.
Great Theoretical Ideas in Computer Science for Some.
9.2 The Traveling Salesman Problem. Let us return to the question of finding a cheapest possible cycle through all the given towns: We have n towns (points)
Combinatorial Algorithms
Great Theoretical Ideas in Computer Science.
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
Approximation Algorithms
Approximation Algorithms: Combinatorial Approaches Lecture 13: March 2.
Approximation Algorithms: Concepts Approximation algorithm: An algorithm that returns near-optimal solutions (i.e. is "provably good“) is called an approximation.
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
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Spring, 2006 Lecture 7 Monday, 4/3/06 Approximation Algorithms.
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
NP-Complete Problems (Fun part)
9-1 Chapter 9 Approximation Algorithms. 9-2 Approximation algorithm Up to now, the best algorithm for solving an NP-complete problem requires exponential.
Approximation Algorithms Motivation and Definitions TSP Vertex Cover Scheduling.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
Programming & Data Structures
Theory of Computing Lecture 10 MAS 714 Hartmut Klauck.
Algorithms for Network Optimization Problems This handout: Minimum Spanning Tree Problem Approximation Algorithms Traveling Salesman Problem.
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
The Traveling Salesperson Problem Algorithms and Networks.
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.
NP-Completeness: 3D Matching
1 The TSP : NP-Completeness Approximation and Hardness of Approximation All exact science is dominated by the idea of approximation. -- Bertrand Russell.
Complexity Classes (Ch. 34) The class P: class of problems that can be solved in time that is polynomial in the size of the input, n. if input size is.
Design Techniques for Approximation Algorithms and Approximation Classes.
Approximating Minimum Bounded Degree Spanning Tree (MBDST) Mohit Singh and Lap Chi Lau “Approximating Minimum Bounded DegreeApproximating Minimum Bounded.
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
Great Theoretical Ideas in Computer Science.
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.
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.
Unit 9: Coping with NP-Completeness
Lecture 6 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
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.
CSE 589 Part V One of the symptoms of an approaching nervous breakdown is the belief that one’s work is terribly important. Bertrand Russell.
Lecture 25 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness Proofs.
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.
1 Euler and Hamilton paths Jorge A. Cobb The University of Texas at Dallas.
Approximation algorithms
TU/e Algorithms (2IL15) – Lecture 11 1 Approximation Algorithms.
The Theory of NP-Completeness
Richard Anderson Lecture 26 NP-Completeness
Optimization problems such as
Richard Anderson Lecture 26 NP-Completeness
Hamiltonian Cycle and TSP
Hamiltonian Cycle and TSP
EECS 203 Lecture 20 More Graphs.
Great Theoretical Ideas in Computer Science
Discrete Mathematics for Computer Science
ICS 353: Design and Analysis of Algorithms
Integer Programming (정수계획법)
Richard Anderson Lecture 28 NP-Completeness
Richard Anderson Lecture 28 Coping with NP-Completeness
Integer Programming (정수계획법)
The Theory of NP-Completeness
Presentation transcript:

CSE 589 Part VI

Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37

Techniques for Dealing with NP-complete Problems Exactly backtracking, branch and bound Approximately approximation algorithms with performance guarantees using LP (e.g., randomized rounding) local search, tabu search simulated annealing …. Change the problem.

Obtaining an Exact Solution: backtracking and branch-and-bound

Backtracking Example: Finding a 3-coloring of a graph Explore possibilities; backtrack when doesn’t work. Start by assigning an arbitrary color to one of the vertices. Continue coloring while maintaining the constraints imposed by the edges If reach a vertex that can’t be colored, backtrack -- go back up the recursion tree and explore other children

Graph Recursion Tree B, 2G 3R 3B 4G 4B 4R 4G 5R

Branch-and-Bound Variation for case where finding minimum (or maximum) of objective function Example: finding the minimum number of colors needed to color graph. Idea: improve performance of algorithm by pruning search when know that can’t possibly be going down the correct path.

Example: Minimum number of colors in graph coloring Suppose traverse tree to leaf and find valid coloring with k colors Suppose later, after backtracking, reach a vertex that requires a (k+1)st color => can backtrack. In example, k serves as a bound for backtracking.

Branch-and-Bound Pruning technique Lower bound computation 

How might you obtain such a bound? Example: looking for a maximum clique. Formulate problem as integer linear programming problem. N variables x 1,…. x n corresponding to vertices x i = 1 if node v i is in maximum clique, 0 otherwise Constraints: x i + x j <= 1 for each pair of vertices such that (v i, v j ) NOT an edge; x i in {0,1} for every i Objective Function: maximize

Bounds for clique problem Use solution to corresponding linear program: 0 <= x i <= 1 What can you say about the solution v* of linear program?

Two things you can do with linear program Use it to get upper bounds on solution: Example: at a node in tree with corresponds to including v,w in clique but excluding x, y. If at that point solution of LP gives bound < size of already known clique, can backtrack. Can use it to help choose good traversal order => good solutions found fast => can backtrack earlier. Example: if x i =1 in linear program, might guess that v i is in integer solution as well.

Approximation Algorithms With Provable Performance Guarantees

Approximation Algorithms The fact that a problem is NP-complete doesn’t mean that we can’t find an approximate solution efficiently. Would really like guarantee on performance.

Example 1: Vertex Cover Given G=(V,E), find a minimum sized subset W of the vertices V such that for every (v,w) in E, at least one of v or w is in W. Approximation Algorithm: while edges remain select an arbitrary edge (u,v) add both u and v to the cover delete all edges incident on either u or v

The Vertex Cover Produced Is At Most Twice The Size Of The Optimal VC Proof: consider the edges selected. No two of these edges share a vertex therefore, just considering these edges, any cover must include at least one vertex per edge.

Example 2: Approximation Algorithm for Euclidean Traveling Salesman Problem The Problem: Given n points in the plane (corresponding to the locations of n cities) find a shortest traveling salesman tour Distances in the plane satisfy the triangle inequality: dist(a,b) <= dist(a,c) + dist(c,b)

Approximation Algorithm For Euclidean TSP Find a minimum spanning tree of points Convert to tour by following DFS and including edge in opposite direction when tour backtracks. Construct shortcuts by taking direct routes instead of backtracking.

Better version of algorithm Uses basic graph algorithms as subroutines: Matching (Skiena, Section 8.4.6) a matching in a graph G=(V,E): a set of edges S from E such that each vertex in V is incident to at most one edge of S. a maximum matching in G: a matching of maximum cardinality a minimum weight matching in a weighted graph: a maximum matching of minimum total weight.

Better version of algorithm Euler tours (Skiena, Section 8.4.6) An Euler tour in a graph is a tour of the graph that visits each edge exactly once. Well known that an undirected graph contains an Euler tour (or cycle) iff (1) it is connected and (2) each vertex has even degree. Easy to construct Euler tours efficiently.

Better version of algorithm Find minimum length matching of odd-degree vertices. There’s an even number of them. Find Eulerian tour of MST plus edges in matching.

This algorithm has provably performance guarantee Theorem: The approximation algorithm for Euclidean TSP finds a tour of length at most 3/2 optimal. Proof: weight of MST <= weight of optimal tour weight of matching <= (weight of optimal tour)/2 shortcuts don’t cost

Optimal TSP tour Green vertices: odd-degree vertices in D

Randomized Approximation Algorithms: Using Linear Programming

Randomized Rounding Randomized algorithm: makes random choices during its execution. Randomized rounding: technique for using linear programming and randomization to produce approximate solution for integer programming problem.

Example: Global Wiring In A Gate Array 2D array of gates implement logic circuit by connecting some of gates using wires. Net: set of gates to be connected by wires running parallel to axes. Wiring problem: given set of nets, specify physical path for each to minimize max # wires crossing any boundary.

Simplifications Each net = 2 gates Global route for each net contains at most one 90 o turn. First horizontal, then vertical first vertical, then horizontal Problem remains NP-complete with these simplifications.

Cast as Integer Program h i = 1 if route for i-th net goes horizontally first, then vertically. 0 otherwise. v i = 1 if route for i-th net goes vertically first, then horizontally. For each boundary b in array: B 0 = {i | net i passes through b if h i = 1} B 1 = {i | net i passes through b if v i = 1} Constraints:

Randomized Rounding Solve linear programming relaxation: gives you optimum: h i *,v i * for each i and w* What can you say about w*? Set h i = 1 with probability h i * Set v i = 1 with probability v i * Value of resulting w provably close to w*

Your turn to analyze an approximation algorithm for an NP-complete problem. Bin Packing: Let x 1 x 2,…, x n be real numbers between 0 and 1. Partition them into as few subsets (bins) as possible such that the sum of numbers in each subset is at most 1. Heuristic Solution: First Fit put x 1 in first bin then, for each i, put x i in the first bin that has room for it, or start a new bin if there is no room in any of the used bins. Prove that First Fit requires at most twice the optimal number of bins.