Lecture 3: P, NP and beyond Arijit Bishnu 01.02.2010 Function - - PowerPoint PPT Presentation

lecture 3 p np and beyond
SMART_READER_LITE
LIVE PREVIEW

Lecture 3: P, NP and beyond Arijit Bishnu 01.02.2010 Function - - PowerPoint PPT Presentation

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness Lecture 3: P, NP and beyond Arijit Bishnu 01.02.2010 Function Computation, Running Time Universal Turing Machines (UTM)


slide-1
SLIDE 1

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

Lecture 3: P, NP and beyond

Arijit Bishnu 01.02.2010

slide-2
SLIDE 2

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

Outline

1 Function Computation, Running Time 2 Universal Turing Machines (UTM) 3 Deterministic Time and the class P 4 NP and NP completeness

slide-3
SLIDE 3

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

Outline

1 Function Computation, Running Time 2 Universal Turing Machines (UTM) 3 Deterministic Time and the class P 4 NP and NP completeness

slide-4
SLIDE 4

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

Computing a Function and Running Time

Definition (Computing a Function and Running Time) Let f : {0, 1}∗ → {0, 1}∗ and let T : N → N be some function, and let M be a Turing Machine (TM). We say that M computes f in T(n)-time if for every x ∈ {0, 1}∗, if M is initialized to the start configuration on input x, then after at most T(|x|) steps it halts with f (x) written on its output tape. We say that M computes f if it computes f in T(n) time for some function T : N → N.

slide-5
SLIDE 5

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

Time-Constructible Functions

Time-Constructible Functions We say that a function T : N → N is time constructible if T(n) ≥ n and there is a TM M that computes the function x → (T(|x|))b where (T(|x|))b denotes the binary representation

  • f the number T(|x|).
slide-6
SLIDE 6

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

Time-Constructible Functions

Time-Constructible Functions We say that a function T : N → N is time constructible if T(n) ≥ n and there is a TM M that computes the function x → (T(|x|))b where (T(|x|))b denotes the binary representation

  • f the number T(|x|).

Examples n, n log n, n5, 2n

slide-7
SLIDE 7

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

Time-Constructible Functions

Time-Constructible Functions We say that a function T : N → N is time constructible if T(n) ≥ n and there is a TM M that computes the function x → (T(|x|))b where (T(|x|))b denotes the binary representation

  • f the number T(|x|).

Examples n, n log n, n5, 2n Remark Functions that are much larger than exponential in n are non-time

  • constructible. As an example, T : N → N such that every function

computable in time T(n) can also be computed in the much shorter time log T(n).

slide-8
SLIDE 8

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

Outline

1 Function Computation, Running Time 2 Universal Turing Machines (UTM) 3 Deterministic Time and the class P 4 NP and NP completeness

slide-9
SLIDE 9

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

Machines as Strings and UTM

We can write the description of any TM on paper. Hence, we can encode it using strings over {0, 1}.

slide-10
SLIDE 10

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

Machines as Strings and UTM

We can write the description of any TM on paper. Hence, we can encode it using strings over {0, 1}. The action of a TM is determined by its transition function, δ.

slide-11
SLIDE 11

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

Machines as Strings and UTM

We can write the description of any TM on paper. Hence, we can encode it using strings over {0, 1}. The action of a TM is determined by its transition function, δ. So, list all inputs and outputs of δ and encode it as a string

  • ver {0, 1}∗.
slide-12
SLIDE 12

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

Machines as Strings and UTM

We can write the description of any TM on paper. Hence, we can encode it using strings over {0, 1}. The action of a TM is determined by its transition function, δ. So, list all inputs and outputs of δ and encode it as a string

  • ver {0, 1}∗.

Our representation scheme satisfies the following

Every string in {0, 1}∗ represents some TM. Every TM is represented by infinitely many strings.

slide-13
SLIDE 13

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

Machines as Strings and UTM

We can write the description of any TM on paper. Hence, we can encode it using strings over {0, 1}. The action of a TM is determined by its transition function, δ. So, list all inputs and outputs of δ and encode it as a string

  • ver {0, 1}∗.

Our representation scheme satisfies the following

Every string in {0, 1}∗ represents some TM. Every TM is represented by infinitely many strings.

Some notations:

For a TM M, we use Mb to denote the binary string representation of M. For a string α, Mα denotes the TM represented by α.

slide-14
SLIDE 14

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

UTM

a UTM can simulate the execution of every other TM M given M’s description as an input.

slide-15
SLIDE 15

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

UTM

