1 Polynomial Church-Turing thesis A decision problem can be solved in polynomial time by using a reasonable sequential model of computation if and only.

Slides:



Advertisements
Similar presentations
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Advertisements

NP-Hard Nattee Niparnan.
 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.
Lecture 21 NP-complete problems
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 
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
CSC5160 Topics in Algorithms Tutorial 2 Introduction to NP-Complete Problems Feb Jerry Le
1 L is in NP means: There is a language L’ in P and a polynomial p so that L 1 · L 2 means: For some polynomial time computable map r : 8 x: x 2 L 1 iff.
1 Polynomial Church-Turing thesis A decision problem can be solved in polynomial time by using a reasonable sequential model of computation if and only.
Graphs 4/16/2017 8:41 PM NP-Completeness.
1 Polynomial Church-Turing thesis A decision problem can be solved in polynomial time in a reasonable sequential model of computation if and only if it.
1 Combinatorial Search Spring 2008 (Fourth Quarter)
1 Polynomial Time Reductions Polynomial Computable function : For any computes in polynomial time.
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.
1 L is in NP means: There is a language L’ in P and a polynomial p so that L 1 ≤ L 2 means: For some polynomial time computable map r : x: x L 1 iff r(x)
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.
Lecture 22 More NPC problems
Theory of Computation, Feodor F. Dragan, Kent State University 1 NP-Completeness P: is the set of decision problems (or languages) that are solvable in.
The Complexity of Optimization Problems. Summary -Complexity of algorithms and problems -Complexity classes: P and NP -Reducibility -Karp reducibility.
Computational Complexity Theory Lecture 2: Reductions, NP-completeness, Cook-Levin theorem Indian Institute of Science.
Theory of Computing Lecture 17 MAS 714 Hartmut Klauck.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
CSCI 2670 Introduction to Theory of Computing November 29, 2005.
Polynomial-time reductions We have seen several reductions:
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.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
CSC401 – Analysis of Algorithms Chapter 13 NP-Completeness Objectives: Introduce the definitions of P and NP problems Introduce the definitions of NP-hard.
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.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
1 P P := the class of decision problems (languages) decided by a Turing machine so that for some polynomial p and all x, the machine terminates after at.
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
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.
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
1 How to establish NP-hardness Lemma: If L 1 is NP-hard and L 1 ≤ L 2 then L 2 is NP-hard.
NP-completeness Class of hard problems. Jaruloj ChongstitvatanaNP-complete Problems2 Outline  Introduction  Problems and Languages Turing machines and.
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.
CSE 6311 – Spring 2009 ADVANCED COMPUTATIONAL MODELS AND ALGORITHMS Lecture Notes – Feb. 3, 2009 Instructor: Dr. Gautam Das notes by Walter Wilson.
NPC.
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.
NP-Completeness Note. Some illustrations are taken from (KT) Kleinberg and Tardos. Algorithm Design (DPV)Dasgupta, Papadimitriou, and Vazirani. Algorithms.
CSCI 2670 Introduction to Theory of Computing December 2, 2004.
CSCI 2670 Introduction to Theory of Computing December 7, 2005.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness Proofs.
TU/e Algorithms (2IL15) – Lecture 9 1 NP-Completeness NOT AND OR AND NOT AND.
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.
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.
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?
CSE 332: NP Completeness, Part II Richard Anderson Spring 2016.
TU/e Algorithms (2IL15) – Lecture 10 1 NP-Completeness, II.
NP-Completeness A problem is NP-complete if: It is in NP
NP-Completeness (2) NP-Completeness Graphs 4/13/2018 5:22 AM x x x x x
Chapter 10 NP-Complete Problems.
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
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 Yin Tat Lee
Intro to Theory of Computation
NP-Completeness (2) NP-Completeness Graphs 11/23/2018 2:12 PM x x x x
Richard Anderson Lecture 28 NP-Completeness
Chapter 34: NP-Completeness
NP-Completeness (2) NP-Completeness Graphs 7/9/2019 6:12 AM x x x x x
Presentation transcript:

1 Polynomial Church-Turing thesis A decision problem can be solved in polynomial time by using a reasonable sequential model of computation if and only if it can be solved in polynomial time by a Turing machine. P is the class of these decision problems

