CSE 332: NP Completeness, Part II Richard Anderson Spring 2016.

Slides:



Advertisements
Similar presentations
Theory of Computing Lecture 18 MAS 714 Hartmut Klauck.
Advertisements

1 NP-completeness Lecture 2: Jan P The class of problems that can be solved in polynomial time. e.g. gcd, shortest path, prime, etc. There are many.
The Theory of NP-Completeness
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
1 Polynomial Time Reductions Polynomial Computable function : For any computes in polynomial time.
The Theory of NP-Completeness
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 23 Instructor: Paul Beame.
Analysis of Algorithms CS 477/677
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
Toward NP-Completeness: Introduction Almost all the algorithms we studies so far were bounded by some polynomial in the size of the input, so we call them.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
1 The Theory of NP-Completeness 2012/11/6 P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class of decision.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
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.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 8: Complexity Theory.
CSEP 521 Applied Algorithms Richard Anderson Lecture 10 NP Completeness.
NP-complete Problems SAT 3SAT Independent Set Hamiltonian Cycle
Prabhas Chongstitvatana1 NP-complete proofs The circuit satisfiability proof of NP- completeness relies on a direct proof that L  p CIRCUIT-SAT for every.
CSC 172 P, NP, Etc. “Computer Science is a science of abstraction – creating the right model for thinking about a problem and devising the appropriate.
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
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.
NP-Completeness (Nondeterministic Polynomial Completeness) Sushanth Sivaram Vallath & Z. Joseph.
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
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.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 29.
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 CSE 326: Data Structures: Graphs Lecture 24: Friday, March 7 th, 2003.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014.
NPC.
CSC 413/513: Intro to Algorithms
1 Ch 10 - NP-completeness Tractable and intractable problems Decision/Optimization problems Deterministic/NonDeterministic algorithms Classes P and NP.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014.
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.
CSE 421 Algorithms Richard Anderson Lecture 29 Complexity Theory NP-Complete P.
CSE 421 Algorithms Richard Anderson Lecture 28 Survey of NP Complete Problems NP-Complete P.
1 1. Which of these sequences correspond to Hamilton cycles in the graph? (a) (b) (c) (d) (e)
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
COMPLEXITY. Satisfiability(SAT) problem Conjunctive normal form(CNF): Let S be a Boolean expression in CNF. That is, S is the product(and) of several.
1 The Theory of NP-Completeness 2 Review: Finding lower bound by problem transformation Problem X reduces to problem Y (X  Y ) iff X can be solved by.
1 CSE 326: Data Structures: Graphs Lecture 23: Wednesday, March 5 th, 2003.
TU/e Algorithms (2IL15) – Lecture 10 1 NP-Completeness, II.
Richard Anderson Lectures NP-Completeness
Richard Anderson Lecture 26 NP-Completeness
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
Richard Anderson Lecture 25 Min Cut Applications and NP-Completeness
NP-Completeness Yin Tat Lee
Richard Anderson Lecture 25 NP-Completeness
Richard Anderson Lecture 28 NP-Completeness
Richard Anderson Lecture 28 Coping with NP-Completeness
Richard Anderson Lecture 29 NP-Completeness
1. for (i=0; i < n; i+=2) if (A[i] > A[i+1]) swap(A[i], A[i+1])
Richard Anderson Lecture 30 NP-Completeness
Richard Anderson Lecture 28 NP Completeness
Richard Anderson Lecture 27 NP Completeness
Prabhas Chongstitvatana
Richard Anderson Lecture 26 NP-Completeness
CSE 6408 Advanced Algorithms.
Richard Anderson Lecture 27 Survey of NP Complete Problems
CSE 589 Applied Algorithms Spring 1999
Richard Anderson Lecture 25 NP Completeness
Presentation transcript:

CSE 332: NP Completeness, Part II Richard Anderson Spring 2016

Announcements Review session for the final –Friday, in class Final –Monday, June 6, 2:30-4:20 pm, EEB 037 Final exam hints –About 75% of the exam is post midterm, 25% pre midterm –Three questions related to Dijkstra’s Algorithm 2