a UTM can simulate the execution of every other TM M given M’s description as an input. The parameters of a UTM are fixed - alphabet size, number of states, and the number of tapes.

slide-16
SLIDE 16

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

UTM

a UTM can simulate the execution of every other TM M given M’s description as an input. The parameters of a UTM are fixed - alphabet size, number of states, and the number of tapes. The UTM encodes any other TM M’s states and transition table on its tapes, and then follows along the computation step by step.

slide-17
SLIDE 17

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

Theorem on Efficient UTM

Theorem: Efficient UTM There exists a TM U such that for every x, α ∈ {0, 1}∗, U(x, α) = Mα(x), where Mα denotes the TM represented by α. Furthermore, if Mα halts on input x within T steps, then U(x, α) halts within CT log T steps, where C is a number independent of |x| and depends only on Mα’s alphabet size, number of tapes, and number of states. Proof. See book for details.

slide-18
SLIDE 18

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

Outline

1 Function Computation, Running Time 2 Universal Turing Machines (UTM) 3 Deterministic Time and the class P 4 NP and NP completeness

slide-19
SLIDE 19

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

Class P

Recall that we deal with decision problems or languages that are nothing but boolean functions. we identify a boolean function with the language Lf = {x|f (x) = 1}.

slide-20
SLIDE 20

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

Class P

Recall that we deal with decision problems or languages that are nothing but boolean functions. we identify a boolean function with the language Lf = {x|f (x) = 1}. Definition: The Class DTIME Let T : N → N be some function. We let DTIME(T(n)) be the set

  • f all boolean functions that are computable in d · T(n)-time for

some constant d > 0.

slide-21
SLIDE 21

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

Class P

Recall that we deal with decision problems or languages that are nothing but boolean functions. we identify a boolean function with the language Lf = {x|f (x) = 1}. Definition: The Class DTIME Let T : N → N be some function. We let DTIME(T(n)) be the set

  • f all boolean functions that are computable in d · T(n)-time for

some constant d > 0. Definition: The Class P P =

c≥1DTIME(nc).

slide-22
SLIDE 22

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

Outline

1 Function Computation, Running Time 2 Universal Turing Machines (UTM) 3 Deterministic Time and the class P 4 NP and NP completeness

slide-23
SLIDE 23

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

Polynomial Time Reducibility

Definition: Polynomial Time Reduction We say that a language A ⊆ {0, 1}∗ is polynomial-time (Karp) reducible to a language B ⊆ {0, 1}∗, denoted by A ≤P B, if there is a polynomial-time computable function f : {0, 1}∗ → {0, 1}∗ such that for every x ∈ {0, 1}∗, x ∈ A if and only if f (x) ∈ B.

slide-24
SLIDE 24

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

Polynomial Time Reducibility

Definition: Polynomial Time Reduction We say that a language A ⊆ {0, 1}∗ is polynomial-time (Karp) reducible to a language B ⊆ {0, 1}∗, denoted by A ≤P B, if there is a polynomial-time computable function f : {0, 1}∗ → {0, 1}∗ such that for every x ∈ {0, 1}∗, x ∈ A if and only if f (x) ∈ B. An Intuitive Notion If A ≤P B, then B is at least as hard as A. That means, if A cannot be solved in polynomial time, then B cannot be solved in polynomial time.

slide-25
SLIDE 25

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

Polynomial Time Reducibility

Definition: Polynomial Time Reduction We say that a language A ⊆ {0, 1}∗ is polynomial-time (Karp) reducible to a language B ⊆ {0, 1}∗, denoted by A ≤P B, if there is a polynomial-time computable function f : {0, 1}∗ → {0, 1}∗ such that for every x ∈ {0, 1}∗, x ∈ A if and only if f (x) ∈ B. An Intuitive Notion If A ≤P B, then B is at least as hard as A. That means, if A cannot be solved in polynomial time, then B cannot be solved in polynomial time. Lemma If A ≤P B, and B ≤P C, then A ≤P C.

slide-26
SLIDE 26

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

Polynomial Time Reducibility

Definition: Polynomial Time Reduction We say that a language A ⊆ {0, 1}∗ is polynomial-time (Karp) reducible to a language B ⊆ {0, 1}∗, denoted by A ≤P B, if there is a polynomial-time computable function f : {0, 1}∗ → {0, 1}∗ such that for every x ∈ {0, 1}∗, x ∈ A if and only if f (x) ∈ B. An Intuitive Notion If A ≤P B, then B is at least as hard as A. That means, if A cannot be solved in polynomial time, then B cannot be solved in polynomial time. Lemma If A ≤P B, and B ≤P C, then A ≤P C. Proof Left as an exercise.