2 Search Problems: NP L is in NP iff there is a language L’ in P and a polynomial p so that:

3 Intuition The y-strings are the possible solutions to the instance x. We require that solutions are not too long and that it can be checked efficiently if a given y is indeed a solution or witness (we have a “simple” search problem)

4 Reductions A reduction r of L 1 to L 2 is a polynomial time computable map so that 8 x: x 2 L 1 iff r(x) 2 L 2 We write L 1 · L 2 if L 1 reduces to L 2. Intuition: Efficient software for L 2 can also be used to efficiently solve L 1.

5 NP-hardness A language L is called NP-hard iff 8 L’ 2 NP: L’ · L Intuition: Software for L is strong enough to be used to solve any simple search problem. Proposition: If some NP-hard language is in P, then P=NP.

6 NPC A language L 2 NP that is NP-hard is called NP-complete. NPC := the class of NP-complete problems. Proposition: L 2 NPC ) [L 2 P iff P=NP].

7 L is in NP means: There is a language L’ in P and a polynomial p so that L 1 · L 2 means: For some polynomial time computable map r : 8 x: x 2 L 1 iff r(x) 2 L 2 L is NP-hard means: 8 L’ 2 NP: L’ · L L is in NPC means: L 2 NP and L is NP-hard

8 How to establish NP-hardness Thousands of natural problems are NP-complete: Empirical fact: Most natural problems in NP are either in P or NP-hard. Lemma: If L 1 is NP-hard and L 1 · L 2 then L 2 is NP-hard. We need to establish one problem to be NP-hard, the rest follows using chains of reductions. Cook (1972) established SAT to be NP-hard.

9 SAT ILP MILP MAX INDEPENDENT SET MIN VERTEX COLORING HAMILTONIAN CYCLE TSP TRIPARTITE MATCHING SET COVER KNAPSACK BINPACKING

10 Boolean functions f: {false, true} n ! {false,true} Example: XOR(x 1, x 2 ) = x 1 © x 2 XOR(true, true) = false In this course 0=false, 1=true. XOR(1,1)=0

11 How to represent Boolean functions on a computer Tables. Formulae.

12 Tables More compact representation as Boolean String: “0110”. A function f: {0,1} n ! {0,1} can be represented as a table using … ……..2^n bits

13 Boolean Formulae X 1, X 2, …, X n are formulae. If f is a formula then : f is a formula. If f 1 and f 2 are formulae then (f 1 ) Æ (f 2 ) and (f 1 ) Ç (f 2 ) are formulae. Sometimes we leave out parentheses….

14 Formulae represent Boolean functions “(x 1 Æ : x 2 ) Ç (x 2 Æ : x 1 )” represents the function XOR. Sometimes formula-representation is much more compact than table representation. Sometimes not. It’s never much less compact.

15 Two special classes of Boolean formulae f(x 1, x 2 ) = x 1 © x 2 DNF: f(x 1, x 2 ) = (x 1 Æ : x 2 ) Ç (x 2 Æ : x 1 ) CNF: f(x 1, x 2 ) = ( : x 1 Ç : x 2 ) Æ (x 1 Ç x 2 ) A CNF is any conjunction of clauses (disjunctions of literals). A DNF is any disjunction of terms (conjunctions of literals). Any function on n variables can be described by a CNF (DNF) formula containing at most 2 n clauses (terms), each containing at most n literals.

16 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? SAT: Given a CNF, is it true that it does not represent the constant-0 function? Input: ( : x 1 Ç : x 2 ) Æ (x 1 Ç x 2 ) Output: Yes. Input: ( : x 1 Ç : x 2 ) Æ (x 1 Ç x 2 ) Æ (x 1 Ç : x 2 ) Æ ( : x 1 Ç x 2 ) Output: No.

17 SAT SAT is in NP. Cook’s theorem (1972): SAT is NP-hard. Hence, SAT is NP-complete. It is a universal search problem and we do not think it has a polynomial time algorithm. If we find one, we get $

18 DNF? Suppose we ask the same question of DNF formulas, rather than CNF formulas. Can you get a million dollars for solving this problem?

