Data Structures and Algorithm Analysis Lecture 24

Slides:



Advertisements
Similar presentations
Lecture 3 Universal TM. Code of a DTM Consider a one-tape DTM M = (Q, Σ, Γ, δ, s). It can be encoded as follows: First, encode each state, each direction,
Advertisements

 2004 SDU Lecture17-P,NP, NPC.  2004 SDU 2 1.Decision problem and language decision problem decision problem and language 2.P and NP Definitions of.
CSCI 256 Data Structures and Algorithm Analysis Lecture 22 Some slides by Kevin Wayne copyright 2005, Pearson Addison Wesley all rights reserved, and some.
Complexity class NP Is the class of languages that can be verified by a polynomial-time algorithm. L = { x in {0,1}* | there exists a certificate y with.
Computability and Complexity 13-1 Computability and Complexity Andrei Bulatov The Class NP.
1 Polynomial Time Reductions Polynomial Computable function : For any computes in polynomial time.
NP-Completeness NP-Completeness Graphs 4/17/2017 4:10 AM x x x x x x x
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
11/3/10 A. Smith; based on slides by E. Demaine, C. Leiserson, S. Raskhodnikova, K. Wayne Adam Smith Algorithm Design and Analysis L ECTURES NP-completeness.
1 1. Draw the machine schema for a TM which when started with input 001 halts with abbb on the tape in our standard input format. 2. Suppose you have an.
Theory of Computing Lecture 17 MAS 714 Hartmut Klauck.
Cs3102: Theory of Computation Class 24: NP-Completeness Spring 2010 University of Virginia David Evans.
TECH Computer Science NP-Complete Problems Problems  Abstract Problems  Decision Problem, Optimal value, Optimal solution  Encodings  //Data Structure.
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
Sailesh Prabhu Prof. Swarat Chaudhuri COMP 482: Design and Analysis of Algorithms Spring 2013.
CSCI 256 Data Structures and Algorithm Analysis Lecture 6 Some slides by Kevin Wayne copyright 2005, Pearson Addison Wesley all rights reserved, and some.
1 Chapter 34: NP-Completeness. 2 About this Tutorial What is NP ? How to check if a problem is in NP ? Cook-Levin Theorem Showing one of the most difficult.
1. 2 Lecture outline Basic definitions: Basic definitions: P, NP complexity classes P, NP complexity classes the notion of a certificate. the notion of.
30.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 29.
Young CS 331 D&A of Algo. NP-Completeness1 NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and.
NP-Completeness Note. Some illustrations are taken from (KT) Kleinberg and Tardos. Algorithm Design (DPV)Dasgupta, Papadimitriou, and Vazirani. Algorithms.
Lecture. Today Problem set 9 out (due next Thursday) Topics: –Complexity Theory –Optimization versus Decision Problems –P and NP –Efficient Verification.
CSCI 2670 Introduction to Theory of Computing December 2, 2004.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
1 SAT SAT: Given a Boolean function in CNF representation, is there a way to assign truth values to the variables so that the function evaluates to true?
Conceptual Foundations © 2008 Pearson Education Australia Lecture slides for this course are based on teaching materials provided/referred by: (1) Statistics.
P, NP, NP-completeness 2 Reductions 1 Thu, July 7 th 1.
Advanced Algorithms NP-hard and NP-Complete Problems Instructor: Saeid Abrishami Ferdowsi University of Mashhad.
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
NP-Completeness A problem is NP-complete if: It is in NP
More NP-Complete and NP-hard Problems
Graphs 4/13/2018 5:25 AM Presentation for use with the textbook, Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015 NP-Completeness.
P & NP.
Chapter 10 NP-Complete Problems.
NP-Completeness NP-Completeness Graphs 5/7/ :49 PM x x x x x x x
Data Structures and Algorithm Analysis Lecture 23
L is in NP means: There is a language L’ in P and a polynomial p so that L1 ≤ L2 means: For some polynomial time computable map r :  x: x  L1 iff.
Richard Anderson Lecture 26 NP-Completeness
Advanced Algorithms Analysis and Design
Polynomial-Time Reduction
NP-Completeness Yin Tat Lee
CS21 Decidability and Tractability
Intro to Theory of Computation
Intro to Theory of Computation
NP-Completeness NP-Completeness Graphs 11/16/2018 2:32 AM x x x x x x
Busch Complexity Lectures: Undecidable Problems (unsolvable problems)
CS154, Lecture 16: More NP-Complete Problems; PCPs
Intro to Theory of Computation
Lecture 24 NP-Complete Problems
ICS 353: Design and Analysis of Algorithms
Richard Anderson Lecture 25 NP-Completeness
How Hard Can It Be?.
NP-Completeness NP-Completeness Graphs 12/3/2018 2:46 AM x x x x x x x
Decidable Languages Costas Busch - LSU.
Chapter 34: NP-Completeness
Chapter 8 NP and Computational Intractability
CS 583 Fall 2006 Analysis of Algorithms
Chapter 11 Limitations of Algorithm Power
Proposed in Turing’s 1936 paper
CS154, Lecture 13: P vs NP.
NP-completeness The Chinese University of Hong Kong Fall 2008
NP-Completeness Yin Tat Lee
CSE 6408 Advanced Algorithms.
NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and Johnson, W.H. Freeman and Company, 1979.
Instructor: Aaron Roth
Instructor: Aaron Roth
Algorithms CSCI 235, Spring 2019 Lecture 36 P vs
Lecture 23 NP-Hard Problems
Presentation transcript:

Data Structures and Algorithm Analysis Lecture 24 CSCI 256 Data Structures and Algorithm Analysis Lecture 24 Some slides by Kevin Wayne copyright 2005, Pearson Addison Wesley all rights reserved, and some by Iker Gondra

Basic terminology Recall we consider that the input to a computational problem will be encoded as a finite binary string. Denote the length of a string s by | s | Identify a decision problem X with the set of strings on which the answer is “yes”. An algorithm A for a decision problem receives an input string s and returns the answer “yes” or “no”. We say that A solves the decision problem if for all strings s we have A(s) = yes if and only if s ε X.

NP Def: Algorithm C(s, t) is a certifier for a decision problem X if for every string s, s  X iff there exists a string t such that C(s, t) = yes NP: A decision problem X is in NP if there exists a poly-time certifier C(s,t), which means C(s, t) is a poly-time algorithm and |t|  p(|s|) for some polynomial p(). Remark: NP stands for nondeterministic polynomial-time

NP-Complete NP-complete: A problem Y is NP=complete if Y is in NP and for every problem X in NP, X  p Y Theorem: Suppose Y is an NP-complete problem. Then Y is solvable in poly-time iff P = NP Pf:  If P = NP then Y can be solved in poly-time since Y is in NP Pf:  Suppose Y can be solved in poly-time Let X be any problem in NP. Since X  p Y, we can solve X in poly-time. This implies NP  P We already know P  NP. Thus P = NP

NP-Complete If there is any problem in NP that cannot be solved in poly time, then no NP complete problem could be solved in poly time Write as: If there exists X in NP which is not poly-time => For all Y in NP complete (Y is not poly-time) Prove contrapositive: i.e., prove Exists Y in NP complete which is poly-time => all X in NP X is poly-time Proof: Assume there is some NP complete problem Y that can be solved in poly time; let X be any problem in NP; since X  pY, we may conclude that X can be solved in poly time

Fundamental questions: How do we know such problems exist Fundamental questions: How do we know such problems exist? Do there exist "natural" NP-complete problems? (meaning problems that we are interested in solving, not some artifically constructed problem)

Circuit Satisfiability CIRCUIT-SAT: Given a combinational circuit built out of AND, OR, and NOT gates, is there a way to set the circuit inputs so that the output is 1?

Circuit Satisfiability CIRCUIT-SAT: Given a combinational circuit built out of AND, OR, and NOT gates, is there a way to set the circuit inputs so that the output is 1? output    yes: 1 0 1    1 ? ? ? hard-coded inputs inputs

                    Find a satisfying assignment x3 x4 x5 x1 x2

Circuit Satisfiability Nobody knows how to solve this problem faster than just trying all possible 2n inputs to the circuit, but this requires exponential time But also, nobody has proven that this is the best we can do!

The "First" NP-Complete Problem Theorem: CIRCUIT-SAT is NP-complete. [Cook 1971, Levin 1973]. Pf: (sketch) Need to take any NP problem X and show: X  p CIRCUIT-SAT First we remark: Any algorithm that takes a fixed number of bits n as input and produces a yes/no answer can be represented by a circuit of AND, OR and NOT gates which is satisfiable iff answer is yes Moreover, if algorithm takes poly-time, then circuit is of poly-size (we won’t go into the transformation from algorithm to circuit – but any algorithm implemented on physical computers can be reduced to their operations on the /\, V, and ¬ gates; need to fix the number of input bits as a circuit is structurally hardcoded)

The "First" NP-Complete Problem Let X be a problem in NP. It has a poly-time certifier C(s, t). To determine whether s is in X, need to know if there exists a certificate t of length p(|s|) such that C(s, t) = yes View C(s, t) as an algorithm on n =(|s| + p(|s|) bits (input string s, certificate t) and convert it into a poly-size circuit K first |s| bits are hard-coded with s remaining p(|s|) bits represent bits of t Circuit K is satisfiable iff C(s, t) = yes

Establishing NP-Completeness Remark: Once we establish first "natural" NP-complete problem, others fall like dominoes Recipe to establish NP-completeness of problem Y Step 1. Show that Y is in NP Step 2. Choose an NP-complete problem X Step 3. Prove that X  p Y Justification: If X is an NP-complete problem, and Y is a problem in NP with the property that X  P Y then Y is NP-complete Pf: Let W be any problem in NP. Then W  P X  P Y By transitivity, W  P Y Hence Y is NP-complete