Lecture 24 Classical NP-hard Problems

Slides:



Advertisements
Similar presentations
NP-Hard Nattee Niparnan.
Advertisements

Theory of Computing Lecture 18 MAS 714 Hartmut Klauck.
The Theory of 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.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
The Theory of NP-Completeness 1. What is NP-completeness? Consider the circuit satisfiability problem Difficult to answer the decision problem in polynomial.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 8: Complexity Theory.
Polynomial-time reductions We have seen several reductions:
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
Lecture 6 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
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.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
NPC.
CSC 413/513: Intro to Algorithms
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.
SUBSET-SUM Instance: A set of numbers denoted S and a target number t.
CSE 421 Algorithms Richard Anderson Lecture 28 Survey of NP Complete Problems NP-Complete P.
TU/e Algorithms (2IL15) – Lecture 10 1 NP-Completeness, II.
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
The Theory of NP-Completeness
Limitation of Computation Power – P, NP, and NP-complete
NP-Completeness (2) NP-Completeness Graphs 4/13/2018 5:22 AM x x x x x
More NP-Complete and NP-hard Problems
More NP-complete problems
P & NP.
Richard Anderson Lecture 26 NP-Completeness
Advanced Algorithms Analysis and Design
Lecture 2-2 NP Class.
More NP-complete Problems
SUBSET-SUM Instance: A set of numbers denoted S and a target number t.
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
NP-Completeness Proofs
Richard Anderson Lecture 26 NP-Completeness
Hard Problems Introduction to NP
P and NP CISC4080, Computer Algorithms CIS, Fordham Univ.
Lecture 5 NP Class.
Intro to Theory of Computation
CS154, Lecture 16: More NP-Complete Problems; PCPs
CS21 Decidability and Tractability
Lecture 24 NP-Complete Problems
ICS 353: Design and Analysis of Algorithms
NP-Completeness (2) NP-Completeness Graphs 11/23/2018 2:12 PM x x x x
More NP-complete Problems
Richard Anderson Lecture 25 NP-Completeness
Richard Anderson Lecture 28 NP-Completeness
Richard Anderson Lecture 29 NP-Completeness
Chapter 34: NP-Completeness
NP-Complete Problems.
CS 3343: Analysis of Algorithms
Richard Anderson Lecture 26 NP-Completeness
CS21 Decidability and Tractability
P, NP and NP-Complete Problems
NP-Completeness Yin Tat Lee
The Theory of NP-Completeness
CS154, Lecture 16: More NP-Complete Problems; PCPs
More NP-complete problems
NP-Completeness Lecture for CS 302.
Richard Anderson Lecture 27 Survey of NP Complete Problems
CSE 589 Applied Algorithms Spring 1999
P, NP and NP-Complete Problems
RAIK 283 Data Structures & Algorithms
NP-Completeness (2) NP-Completeness Graphs 7/9/2019 6:12 AM x x x x x
ADVANCED COMPUTATIONAL MODELS AND ALGORITHMS
Lecture 24 Vertex Cover and Hamiltonian Cycle
Lecture 23 NP-Hard Problems
Presentation transcript:

Lecture 24 Classical NP-hard Problems

Outline Hamiltonian Path to TSP Cycle 3-SAT to Quadratic Program Tripartite Matching to SUBSET SUM

General Recipe for reductions In order to prove B is NP-hard, given that we know A is NP hard. Reduce A to B. What is a complete reduction? Given an instance X of A, construct an instance Y of B. Prove that if answer to X is YES, answer to Y is also YES. Prove that if answer to X is NO, answer to Y is also NO. (Usually: prove the contrapositive: if answer to Y is YES, answer to X is also YES)

Hamiltonian Path Given a graph G, a starting vertex s and an ending vertex t. A Hamiltonian path from s to t is a path from s to t that visits every vertex in G exactly once. Hamiltonian Path problem asks if there exists a Hamiltonian path from s to t.

Travelling Salesman Problem Given a weighted graph G, a salesman wants to start at vertex s, visit all vertices in the graph, and then come back to s. Given a threshold L, TSP cycle problem asks whether there is a way to visit all vertices (and come back to s) with total edge length at most L. (Starting vertex does not matter, so s is not part of input)

Reduction from Hamiltonian Path to TSP cycle Step 1: Given an instance X of Hamiltonian Path, construct an instance Y of TSP cycle. Idea: Find similarities/differences of the problems. Similarities: visit every vertex in graph. Differences: No weights in Hamiltonian Path Path vs. cycle.

Outline Hamiltonian Path to TSP Cycle 3-SAT to Quadratic Program Tripartite Matching to SUBSET SUM

3-SAT Literals: A variable ( 𝑥 1 ), or the negation of a variable ( 𝑥 1 ). Clause: Logic OR of literals ( 𝑥 1 ∨ 𝑥 3 ∨ 𝑥 5 ) Conjunctive Normal Form: “and” of “or”s. 𝑥 1 ∨ 𝑥 3 ∨ 𝑥 5 ∧ 𝑥 2 ∨ 𝑥 3 ∨ 𝑥 4 ∧⋯∧ 𝑥 1 ∨ 𝑥 4 ∨ 𝑥 5 3-SAT: Given a conjunctive normal form, where each clause contains at most 3 literals, decide whether there is a value of variables such that the formula is satisfied (A clause is satisfied if one of its literals is true; The formula is satisfied if ALL clauses are satisfied.)

Quadratic Programming Same as linear programming, except you are allowed to have quadratic constraints (e.g. x12+x2x3 + 3x4≤ 3) Decision problem: Given a set of quadratic constraints, decide whether there is a feasible solution.

Reduction from 3-SAT to Quadratic Programming Step 1: Given an instance X of 3-SAT, construct an instance Y of Quadratic Programming. Two problems are very different, needs to use gadgets.

Gadget for variables Variable xi: either true or false Gadget: A variable in quadratic program that can only take two values (say 0 or 1) yi2 = yi xi = true  yi = 1; xi = false  yi = 0 Negation of a variable: (1-yi)

Gadget for Clauses Clause: ( 𝑥 1 ∨ 𝑥 3 ∨ 𝑥 5 ) Interpretation: x1 = true or x3 = true or x5 = false  y1 = 1 or y3 = 1 or (1-y5) = 1 Can we write this as a constraint? y1+y3+(1-y5) ≥ 1

Outline Hamiltonian Path to TSP Cycle 3-SAT to Quadratic Program Tripartite Matching to SUBSET SUM

Tripartite Matching There are three sets of vertices U, V, W, each of size n. A hyper-edge is a 3-tuple (u,v,w) where u, v, w are vertices in U, V, W respectively. A tripartite matching is a way of selecting n hyper- edges, so that every vertex is adjacent to a hyper- edge. The decision version of the problem asks whether a tripartite matching exists.

SUBSET SUM/KNAPSACK In the SUBSET SUM problem, you are given n numbers a1, a2, …, an, and a target m. The answer is YES if and only if there is a subset of these n numbers that sums up to m.

Reduction from Tripartite Matching to SUBSET SUM Step 1: Given an instance X of Tripartite Matching, construct an instance Y of SUBSET SUM. Similarity: Tripartite Matching wants to select hyper-edges, SUBSET SUM wants to select numbers. Question: how to map a hyper-edge to a number?

Idea: Use an intermediate problem SUBSET VECTORS Given n vectors v1, v2, …, vn, and a target u. The answer is YES if and only if there is a subset of these n vectors that sums up to u. Reduce Tripartite Matching to SUBSET VECTORS Reduce SUBSET VECTORS to SUBSET SUM