NP Completeness “Easy problems” – solvable in Polynomial Time Hard problems – take exponential time Interesting class of problems: Non- deterministic polynomial time 3 EXPTIME NP P

4 What you’d rather not say… “I can’t find an efficient algorithm, I guess I’m just too dumb.” In cartoons

5 What you’d like to say… “I can’t find an efficient algorithm, because no such algorithm is possible!” But can you actually say this…?

6 What you can say… “I can’t find an efficient algorithm, but neither can all these famous people.”

Problem Reduction Hamiltonian Circuit –Given a graph, is the a simple cycle that includes all of the vertices Travelling Salesman Problem –Given a complete graph with edge costs and a constant C, is there a cycle that visits all vertices with total cost at most C A reduction of HC to TSP uses an instance of TSP to solve an instance of HP 7

8 Examples B D E G C

9 What you can say… “I can’t find an efficient algorithm, since all these famous people couldn’t solve HC efficiently and I can prove that TSP is at least as hard.”

What is NP? Problems solvable in non-deterministic polynomial time... Problems where “yes” instances have polynomial time checkable certificates

Certificate examples Independent set of size K –The Independent Set Satifisfiable formula –Truth assignment to the variables Hamiltonian Circuit Problem –A cycle including all of the vertices K-coloring a graph –Assignment of colors to the vertices

Certifiers and Certificates: 3-Satisfiability instance s certificate t SAT: Does a given CNF formula have a satisfying formula Certificate: An assignment of truth values to the n boolean variables Certifier: Check that each clause has at least one true literal,

Certifiers and Certificates: Hamiltonian Cycle HAM-CYCLE. Given an undirected graph G = (V, E), does there exist a simple cycle C that visits every node? Certificate. A permutation of the n nodes. Certifier. Check that the permutation contains each node in V exactly once, and that there is an edge between each pair of adjacent nodes in the permutation. instance scertificate t

Polynomial time reductions Y is Polynomial Time Reducible to X –Solve problem Y with a polynomial number of computation steps and a polynomial number of calls to a black box that solves X –Notations: Y < P X

Lemmas Suppose Y < P X. If X can be solved in polynomial time, then Y can be solved in polynomial time. Suppose Y < P X. If Y cannot be solved in polynomial time, then X cannot be solved in polynomial time.

NP-Completeness A problem X is NP-complete if –X is in NP –For every Y in NP, Y < P X X is a “hardest” problem in NP If X is NP-Complete, Z is in NP and X < P Z –Then Z is NP-Complete

Cook’s Theorem The Circuit Satisfiability Problem is NP- Complete

Circuit SAT AND OR AND OR ANDNOTOR NOT x1x1 x2x2 x3x3 x4x4 x5x5 AND NOT AND OR NOT AND OR AND Find a satisfying assignment

Proof of Cook’s Theorem Reduce an arbitrary problem Y in NP to X Let A be a non-deterministic polynomial time algorithm for Y Convert A to a circuit, so that Y is a Yes instance iff and only if the circuit is satisfiable

Populating the NP-Completeness Universe Circuit Sat < P 3-SAT 3-SAT < P Independent Set 3-SAT < P Vertex Cover Independent Set < P Clique 3-SAT < P Hamiltonian Circuit Hamiltonian Circuit < P Traveling Salesman 3-SAT < P Integer Linear Programming 3-SAT < P Graph Coloring 3-SAT < P Subset Sum Subset Sum < P Scheduling with Release times and deadlines NP-Complete NP P

21 P, NP, NPC, and Exponential Time Problems All currently known algorithms for NP-complete problems run in exponential worst case time Diagram depicts relationship between P, NP, and EXPTIME (class of problems that provably require exponential time to solve) It is believed that P  NP  EXPTIME EXPTIME NP P NPC

22 Great Quick Reference Is this lecture complete? Hardly, but here’s a good reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Michael S. Garey and David S. Johnson