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.

Slides:



Advertisements
Similar presentations
Analysis of Algorithms
Advertisements

NP-Hard Nattee Niparnan.
Instructor Neelima Gupta Table of Contents Approximation Algorithms.
Theory of Computing Lecture 18 MAS 714 Hartmut Klauck.
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.
1 The TSP : Approximation and Hardness of Approximation All exact science is dominated by the idea of approximation. -- Bertrand Russell ( )
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
Combinatorial Algorithms
Computability and Complexity 23-1 Computability and Complexity Andrei Bulatov Search and Optimization.
Introduction to Approximation Algorithms Lecture 12: Mar 1.
February 23, 2015CS21 Lecture 201 CS21 Decidability and Tractability Lecture 20 February 23, 2015.
Graph Algorithms: Minimum Spanning Tree We are given a weighted, undirected graph G = (V, E), with weight function w:
1 Approximation Algorithms CSC401 – Analysis of Algorithms Lecture Notes 18 Approximation Algorithms Objectives: Typical NP-complete problems Approximation.
1 Polynomial Time Reductions Polynomial Computable function : For any computes in polynomial time.
The Theory of NP-Completeness
Time Complexity.
Computability and Complexity 24-1 Computability and Complexity Andrei Bulatov Approximation.
NP-Completeness (2) NP-Completeness Graphs 4/17/2017 6:25 AM x x x x x
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
Black-box (oracle) Feed me a weighted graph G and I will tell you the weight of the max-weight matching of G.
February 25, 2015CS21 Lecture 211 CS21 Decidability and Tractability Lecture 21 February 25, 2015.
P, NP, and NP-Complete Suzan Köknar-Tezel.
Minimum Spanning Trees. Subgraph A graph G is a subgraph of graph H if –The vertices of G are a subset of the vertices of H, and –The edges of G are a.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
University of Texas at Arlington Srikanth Vadada Kishan Kumar B P Fall CSE 5311 Solving Travelling Salesman Problem for Metric Graphs using MST.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
1 The TSP : NP-Completeness Approximation and Hardness of Approximation All exact science is dominated by the idea of approximation. -- Bertrand Russell.
Advanced Algorithm Design and Analysis (Lecture 13) SW5 fall 2004 Simonas Šaltenis E1-215b
Lecture 22 More NPC problems
Prabhas Chongstitvatana1 NP-complete proofs The circuit satisfiability proof of NP- completeness relies on a direct proof that L  p CIRCUIT-SAT for every.
Approximation Algorithms
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
CSE332: Data Abstractions Lecture 24.5: Interlude on Intractability Dan Grossman Spring 2012.
Unit 9: Coping with NP-Completeness
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness and course wrap up.
Lecture 6 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
Lecture19: Graph III Bohyung Han CSE, POSTECH CSED233: Data Structures (2014F)
WK15. Vertex Cover and Approximation Algorithm By Lin, Jr-Shiun Choi, Jae Sung.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
Lecture 25 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014.
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.
CSC 413/513: Intro to Algorithms
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness Proofs.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
 2005 SDU Lecture15 P,NP,NP-complete.  2005 SDU 2 The PATH problem PATH = { | G is a directed graph that has a directed path from s to t} s t
TU/e Algorithms (2IL15) – Lecture 10 1 NP-Completeness, II.
TU/e Algorithms (2IL15) – Lecture 11 1 Approximation Algorithms.
More NP-Complete and NP-hard Problems
More NP-complete problems
Richard Anderson Lecture 26 NP-Completeness
Lecture 2-2 NP Class.
Approximation Algorithms
Richard Anderson Lecture 26 NP-Completeness
Hamiltonian Cycle and TSP
Hard Problems Introduction to NP
Lecture 5 NP Class.
CS21 Decidability and Tractability
Approximation Algorithms
Lecture 24 NP-Complete Problems
NP-Completeness NP-Completeness Graphs 12/6/2018 1:58 PM x x x x x x x
Richard Anderson Lecture 28 NP-Completeness
Prabhas Chongstitvatana
Richard Anderson Lecture 26 NP-Completeness
CS21 Decidability and Tractability
CS154, Lecture 16: More NP-Complete Problems; PCPs
Lecture 24 Vertex Cover and Hamiltonian Cycle
Presentation transcript:

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 the language in polynomial time All problems in P are NP problems – Why?

VERTEX-COVER Given a graph, G, return the smallest set of vertices such that all edges have an end point in the set

HAMILTONIAN PATH Given a graph, G, find a path that visits every vertex exactly once Alt version: Find the path with the minimum weight

What is NP-Complete? A problem is NP-Complete if: – It is in NP – Every other NP problem has a polynomial time reduction to this problem NP-Complete problems: – 3-SAT – VERTEX-COVER – CLIQUE – HAMILTONIAN-PATH (HAMPATH)

Applications

SAT is used to verify circuit design NEED MORE EXAMPLES. WANT PICTURES

Dilemma NP problems need solutions in real-life We only know exponential algorithms What do we do?

Accuracy NP problems are often optimization problems It’s hard to find the EXACT answer Maybe we just want to know our answer is close to the exact answer?

Approximation Algorithms Can be created for optimization problems The exact answer for an instance is OPT The approximate answer will never be far from OPT We CANNOT approximate decision problems

k-approximation S is the approx. answer, OPT is optimal Maximization – k*OPT ≤ S ≤ OPT Minimization – OPT ≤ S ≤ k*OPT

Approximate Vertex-Cover Let S be the cover Pick an edge (u,v) in the graph Add it’s end-points u and v to S Remove any edge that neighbors u or v Repeat until there are no edges left

Approximate Vertex-Cover OPT must cover every edge so either u or v must be in the cover => OPT > ½|S| => 2*OPT ≥ |S| We have a 2-approximation

Traveling Salesperson Problem Given a graph, find a minimum weight hamiltonian path There is a 2-approximation based on MINIMUM SPANNING TREES

Minimum Spanning Tree Given a graph, G, a Spanning Tree of G is a subgraph with no cycles that connects every vertex together A MST is a Spanning Tree with minimal weight

Finding a MST Finding a MST can be done in polynomial time using PRIM’S ALGORITHM or KRUSKAL’S ALGORITHM Both are greedy algorithms Details can be found on Wikipedia

MST vs HAMPATH Any HAMPATH becomes a Spanning Tree by removing an edge cost(MST) ≤ cost(min-HAMPATH)

Approximate TSP Given a complete graph G Compute G’s MST, M The tour is the pre-order traversal of M This is a 2-approximation

Approximating 3-SAT f is a Boolean formula in 3-CNF form if: What’s the optimization version of 3-SAT? Satisfy as many clauses as you can

Approximating 3-SAT Algorithm: – For each variable x i assign True with probability ½, False with probability ½ – This satisfies 7/8ths of the clauses in expectation

Approximating 3-SAT x1x1 x2x2 x3x3 TTTT TTTF TTFT TTFF TFTT TFTF TFFT FFFF The only way we don’t satisfy the clause is if we select the last assignment. This happens only 1/8 th of the time.