NP-Completeness (36.4-5/34.4-5)

Slides:



Advertisements
Similar presentations
NP-Hard Nattee Niparnan.
Advertisements

Theory of Computing Lecture 18 MAS 714 Hartmut Klauck.
NP-Completeness: Reductions
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
© The McGraw-Hill Companies, Inc., Chapter 8 The Theory of NP-Completeness.
Convex Hull(35.3) Convex Hull, CH(X), is the smallest convex polygon containing all points from X, |X|=n Different methods: –incremental: moving from left.
CSC5160 Topics in Algorithms Tutorial 2 Introduction to NP-Complete Problems Feb Jerry Le
Complexity 11-1 Complexity Andrei Bulatov NP-Completeness.
Computability and Complexity 15-1 Computability and Complexity Andrei Bulatov NP-Completeness.
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
1 Polynomial Time Reductions Polynomial Computable function : For any computes in polynomial time.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 23 Instructor: Paul Beame.
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
Clique Cover Cook’s Theorem 3SAT and Independent Set
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.
Lecture 22 More NPC problems
The Complexity of Optimization Problems. Summary -Complexity of algorithms and problems -Complexity classes: P and NP -Reducibility -Karp reducibility.
NP-complete Problems SAT 3SAT Independent Set Hamiltonian Cycle
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
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.
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014.
CSE 6311 – Spring 2009 ADVANCED COMPUTATIONAL MODELS AND ALGORITHMS Lecture Notes – Feb. 3, 2009 Instructor: Dr. Gautam Das notes by Walter Wilson.
NPC.
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.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
The NP class. NP-completeness Lecture2. The NP-class The NP class is a class that contains all the problems that can be decided by a Non-Deterministic.
CSE 332: NP Completeness, Part II Richard Anderson Spring 2016.
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
The NP class. NP-completeness
NP-Completeness (2) NP-Completeness Graphs 4/13/2018 5:22 AM x x x x x
Chapter 10 NP-Complete Problems.
Richard Anderson Lectures NP-Completeness
Richard Anderson Lecture 26 NP-Completeness
Lecture 2-2 NP Class.
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
NP-Completeness (36.4-5) P: yes and no in pt NP: yes in pt NPH  NPC
NP-Completeness Yin Tat Lee
CS21 Decidability and Tractability
ICS 353: Design and Analysis of Algorithms
Intro to NP Completeness
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
NP-Completeness Proofs
Richard Anderson Lecture 28 NP-Completeness
Chapter 34: NP-Completeness
1. for (i=0; i < n; i+=2) if (A[i] > A[i+1]) swap(A[i], A[i+1])
NP-Complete Problems.
CS 3343: Analysis of Algorithms
Richard Anderson Lecture 26 NP-Completeness
NP-Completeness Yin Tat Lee
CS21 Decidability and Tractability
CSE 6408 Advanced Algorithms.
NP-Completeness Yin Tat Lee
The Theory of NP-Completeness
CSE 589 Applied Algorithms Spring 1999
Lecture 24 Classical NP-hard Problems
NP-Completeness (2) NP-Completeness Graphs 7/9/2019 6:12 AM x x x x x
Lecture 24 Vertex Cover and Hamiltonian Cycle
Lecture 23 NP-Hard Problems
Presentation transcript:

NP-Completeness (36.4-5/34.4-5) P: yes and no in pt NP: yes in pt NPH  NPC NP-hard NPC P NP

Satisfiability Boolean formulas: x, (x  y) (x  y) (xy) (xy) Satisfiability Problem (SP): given a Boolean formula is there any 0-1 input (0-1 assignment to variables) s.t. formula is true (=1)? Cook’s Theorem: SP is NP-complete. SP is an NP-problem (why?) SP is NP-hard (w/o proof)

(l11  l12 ... l1s1) ...  (ln1  ln2 ... lnsn) 3-CNF Conjunctive normal form (CNF) = (l11  l12 ... l1s1) ...  (ln1  ln2 ... lnsn) each literal l is either variable or negation 3-CNF: each si=3 3-CNF Satisfiability is NPC (x1 x2)  (x1   x4 ) Corresponding tree y3(y1  (x1  x2)) (y2  ( x1   x4 )) Truth assignment for each clause using tables. y3 y1 y2  x1 x2 x1  x4

Independent Set x z y’ x’ z’ a a’ x y x, z’, y independent Independent set in a graph G: pairwise nonadjacent vertices Max Independent Set is NPC Is there independent set of size k? Construct a graph G: literal -> vertex two vertices are adjacent iff they are in the same clause they are negations of each other 3-CNF with k clauses is satisfiable iff G has independent k-set assign 1’s to literals-vertices of independent set Example: f = (x+z+y’) & (x’+z’+a) & (a’+x+y) x z y’ x’ z’ a a’ x y x, z’, y independent F is satisfiable: f = 1 if x = z’ = y = 1

MAX Clique G Complement G’ Max Clique (MC): MC is in NP MC is in NPC Find the maximum number of pairwise adjacent vertices MC is in NP for the answer yes there is certificate of polynomial length = clique which can be checked in polynomial time MC is in NPC Polynomial time reduction from MIS: For any graph G any independent set in G 1-1 corresponds to clique in the complement graph G’ red independent set red clique G noedge  edge edge  noedge Complement G’

Minimum Vertex Cover Vertex Cover: Minimum Vertex Cover (MVC): the set of vertices which has at least one endpoint in each edge Minimum Vertex Cover (MVC): MIN Vertex Cover is NPC If C is vertex cover, then V - C is an independent set red independent set blue vertex cover

Set Cover d a b c A B A = {a,b,c}, B = {c,d} Given: a set X and a family F of subsets of X, F  2X, s.t. X covered by F Find : subfamily G of F such that G covers X and |G| is minimize Set Cover is NPC reduction from Vertex Covert Graph representation: edge between set A F and element x  X means x  A d a b c red elements of ground set X blue subsets in family F A B A = {a,b,c}, B = {c,d}

Intermediate Classes NP-hard NPC Dense Set Cover is NP but not in P neither in NPC Dense Set Cover: Each element of X belongs to at least half of all sets in F

Runtime Complexity Classes Runtime order: constant almost constant logarithmic sublinear linear pseudolinear quadratic polynomial subexponential exponential superexponential Example adding an element in a queue/stack inverse Ackerman function = O(loglog…log n) n times extracting minimum from binary heap n1/2 traversing binary search tree, list O(n log n) sorting n numbers, closest pair, MST, Dijkstra shortest paths adding two nn matrices e n ^ (1/2) e n, , n! Ackerman function 2 . n times