slide-27
SLIDE 27

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

An Example of a Polynomial Time Reduction

SAT ≤P CLIQUE

Given an instance of SAT with m clauses and n variables, we construct a graph G = (V , E) where V is the set of all

  • ccurrences of the 2n literals and

E = {(xi, xj)|xi and xj are in two diff. clauses and xi = xj}.

slide-28
SLIDE 28

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

An Example of a Polynomial Time Reduction

SAT ≤P CLIQUE

Given an instance of SAT with m clauses and n variables, we construct a graph G = (V , E) where V is the set of all

  • ccurrences of the 2n literals and

E = {(xi, xj)|xi and xj are in two diff. clauses and xi = xj}. Lemma The SAT formula f is satisfiable if and only if G has a clique of size m.

slide-29
SLIDE 29

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

Understanding Certifier

Definition: The Class NP A language L ⊆ {0, 1}∗ is in NP if there exists a polynomial p : N → N and a polynomial-time TM M such that for every x ∈ {0, 1}∗, x ∈ L ⇐ ⇒ ∃u ∈ {0, 1}p(|x|) such that M(x, u) = 1 If x ∈ L and u ∈ {0, 1}p(|x|) satisfy M(x, u) = 1, then we call u a certificate for x (w.r.t. language L and machine M).

slide-30
SLIDE 30

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

Understanding Certifier

Definition: The Class NP A language L ⊆ {0, 1}∗ is in NP if there exists a polynomial p : N → N and a polynomial-time TM M such that for every x ∈ {0, 1}∗, x ∈ L ⇐ ⇒ ∃u ∈ {0, 1}p(|x|) such that M(x, u) = 1 If x ∈ L and u ∈ {0, 1}p(|x|) satisfy M(x, u) = 1, then we call u a certificate for x (w.r.t. language L and machine M). Examples Traveling Salesperson, Subset sum, Integer Programming, Linear Programming, Graph Isomorphism, etc.

slide-31
SLIDE 31

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

Understanding Certifier

An Efficient Certifier M is an efficient certifier for L if the following holds:

slide-32
SLIDE 32

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

Understanding Certifier

An Efficient Certifier M is an efficient certifier for L if the following holds: M is a polynomial time algorithm (alternately, TM) that takes two input arguments x, u.

slide-33
SLIDE 33

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

Understanding Certifier

An Efficient Certifier M is an efficient certifier for L if the following holds: M is a polynomial time algorithm (alternately, TM) that takes two input arguments x, u. There is a polynomial function p so that for every string x, we have x ∈ L if and only if ∃ a string u such that |u| ≤ p(|x|) and M(x, u) = 1.

slide-34
SLIDE 34

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

Understanding Certifier

An Efficient Certifier M is an efficient certifier for L if the following holds: M is a polynomial time algorithm (alternately, TM) that takes two input arguments x, u. There is a polynomial function p so that for every string x, we have x ∈ L if and only if ∃ a string u such that |u| ≤ p(|x|) and M(x, u) = 1. A Managerial View of M, an efficient certifier

slide-35
SLIDE 35

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

Understanding Certifier

An Efficient Certifier M is an efficient certifier for L if the following holds: M is a polynomial time algorithm (alternately, TM) that takes two input arguments x, u. There is a polynomial function p so that for every string x, we have x ∈ L if and only if ∃ a string u such that |u| ≤ p(|x|) and M(x, u) = 1. A Managerial View of M, an efficient certifier It will not try to decide whether x ∈ L on its own.

slide-36
SLIDE 36

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

Understanding Certifier

An Efficient Certifier M is an efficient certifier for L if the following holds: M is a polynomial time algorithm (alternately, TM) that takes two input arguments x, u. There is a polynomial function p so that for every string x, we have x ∈ L if and only if ∃ a string u such that |u| ≤ p(|x|) and M(x, u) = 1. A Managerial View of M, an efficient certifier It will not try to decide whether x ∈ L on its own. It will rather try to efficiently evaluate proposed “proofs” u that x ∈ L - provided they are not too long.

slide-37
SLIDE 37

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

A Brute Force Algorithm

M’s use in solving L On an input x, try all strings u, s.t. |u| ≤ p(|x|), and see if M(x, u) = 1 for any of these strings.

slide-38
SLIDE 38

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

A Brute Force Algorithm

M’s use in solving L On an input x, try all strings u, s.t. |u| ≤ p(|x|), and see if M(x, u) = 1 for any of these strings. Existence of M does not provide an efficient solver for L.