19 ⋀ Boolean Circuits ⋁ ⌐ X1X1 X2X2 X3X3 ⋀

20 Circuits A circuit C is a directed acyclic graph. Nodes in C are called gates. Types of gates: –Variable (or input) gates of indegree 0, labeled X 1, X 2, …X n –Constant gates of indegree 0, labeled 0,1 –AND-, OR-gates of indegree 2, –NOT-, COPY-gates of indegree 1. –m distinguished gates are output gates. The circuit C computes a Boolean function C:{0,1} n ! {0,1} m

21 ⋀ A formula can be viewed as a special kind of circuit ⋁ ⌐ X1X1 X2X2 X3X3 ⋀ f(X 1, X 2, X 3 ) = : X 1 Ç (X 1 Æ X 2 Æ X 3 )

22 Are formulas and circuits in fact the same thing? Not quite! Given a circuit, we can write down an equivalent formula, but in may become much bigger. A circuit is allowed to reuse the result of a sub-computation without doing the computation again!

23 Multi-output circuits Any function f: {0,1} n ! {0,1} m is represented by some circuit. Proof: Any function f: {0,1} n ! {0,1} can be described by a Boolean formula. A formula can also be viewed as a circuit. Combine m such circuits.

24 Tables – Formulae - Circuits For a function f: {0,1} n ! {0,1}, let s t = 2 n be the size (in bits) of its representation as a table. Let s f be the size (in bits) of its smallest representation as a formula. Then, – |s f | · 10 |s t | 2 (formulae are not much less compact than tables). –For all n, there is a function so that |s f | · 10 (log |s t |) 2 (for some functions, formulae are much more compact) Let s c be the size (in bits) of its smallest representation as a circuit. Then, –|s c | · 10 |s f | 2 (circuits are not much less compact than formulae). –Is it true than there for all n is a function so that circuits are much more compact (e.g., |s c | · 10 (log |s f |) 2 )? This is open! You won’t get $ for solving this, but you’ll still get pretty famous ….

25 Circuits vs. Turing Machines Circuits can be given as inputs to algorithms but they can also be seen as computational devices themselves! Like Turing Machines, circuits C: {0,1} n ! {0,1} solve decision problems on {0,1} n. Unlike Turing machines, circuits takes inputs of a fixed input length n only.

26 Theorem Given Turing Machine M running in time at most p(n) on inputs of length n, where p is a polynomial. For every n, there is a circuit C n with at most O(p(n) 2 ) gates so that 8 x 2 {0,1} n : C n (x)=1 iff M accepts x. The map 1 n ! C n is polynomial time computable.

27 Intuition behind proof

28 Problem: Cycles! Flip-Flop, stores one bit.

29 The Tableau Method Time 0 Time 1 Time t … 12 s Can be replaced by acyclic Boolean circuit of size ≈ s

30 CIRCUIT SAT CIRCUIT SAT: Given a Boolean circuit, is there a way to assign truth values to the input gates variables, so that the output gate evaluates to true? Generalizes SAT, as CNFs are formulas and formulas are circuits.

31 Example ⋀ ⋁ ⌐ X1X1 X2X2 X3X3 ⋀ Input: Output: Yes

32 Example ⋀ ⌐ X1X1 X2X2 X3X3 ⋀ Input: Output: No ⋀

33 CIRCUIT SAT CIRCUIT SAT is in NP. Proof of Cook’s theorem: – CIRCUIT SAT reduces to SAT. – CIRCUIT SAT is NP-hard. – Hence, SAT is NP-hard.

34 CIRCUIT SATSAT

35 CIRCUIT SAT is NP-hard Given an arbitrary language L in NP we must show that L reduces to CIRCUIT SAT. This means: We must construct a polynomial time computable map r mapping instances of L to circuits, so that 8 x: x 2 L, r(x) 2 CIRCUIT SAT The only thing we know about L is that there is a language L’ in P and a polynomial p, so that:

36 Theorem Given Turing Machine M running in time at most p(n) on inputs of length n, where p is a polynomial. For every n, there is a circuit C n of size at most O(p(n) 2 ) so that 8 x 2 {0,1} n : C n (x)=1 iff M accepts x. The map 1 n ! C n is polynomial time computable.