slide-39
SLIDE 39

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

A Brute Force Algorithm

M’s use in solving L On an input x, try all strings u, s.t. |u| ≤ p(|x|), and see if M(x, u) = 1 for any of these strings. Existence of M does not provide an efficient solver for L. It is upto us to find a string u that will make M(x, u) = 1, and there are exponentially many possibilities for u.

slide-40
SLIDE 40

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

Relation between Complexity Classes Learnt till now

Lemma P ⊆ NP ⊆

c>1DTIME(2nc)

slide-41
SLIDE 41

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

Relation between Complexity Classes Learnt till now

Lemma P ⊆ NP ⊆

c>1DTIME(2nc)

Proof The first one is trivial. Left as an exercise. For the other one, if L ∈ NP, and M and p are as in the definition, then we can decide L in time 2O(p(n)) by enumerating all possible u and using M to check whether u is a valid certificate for input x. The machine accepts iff such a u is ever found. Since, p(n) = O(nc) for some c > 1, then the machine runs in 2O(nc) time.

slide-42
SLIDE 42

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

An alternate definition using NDTM

We say that an NDTM N runs in T(n) time if for every input x ∈ {0, 1}∗ and every sequence of non-deterministic choices, N reaches either the halting state or qacc within T(|x|) steps. Definition: The Class NTIME For every function T : N → N and L ⊆ {0, 1}∗, we say that L ∈ NTIME(T(n)) if there is a constant c > 0 and a cT(n)-time NDTM N such that for every x ∈ {0, 1}∗, x ∈ L ⇐ ⇒ M(x) = 1.

slide-43
SLIDE 43

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

An alternate definition using NDTM

We say that an NDTM N runs in T(n) time if for every input x ∈ {0, 1}∗ and every sequence of non-deterministic choices, N reaches either the halting state or qacc within T(|x|) steps. Definition: The Class NTIME For every function T : N → N and L ⊆ {0, 1}∗, we say that L ∈ NTIME(T(n)) if there is a constant c > 0 and a cT(n)-time NDTM N such that for every x ∈ {0, 1}∗, x ∈ L ⇐ ⇒ M(x) = 1. The following theorem shows the equivalence between the two definitions.

slide-44
SLIDE 44

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

An alternate definition using NDTM

We say that an NDTM N runs in T(n) time if for every input x ∈ {0, 1}∗ and every sequence of non-deterministic choices, N reaches either the halting state or qacc within T(|x|) steps. Definition: The Class NTIME For every function T : N → N and L ⊆ {0, 1}∗, we say that L ∈ NTIME(T(n)) if there is a constant c > 0 and a cT(n)-time NDTM N such that for every x ∈ {0, 1}∗, x ∈ L ⇐ ⇒ M(x) = 1. The following theorem shows the equivalence between the two definitions. Theorem: The Class NP NP =

c∈NNTIME(nc).

Proof Left as an exercise. The idea is that the sequence of non-deterministic choices made by an accepting computation of an NDTM can be viewed as a certificate that the input is in the language, and vice versa.

slide-45
SLIDE 45

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

NP Hardness and NP Completeness

Definition: NP Hardness B is NP-hard if A ≤P B for every A ∈ NP.

slide-46
SLIDE 46

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

NP Hardness and NP Completeness

Definition: NP Hardness B is NP-hard if A ≤P B for every A ∈ NP. Lemma If a language A is NP-hard and A ∈ P then P = NP.

slide-47
SLIDE 47

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

NP Hardness and NP Completeness

Definition: NP Hardness B is NP-hard if A ≤P B for every A ∈ NP. Lemma If a language A is NP-hard and A ∈ P then P = NP. Definition: NP Completeness B is NP-complete if B is NP-hard and B ∈ NP.

slide-48
SLIDE 48

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

NP Hardness and NP Completeness

Definition: NP Hardness B is NP-hard if A ≤P B for every A ∈ NP. Lemma If a language A is NP-hard and A ∈ P then P = NP. Definition: NP Completeness B is NP-complete if B is NP-hard and B ∈ NP. Lemma If a language A is NP-complete then A ∈ P iff P = NP.

slide-49
SLIDE 49

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

The Significance of Cook-Levin Theorem

How to prove NP-completeness? Show the problem A ∈ NP.

slide-50
SLIDE 50

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

The Significance of Cook-Levin Theorem

How to prove NP-completeness? Show the problem A ∈ NP. For any problem B that is NP-hard, show B ≤P A.

slide-51
SLIDE 51

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

The Significance of Cook-Levin Theorem

How to prove NP-completeness? Show the problem A ∈ NP. For any problem B that is NP-hard, show B ≤P A. What about the first problem that was proved to be NP-complete? That is the historical significance of Cook-Levin Theorem.

slide-52
SLIDE 52

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

The Significance of Cook-Levin Theorem

How to prove NP-completeness? Show the problem A ∈ NP. For any problem B that is NP-hard, show B ≤P A. What about the first problem that was proved to be NP-complete? That is the historical significance of Cook-Levin Theorem. Cook-Levin Theorem Let SAT be the language of all satisfiable CNF formulae. SAT is NP-complete.

slide-53
SLIDE 53

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

The Significance of Cook-Levin Theorem

How to prove NP-completeness? Show the problem A ∈ NP. For any problem B that is NP-hard, show B ≤P A. What about the first problem that was proved to be NP-complete? That is the historical significance of Cook-Levin Theorem. Cook-Levin Theorem Let SAT be the language of all satisfiable CNF formulae. SAT is NP-complete. Proof We will do it next day.

slide-54
SLIDE 54

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

3SAT is NP-complete

3SAT be the language of all satisfiable 3CNF formulae. 3SAT ∈ NP. Lemma SAT ≤P 3SAT Proof Map a CNF formula φ into a 3CNF formula ψ such that ψ is satisfiable iff φ is.

slide-55
SLIDE 55

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

3SAT is NP-complete

3SAT be the language of all satisfiable 3CNF formulae. 3SAT ∈ NP. Lemma SAT ≤P 3SAT Proof Map a CNF formula φ into a 3CNF formula ψ such that ψ is satisfiable iff φ is. Any clause C of size k > 3 can be changed to an equivalent pair of clauses C1 of size k − 1 and C2 of size 3 by using an additional auxiliary variable.

slide-56
SLIDE 56

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

3SAT is NP-complete

3SAT be the language of all satisfiable 3CNF formulae. 3SAT ∈ NP. Lemma SAT ≤P 3SAT Proof Map a CNF formula φ into a 3CNF formula ψ such that ψ is satisfiable iff φ is. Any clause C of size k > 3 can be changed to an equivalent pair of clauses C1 of size k − 1 and C2 of size 3 by using an additional auxiliary variable. Say C = x1 ∨ x2 ∨ x3 ∨ x4. Let C1 = x1 ∨ x2 ∨ z and C2 = x3 ∨ x4 ∨ z. Clearly, if C is true, then there is an assignment to z that satisfies both C1 and C2 and vice versa.

slide-57
SLIDE 57

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

INTEGER PROGRAMMING (IPROG) is NP-complete

For a set of linear inequalities with rational coefficients over variables x1, x2, . . . , xn is there an assignment of integer numbers in {0, 1, . . .} to x1, x2, . . . , xn that satisfies it. IPROG ∈ NP Lemma SAT ≤P IPROG

slide-58
SLIDE 58

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

INTEGER PROGRAMMING (IPROG) is NP-complete

For a set of linear inequalities with rational coefficients over variables x1, x2, . . . , xn is there an assignment of integer numbers in {0, 1, . . .} to x1, x2, . . . , xn that satisfies it. IPROG ∈ NP Lemma SAT ≤P IPROG Proof

slide-59
SLIDE 59

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

INTEGER PROGRAMMING (IPROG) is NP-complete

For a set of linear inequalities with rational coefficients over variables x1, x2, . . . , xn is there an assignment of integer numbers in {0, 1, . . .} to x1, x2, . . . , xn that satisfies it. IPROG ∈ NP Lemma SAT ≤P IPROG Proof Add the constraints 0 ≤ xi ≤ 1 for every i to ensure that the feasible assignments to the variables are only 0 and 1.

slide-60
SLIDE 60

Function Computation, Running Time Universal Turing Machines (UTM) Deterministic Time and the class P NP and NP completeness

INTEGER PROGRAMMING (IPROG) is NP-complete

For a set of linear inequalities with rational coefficients over variables x1, x2, . . . , xn is there an assignment of integer numbers in {0, 1, . . .} to x1, x2, . . . , xn that satisfies it. IPROG ∈ NP Lemma SAT ≤P IPROG Proof Add the constraints 0 ≤ xi ≤ 1 for every i to ensure that the feasible assignments to the variables are only 0 and 1. Now, express every clause as an inequality. As an example, the clause x1 ∨ x2 ∨ x3 can be expressed as (1 − x1) + x2 + (1 − x3) ≥ 1.