Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique...

118
Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT P 3SAT Polynomial-time Reduction: SAT P CL Introduction to NP-Completeness Arijit Bishnu ([email protected]) Advanced Computing and Microelectronics Unit Indian Statistical Institute Kolkata 700108, India.

Transcript of Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique...

Page 1: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Introduction to NP-Completeness

Arijit Bishnu([email protected])

Advanced Computing and Microelectronics UnitIndian Statistical Institute

Kolkata 700108, India.

Page 2: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Organization

1 Preliminaries

2 Polynomial-time reductions

3 Polynomial-time Reduction: SAT ≤P 3SAT

4 Polynomial-time Reduction: SAT ≤P CLIQUE

5 Polynomial-time Reduction: SAT ≤P VERTEX COVER

6 Efficient certification, Nondeterministic Algorithm and the classNP

7 NP-Complete problems

Page 3: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Outline

1 Preliminaries

2 Polynomial-time reductions

3 Polynomial-time Reduction: SAT ≤P 3SAT

4 Polynomial-time Reduction: SAT ≤P CLIQUE

5 Polynomial-time Reduction: SAT ≤P VERTEX COVER

6 Efficient certification, Nondeterministic Algorithm and the classNP

7 NP-Complete problems

Page 4: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Preliminaries

Contrapositive statementp =⇒ q ≡ ¬q =⇒ ¬p

How to prove the equality of two sets A and B?

Show A ⊆ B and B ⊆ A.

Problem vs Algorithm

Understanding a problem and an algorithm to solve that problem.

Deterministic polynomial time algorithm

What are they?

Page 5: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Preliminaries

Contrapositive statementp =⇒ q ≡ ¬q =⇒ ¬p

How to prove the equality of two sets A and B?

Show A ⊆ B and B ⊆ A.

Problem vs Algorithm

Understanding a problem and an algorithm to solve that problem.

Deterministic polynomial time algorithm

What are they?

Page 6: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Preliminaries

Contrapositive statementp =⇒ q ≡ ¬q =⇒ ¬p

How to prove the equality of two sets A and B?

Show A ⊆ B and B ⊆ A.

Problem vs Algorithm

Understanding a problem and an algorithm to solve that problem.

Deterministic polynomial time algorithm

What are they?

Page 7: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Preliminaries

Contrapositive statementp =⇒ q ≡ ¬q =⇒ ¬p

How to prove the equality of two sets A and B?

Show A ⊆ B and B ⊆ A.

Problem vs Algorithm

Understanding a problem and an algorithm to solve that problem.

Deterministic polynomial time algorithm

What are they?

Page 8: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Outline

1 Preliminaries

2 Polynomial-time reductions

3 Polynomial-time Reduction: SAT ≤P 3SAT

4 Polynomial-time Reduction: SAT ≤P CLIQUE

5 Polynomial-time Reduction: SAT ≤P VERTEX COVER

6 Efficient certification, Nondeterministic Algorithm and the classNP

7 NP-Complete problems

Page 9: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Decision and optimization versions

Clique: Decision and optimization versions

(Optimization version:) Given an undirected graphG = (V ,E ), find the clique – the largest complete subgraph.

(Decision version:) Given an undirected graph G = (V ,E ),does there exist a clique of size k?

Similarly, we have for independent set, vertex cover, chromaticnumber, etc.

Notice that the optimization versions and decision versions arepolynomially equivalent.

Consider any decision problem Π and any instance I of Π.The problem is to classify any such instance I to either a yesor no instance.

Page 10: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Decision and optimization versions

Clique: Decision and optimization versions

(Optimization version:) Given an undirected graphG = (V ,E ), find the clique – the largest complete subgraph.

(Decision version:) Given an undirected graph G = (V ,E ),does there exist a clique of size k?

Similarly, we have for independent set, vertex cover, chromaticnumber, etc.

Notice that the optimization versions and decision versions arepolynomially equivalent.

Consider any decision problem Π and any instance I of Π.The problem is to classify any such instance I to either a yesor no instance.

Page 11: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Decision and optimization versions

Clique: Decision and optimization versions

(Optimization version:) Given an undirected graphG = (V ,E ), find the clique – the largest complete subgraph.

(Decision version:) Given an undirected graph G = (V ,E ),does there exist a clique of size k?

Similarly, we have for independent set, vertex cover, chromaticnumber, etc.

Notice that the optimization versions and decision versions arepolynomially equivalent.

Consider any decision problem Π and any instance I of Π.The problem is to classify any such instance I to either a yesor no instance.

Page 12: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Decision and optimization versions

Clique: Decision and optimization versions

(Optimization version:) Given an undirected graphG = (V ,E ), find the clique – the largest complete subgraph.

(Decision version:) Given an undirected graph G = (V ,E ),does there exist a clique of size k?

Similarly, we have for independent set, vertex cover, chromaticnumber, etc.

Notice that the optimization versions and decision versions arepolynomially equivalent.

Consider any decision problem Π and any instance I of Π.The problem is to classify any such instance I to either a yesor no instance.

Page 13: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Decision and optimization versions

Clique: Decision and optimization versions

(Optimization version:) Given an undirected graphG = (V ,E ), find the clique – the largest complete subgraph.

(Decision version:) Given an undirected graph G = (V ,E ),does there exist a clique of size k?

Similarly, we have for independent set, vertex cover, chromaticnumber, etc.

Notice that the optimization versions and decision versions arepolynomially equivalent.

Consider any decision problem Π and any instance I of Π.The problem is to classify any such instance I to either a yesor no instance.

Page 14: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

The class P and beyond

The key idea

We encounter certain problems that are difficult to solve –seems that the problems are not tractable.

On the other hand, we have seen problems for which there areefficient solutions – solutions in polynomial time, polynomialin the input size.

The class P

Problems that have deterministic algorithms solving them inpolynomial time constitute the class of problems P.

Beyond the class P

How do we grade problems based on their difficulty level? Fromhere, starts the notion of polynomial-time reductions.

Page 15: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

The class P and beyond

The key idea

We encounter certain problems that are difficult to solve –seems that the problems are not tractable.

On the other hand, we have seen problems for which there areefficient solutions – solutions in polynomial time, polynomialin the input size.

The class P

Problems that have deterministic algorithms solving them inpolynomial time constitute the class of problems P.

Beyond the class P

How do we grade problems based on their difficulty level? Fromhere, starts the notion of polynomial-time reductions.

Page 16: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

The class P and beyond

The key idea

We encounter certain problems that are difficult to solve –seems that the problems are not tractable.

On the other hand, we have seen problems for which there areefficient solutions – solutions in polynomial time, polynomialin the input size.

The class P

Problems that have deterministic algorithms solving them inpolynomial time constitute the class of problems P.

Beyond the class P

How do we grade problems based on their difficulty level? Fromhere, starts the notion of polynomial-time reductions.

Page 17: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

The class P and beyond

The key idea

We encounter certain problems that are difficult to solve –seems that the problems are not tractable.

On the other hand, we have seen problems for which there areefficient solutions – solutions in polynomial time, polynomialin the input size.

The class P

Problems that have deterministic algorithms solving them inpolynomial time constitute the class of problems P.

Beyond the class P

How do we grade problems based on their difficulty level? Fromhere, starts the notion of polynomial-time reductions.

Page 18: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Polynomial-time reduction

Polynomial-time reducibility between decision problems Π and Π′

We say that Π reduces to Π′ in deterministic polynomial-time,symbolized as Π ≤P Π′, if there exists a deterministic polynomialtime algorithm A that takes I , an instance of Π, as input andtransforms it into I ′, an instance of Π′ such that I is a yes-instanceif and only if I ′ is an yes-instance.

An important offshoot of the above definition

Suppose Π ≤P Π′. If Π′ can be solved in polynomial time, then Πcan also be solved in polynomial time.

The contrapositive statement

Suppose Π ≤P Π′. If Π cannot be solved in polynomial time, thenΠ′ cannot be solved in polynomial time.

Page 19: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Polynomial-time reduction

Polynomial-time reducibility between decision problems Π and Π′

We say that Π reduces to Π′ in deterministic polynomial-time,symbolized as Π ≤P Π′, if there exists a deterministic polynomialtime algorithm A that takes I , an instance of Π, as input andtransforms it into I ′, an instance of Π′ such that I is a yes-instanceif and only if I ′ is an yes-instance.

An important offshoot of the above definition

Suppose Π ≤P Π′. If Π′ can be solved in polynomial time, then Πcan also be solved in polynomial time.

The contrapositive statement

Suppose Π ≤P Π′. If Π cannot be solved in polynomial time, thenΠ′ cannot be solved in polynomial time.

Page 20: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Polynomial-time reduction

Polynomial-time reducibility between decision problems Π and Π′

We say that Π reduces to Π′ in deterministic polynomial-time,symbolized as Π ≤P Π′, if there exists a deterministic polynomialtime algorithm A that takes I , an instance of Π, as input andtransforms it into I ′, an instance of Π′ such that I is a yes-instanceif and only if I ′ is an yes-instance.

An important offshoot of the above definition

Suppose Π ≤P Π′. If Π′ can be solved in polynomial time, then Πcan also be solved in polynomial time.

The contrapositive statement

Suppose Π ≤P Π′. If Π cannot be solved in polynomial time, thenΠ′ cannot be solved in polynomial time.

Page 21: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Polynomial-time reduction

Relative hardness among problems

Suppose Π ≤P Π′. Then Π′ is a harder problem than Π. Precisely,Π′ is at least as hard as Π.

Page 22: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Polynomial reducibility is transitive

Transitivity of reductions

If Π1 ≤P Π2, and Π2 ≤P Π3, then Π1 ≤P Π3.

Page 23: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Outline

1 Preliminaries

2 Polynomial-time reductions

3 Polynomial-time Reduction: SAT ≤P 3SAT

4 Polynomial-time Reduction: SAT ≤P CLIQUE

5 Polynomial-time Reduction: SAT ≤P VERTEX COVER

6 Efficient certification, Nondeterministic Algorithm and the classNP

7 NP-Complete problems

Page 24: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

SAT and 3SAT

Given a boolean formula f , we say that it is in CNF(Conjunctive Normal Form), if it is the conjunction (∧) ofclauses.

A clause is the disjunction (∨) of literals. A literal is aboolean variable or its negation.

A formula is said to be satisfiable if there is a truthassignment to its variables that makes it TRUE.

An example. f = (x1 ∨ x2)∧ (x1 ∨ x3 ∨ x4 ∨ x5)∧ (x1 ∨ x3 ∨ x4).If x1 and x3 are set to TRUE, then f is TRUE.

If the number of literals per clause is 3, then the booleanformula is a 3SAT formula.

Page 25: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

SAT and 3SAT

Given a boolean formula f , we say that it is in CNF(Conjunctive Normal Form), if it is the conjunction (∧) ofclauses.

A clause is the disjunction (∨) of literals. A literal is aboolean variable or its negation.

A formula is said to be satisfiable if there is a truthassignment to its variables that makes it TRUE.

An example. f = (x1 ∨ x2)∧ (x1 ∨ x3 ∨ x4 ∨ x5)∧ (x1 ∨ x3 ∨ x4).If x1 and x3 are set to TRUE, then f is TRUE.

If the number of literals per clause is 3, then the booleanformula is a 3SAT formula.

Page 26: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

SAT and 3SAT

Given a boolean formula f , we say that it is in CNF(Conjunctive Normal Form), if it is the conjunction (∧) ofclauses.

A clause is the disjunction (∨) of literals. A literal is aboolean variable or its negation.

A formula is said to be satisfiable if there is a truthassignment to its variables that makes it TRUE.

An example. f = (x1 ∨ x2)∧ (x1 ∨ x3 ∨ x4 ∨ x5)∧ (x1 ∨ x3 ∨ x4).If x1 and x3 are set to TRUE, then f is TRUE.

If the number of literals per clause is 3, then the booleanformula is a 3SAT formula.

Page 27: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

SAT and 3SAT

Given a boolean formula f , we say that it is in CNF(Conjunctive Normal Form), if it is the conjunction (∧) ofclauses.

A clause is the disjunction (∨) of literals. A literal is aboolean variable or its negation.

A formula is said to be satisfiable if there is a truthassignment to its variables that makes it TRUE.

An example. f = (x1 ∨ x2)∧ (x1 ∨ x3 ∨ x4 ∨ x5)∧ (x1 ∨ x3 ∨ x4).If x1 and x3 are set to TRUE, then f is TRUE.

If the number of literals per clause is 3, then the booleanformula is a 3SAT formula.

Page 28: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

SAT and 3SAT

Given a boolean formula f , we say that it is in CNF(Conjunctive Normal Form), if it is the conjunction (∧) ofclauses.

A clause is the disjunction (∨) of literals. A literal is aboolean variable or its negation.

A formula is said to be satisfiable if there is a truthassignment to its variables that makes it TRUE.

An example. f = (x1 ∨ x2)∧ (x1 ∨ x3 ∨ x4 ∨ x5)∧ (x1 ∨ x3 ∨ x4).If x1 and x3 are set to TRUE, then f is TRUE.

If the number of literals per clause is 3, then the booleanformula is a 3SAT formula.

Page 29: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

SAT ≤P 3SAT

Lemma

SAT ≤P 3SAT

Proof

Map a CNF formula φ into a 3CNF formula ψ such that ψ issatisfiable iff φ is.

Any clause C of size k > 3 can be changed to an equivalentpair of clauses C1 of size k − 1 and C2 of size 3 by using anadditional auxiliary variable.

Say C = x1 ∨ x2 ∨ x3 ∨ x4. Let C1 = x1 ∨ x2 ∨ z andC2 = x3 ∨ x4 ∨ z . Clearly, if C is true, then there is anassignment to z that satisfies both C1 and C2 and vice versa.

Page 30: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

SAT ≤P 3SAT

Lemma

SAT ≤P 3SAT

Proof

Map a CNF formula φ into a 3CNF formula ψ such that ψ issatisfiable iff φ is.

Any clause C of size k > 3 can be changed to an equivalentpair of clauses C1 of size k − 1 and C2 of size 3 by using anadditional auxiliary variable.

Say C = x1 ∨ x2 ∨ x3 ∨ x4. Let C1 = x1 ∨ x2 ∨ z andC2 = x3 ∨ x4 ∨ z . Clearly, if C is true, then there is anassignment to z that satisfies both C1 and C2 and vice versa.

Page 31: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

SAT ≤P 3SAT

Lemma

SAT ≤P 3SAT

Proof

Map a CNF formula φ into a 3CNF formula ψ such that ψ issatisfiable iff φ is.

Any clause C of size k > 3 can be changed to an equivalentpair of clauses C1 of size k − 1 and C2 of size 3 by using anadditional auxiliary variable.

Say C = x1 ∨ x2 ∨ x3 ∨ x4. Let C1 = x1 ∨ x2 ∨ z andC2 = x3 ∨ x4 ∨ z . Clearly, if C is true, then there is anassignment to z that satisfies both C1 and C2 and vice versa.

Page 32: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Outline

1 Preliminaries

2 Polynomial-time reductions

3 Polynomial-time Reduction: SAT ≤P 3SAT

4 Polynomial-time Reduction: SAT ≤P CLIQUE

5 Polynomial-time Reduction: SAT ≤P VERTEX COVER

6 Efficient certification, Nondeterministic Algorithm and the classNP

7 NP-Complete problems

Page 33: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Polynomial reductions: SAT ≤P CLIQUE

CLIQUE

Given an undirected graph G = (V ,E ) and a positive integer k ,does G contain a clique of size k?(A clique in G of size k is a complete subgraph of G on k vertices.)

The Polynomial Reduction

Given an instance of SAT f = C1 ∧ C2 ∧ . . . ∧ Cm with mclauses and n Boolean variables x1, . . . , xn,

we construct a graph G = (V ,E ), where V ≡ all occurrencesof the literals in f andE = {(xi , xj) | xi and xj are in two clauses and xi 6= xj}.The construction can be done in polynomial time.

Page 34: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Polynomial reductions: SAT ≤P CLIQUE

CLIQUE

Given an undirected graph G = (V ,E ) and a positive integer k ,does G contain a clique of size k?(A clique in G of size k is a complete subgraph of G on k vertices.)

The Polynomial Reduction

Given an instance of SAT f = C1 ∧ C2 ∧ . . . ∧ Cm with mclauses and n Boolean variables x1, . . . , xn,

we construct a graph G = (V ,E ), where V ≡ all occurrencesof the literals in f andE = {(xi , xj) | xi and xj are in two clauses and xi 6= xj}.The construction can be done in polynomial time.

Page 35: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Polynomial reductions: SAT ≤P CLIQUE

CLIQUE

Given an undirected graph G = (V ,E ) and a positive integer k ,does G contain a clique of size k?(A clique in G of size k is a complete subgraph of G on k vertices.)

The Polynomial Reduction

Given an instance of SAT f = C1 ∧ C2 ∧ . . . ∧ Cm with mclauses and n Boolean variables x1, . . . , xn,

we construct a graph G = (V ,E ), where V ≡ all occurrencesof the literals in f andE = {(xi , xj) | xi and xj are in two clauses and xi 6= xj}.The construction can be done in polynomial time.

Page 36: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Polynomial reductions: SAT ≤P CLIQUE

CLIQUE

Given an undirected graph G = (V ,E ) and a positive integer k ,does G contain a clique of size k?(A clique in G of size k is a complete subgraph of G on k vertices.)

The Polynomial Reduction

Given an instance of SAT f = C1 ∧ C2 ∧ . . . ∧ Cm with mclauses and n Boolean variables x1, . . . , xn,

we construct a graph G = (V ,E ), where V ≡ all occurrencesof the literals in f andE = {(xi , xj) | xi and xj are in two clauses and xi 6= xj}.

The construction can be done in polynomial time.

Page 37: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Polynomial reductions: SAT ≤P CLIQUE

CLIQUE

Given an undirected graph G = (V ,E ) and a positive integer k ,does G contain a clique of size k?(A clique in G of size k is a complete subgraph of G on k vertices.)

The Polynomial Reduction

Given an instance of SAT f = C1 ∧ C2 ∧ . . . ∧ Cm with mclauses and n Boolean variables x1, . . . , xn,

we construct a graph G = (V ,E ), where V ≡ all occurrencesof the literals in f andE = {(xi , xj) | xi and xj are in two clauses and xi 6= xj}.The construction can be done in polynomial time.

Page 38: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

SAT ≤P CLIQUE: An example

A SAT example f = (x ∨ y ∨ z) ∧ (x ∨ y) ∧ (x ∨ y ∨ z).

Construct G , where V ≡ all occurrences of literals in f andE = {(xi , xj) | xi and xj are in two diff. clauses and xi 6= xj}.

Page 39: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

SAT ≤P CLIQUE: An example

A SAT example f = (x ∨ y ∨ z) ∧ (x ∨ y) ∧ (x ∨ y ∨ z).

Construct G , where V ≡ all occurrences of literals in f andE = {(xi , xj) | xi and xj are in two diff. clauses and xi 6= xj}.

Page 40: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

SAT ≤P CLIQUE: An example

A SAT example f = (x ∨ y ∨ z) ∧ (x ∨ y) ∧ (x ∨ y ∨ z).

Construct G , where V ≡ all occurrences of literals in f andE = {(xi , xj) | xi and xj are in two diff. clauses and xi 6= xj}.

xy

z

y

x

x

y

z

Page 41: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

SAT ≤P CLIQUE: An example

A SAT example f = (x ∨ y ∨ z) ∧ (x ∨ y) ∧ (x ∨ y ∨ z).

Construct G , where V ≡ all occurrences of literals in f andE = {(xi , xj) | xi and xj are in two diff. clauses and xi 6= xj}.

xy

z

y

x

x

y

z

Page 42: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

SAT ≤P CLIQUE

Lemma

f is satisfiable =⇒ G has a clique of size m.

Proof

f is satisfiable =⇒ there is anoncontradictory assignment ofTRUE to m literals in m differentclauses.

By construction, there are edgesbetween all pairs of these mdifferent vertices, and hence, aclique of size m.

Page 43: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

SAT ≤P CLIQUE

Lemma

f is satisfiable =⇒ G has a clique of size m.

Proof

f is satisfiable =⇒ there is anoncontradictory assignment ofTRUE to m literals in m differentclauses.

By construction, there are edgesbetween all pairs of these mdifferent vertices, and hence, aclique of size m.

xy

z

y

x

x

y

z

Page 44: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

SAT ≤P CLIQUE

Lemma

f is satisfiable =⇒ G has a clique of size m.

Proof

f is satisfiable =⇒ there is anoncontradictory assignment ofTRUE to m literals in m differentclauses.

By construction, there are edgesbetween all pairs of these mdifferent vertices, and hence, aclique of size m.

xy

z

y

x

x

y

z

Page 45: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

SAT ≤P CLIQUE

Lemma

f is satisfiable =⇒ G has a clique of size m.

Proof

f is satisfiable =⇒ there is anoncontradictory assignment ofTRUE to m literals in m differentclauses.

By construction, there are edgesbetween all pairs of these mdifferent vertices, and hence, aclique of size m.

xy

z

y

x

x

y

z

Page 46: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

SAT ≤P CLIQUE

Lemma

G has a clique of size m =⇒ f is satisfiable.

Proof

G has a clique of size m =⇒assignment of TRUE to m literalsin m different clauses, and hence, fis satisfiable.

Theorem

f is satisfiable if and only if G has a clique of size m.

Page 47: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

SAT ≤P CLIQUE

Lemma

G has a clique of size m =⇒ f is satisfiable.

Proof

G has a clique of size m =⇒assignment of TRUE to m literalsin m different clauses, and hence, fis satisfiable.

xy

z

y

x

x

y

z

Theorem

f is satisfiable if and only if G has a clique of size m.

Page 48: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

SAT ≤P CLIQUE

Lemma

G has a clique of size m =⇒ f is satisfiable.

Proof

G has a clique of size m =⇒assignment of TRUE to m literalsin m different clauses, and hence, fis satisfiable.

xy

z

y

x

x

y

z

Theorem

f is satisfiable if and only if G has a clique of size m.

Page 49: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

SAT ≤P CLIQUE

Lemma

G has a clique of size m =⇒ f is satisfiable.

Proof

G has a clique of size m =⇒assignment of TRUE to m literalsin m different clauses, and hence, fis satisfiable.

xy

z

y

x

x

y

z

Theorem

f is satisfiable if and only if G has a clique of size m.

Page 50: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Outline

1 Preliminaries

2 Polynomial-time reductions

3 Polynomial-time Reduction: SAT ≤P 3SAT

4 Polynomial-time Reduction: SAT ≤P CLIQUE

5 Polynomial-time Reduction: SAT ≤P VERTEX COVER

6 Efficient certification, Nondeterministic Algorithm and the classNP

7 NP-Complete problems

Page 51: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

VERTEX COVER

VERTEX COVER

Given an undirected graph G = (V ,E ) and a positive integer k , isthere a subset C ⊆ V of size k such that each edge in E isincident to at least one vertex in C?(Such a set C is a vertex cover of G .)

Exercise

For a clique of n vertices, what is the size of minimum vertexcover?

Page 52: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Polynomial reductions: SAT ≤P VERTEX COVER

The Polynomial Reduction

Given an instance I of SAT f = C1 ∧ C2 ∧ . . . ∧ Cm with mclauses and n Boolean variables x1, . . . , xn,

we construct an instance I ′ of vertex cover as follows

for each Boolean variable xi ∈ f , G contains a pair of verticesxi and xi joined by an edge.

for each clause Cj containing nj literals, G contains a cliqueCj of size nj .

for each vertex w ∈ Cj , there is an edge connecting w to itscorresponding literal in the vertex pairs (xi , xi ) constructedearlier. These edges are called connection edges.

Let k = n +∑m

j=1(nj − 1). k is a part of the reduction.

The construction can be done in polynomial time.

Page 53: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Polynomial reductions: SAT ≤P VERTEX COVER

The Polynomial Reduction

Given an instance I of SAT f = C1 ∧ C2 ∧ . . . ∧ Cm with mclauses and n Boolean variables x1, . . . , xn,

we construct an instance I ′ of vertex cover as follows

for each Boolean variable xi ∈ f , G contains a pair of verticesxi and xi joined by an edge.

for each clause Cj containing nj literals, G contains a cliqueCj of size nj .

for each vertex w ∈ Cj , there is an edge connecting w to itscorresponding literal in the vertex pairs (xi , xi ) constructedearlier. These edges are called connection edges.

Let k = n +∑m

j=1(nj − 1). k is a part of the reduction.

The construction can be done in polynomial time.

Page 54: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Polynomial reductions: SAT ≤P VERTEX COVER

The Polynomial Reduction

Given an instance I of SAT f = C1 ∧ C2 ∧ . . . ∧ Cm with mclauses and n Boolean variables x1, . . . , xn,

we construct an instance I ′ of vertex cover as follows

for each Boolean variable xi ∈ f , G contains a pair of verticesxi and xi joined by an edge.

for each clause Cj containing nj literals, G contains a cliqueCj of size nj .

for each vertex w ∈ Cj , there is an edge connecting w to itscorresponding literal in the vertex pairs (xi , xi ) constructedearlier. These edges are called connection edges.

Let k = n +∑m

j=1(nj − 1). k is a part of the reduction.

The construction can be done in polynomial time.

Page 55: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Polynomial reductions: SAT ≤P VERTEX COVER

The Polynomial Reduction

Given an instance I of SAT f = C1 ∧ C2 ∧ . . . ∧ Cm with mclauses and n Boolean variables x1, . . . , xn,

we construct an instance I ′ of vertex cover as follows

for each Boolean variable xi ∈ f , G contains a pair of verticesxi and xi joined by an edge.

for each clause Cj containing nj literals, G contains a cliqueCj of size nj .

for each vertex w ∈ Cj , there is an edge connecting w to itscorresponding literal in the vertex pairs (xi , xi ) constructedearlier. These edges are called connection edges.

Let k = n +∑m

j=1(nj − 1). k is a part of the reduction.

The construction can be done in polynomial time.

Page 56: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Polynomial reductions: SAT ≤P VERTEX COVER

The Polynomial Reduction

Given an instance I of SAT f = C1 ∧ C2 ∧ . . . ∧ Cm with mclauses and n Boolean variables x1, . . . , xn,

we construct an instance I ′ of vertex cover as follows

for each Boolean variable xi ∈ f , G contains a pair of verticesxi and xi joined by an edge.

for each clause Cj containing nj literals, G contains a cliqueCj of size nj .

for each vertex w ∈ Cj , there is an edge connecting w to itscorresponding literal in the vertex pairs (xi , xi ) constructedearlier. These edges are called connection edges.

Let k = n +∑m

j=1(nj − 1). k is a part of the reduction.

The construction can be done in polynomial time.

Page 57: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Polynomial reductions: SAT ≤P VERTEX COVER

The Polynomial Reduction

Given an instance I of SAT f = C1 ∧ C2 ∧ . . . ∧ Cm with mclauses and n Boolean variables x1, . . . , xn,

we construct an instance I ′ of vertex cover as follows

for each Boolean variable xi ∈ f , G contains a pair of verticesxi and xi joined by an edge.

for each clause Cj containing nj literals, G contains a cliqueCj of size nj .

for each vertex w ∈ Cj , there is an edge connecting w to itscorresponding literal in the vertex pairs (xi , xi ) constructedearlier. These edges are called connection edges.

Let k = n +∑m

j=1(nj − 1). k is a part of the reduction.

The construction can be done in polynomial time.

Page 58: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Polynomial reductions: SAT ≤P VERTEX COVER

The Polynomial Reduction

Given an instance I of SAT f = C1 ∧ C2 ∧ . . . ∧ Cm with mclauses and n Boolean variables x1, . . . , xn,

we construct an instance I ′ of vertex cover as follows

for each Boolean variable xi ∈ f , G contains a pair of verticesxi and xi joined by an edge.

for each clause Cj containing nj literals, G contains a cliqueCj of size nj .

for each vertex w ∈ Cj , there is an edge connecting w to itscorresponding literal in the vertex pairs (xi , xi ) constructedearlier. These edges are called connection edges.

Let k = n +∑m

j=1(nj − 1). k is a part of the reduction.

The construction can be done in polynomial time.

Page 59: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Polynomial reductions: SAT ≤P VERTEX COVER

The Polynomial Reduction

Given an instance I of SAT f = C1 ∧ C2 ∧ . . . ∧ Cm with mclauses and n Boolean variables x1, . . . , xn,

we construct an instance I ′ of vertex cover as follows

for each Boolean variable xi ∈ f , G contains a pair of verticesxi and xi joined by an edge.

for each clause Cj containing nj literals, G contains a cliqueCj of size nj .

for each vertex w ∈ Cj , there is an edge connecting w to itscorresponding literal in the vertex pairs (xi , xi ) constructedearlier. These edges are called connection edges.

Let k = n +∑m

j=1(nj − 1). k is a part of the reduction.

The construction can be done in polynomial time.

Page 60: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

SAT ≤P VERTEX COVER: An example

A SAT example f = (x ∨ y ∨ z) ∧ (x ∨ y).

Construct G as described above.

Page 61: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

SAT ≤P VERTEX COVER: An example

A SAT example f = (x ∨ y ∨ z) ∧ (x ∨ y).

Construct G as described above.

Page 62: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

SAT ≤P VERTEX COVER: An example

A SAT example f = (x ∨ y ∨ z) ∧ (x ∨ y).

Construct G as described above.

zyx zyx

Page 63: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

SAT ≤P VERTEX COVER (VC)

Lemma

f is satisfiable =⇒ G has a vertex cover (VC) of size k .

Proof

If xi is assigned TRUE, add vertexxi to the VC; otherwise, add xi tothe VC.

Since f is satisfiable, in each cliqueCj there is a vertex w whosecorresponding literal is TRUE; so aconnection edge is covered. Weadd other nj − 1 vertices in each Cj

to the VC.

The size of the VC isk = n +

∑mj=1(nj − 1).

Page 64: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

SAT ≤P VERTEX COVER (VC)

Lemma

f is satisfiable =⇒ G has a vertex cover (VC) of size k .

Proof

If xi is assigned TRUE, add vertexxi to the VC; otherwise, add xi tothe VC.

Since f is satisfiable, in each cliqueCj there is a vertex w whosecorresponding literal is TRUE; so aconnection edge is covered. Weadd other nj − 1 vertices in each Cj

to the VC.

The size of the VC isk = n +

∑mj=1(nj − 1).

zyx zyx

Page 65: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

SAT ≤P VERTEX COVER (VC)

Lemma

f is satisfiable =⇒ G has a vertex cover (VC) of size k .

Proof

If xi is assigned TRUE, add vertexxi to the VC; otherwise, add xi tothe VC.

Since f is satisfiable, in each cliqueCj there is a vertex w whosecorresponding literal is TRUE; so aconnection edge is covered. Weadd other nj − 1 vertices in each Cj

to the VC.

The size of the VC isk = n +

∑mj=1(nj − 1).

zyx zyx

Page 66: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

SAT ≤P VERTEX COVER (VC)

Lemma

f is satisfiable =⇒ G has a vertex cover (VC) of size k .

Proof

If xi is assigned TRUE, add vertexxi to the VC; otherwise, add xi tothe VC.

Since f is satisfiable, in each cliqueCj there is a vertex w whosecorresponding literal is TRUE; so aconnection edge is covered. Weadd other nj − 1 vertices in each Cj

to the VC.

The size of the VC isk = n +

∑mj=1(nj − 1).

zyx zyx

Page 67: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

SAT ≤P VC

Lemma

G has a VC of size k =⇒ f is satisfiable.

Proof

At least one vertex of each edge(xi , xi ) must be in the VC. We areleft with k − n =

∑mj=1(nj − 1)

vertices.

For each clique Cj , pick the restnj − 1 vertices in the VC.

For each vertex xi , if it is in theVC, let xi be TRUE; else xi beFALSE. Thus for each clique, thereis a vertex having TRUE.

Page 68: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

SAT ≤P VC

Lemma

G has a VC of size k =⇒ f is satisfiable.

Proof

At least one vertex of each edge(xi , xi ) must be in the VC. We areleft with k − n =

∑mj=1(nj − 1)

vertices.

For each clique Cj , pick the restnj − 1 vertices in the VC.

For each vertex xi , if it is in theVC, let xi be TRUE; else xi beFALSE. Thus for each clique, thereis a vertex having TRUE.

zyx zyx

Page 69: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

SAT ≤P VC

Lemma

G has a VC of size k =⇒ f is satisfiable.

Proof

At least one vertex of each edge(xi , xi ) must be in the VC. We areleft with k − n =

∑mj=1(nj − 1)

vertices.

For each clique Cj , pick the restnj − 1 vertices in the VC.

For each vertex xi , if it is in theVC, let xi be TRUE; else xi beFALSE. Thus for each clique, thereis a vertex having TRUE.

zyx zyx

Page 70: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

SAT ≤P VC

Lemma

G has a VC of size k =⇒ f is satisfiable.

Proof

At least one vertex of each edge(xi , xi ) must be in the VC. We areleft with k − n =

∑mj=1(nj − 1)

vertices.

For each clique Cj , pick the restnj − 1 vertices in the VC.

For each vertex xi , if it is in theVC, let xi be TRUE; else xi beFALSE. Thus for each clique, thereis a vertex having TRUE.

zyx zyx

Page 71: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

SAT ≤P VC

Lemma

G has a VC of size k =⇒ f is satisfiable.

Proof

At least one vertex of each edge(xi , xi ) must be in the VC. We areleft with k − n =

∑mj=1(nj − 1)

vertices.

For each clique Cj , pick the restnj − 1 vertices in the VC.

For each vertex xi , if it is in theVC, let xi be TRUE; else xi beFALSE. Thus for each clique, thereis a vertex having TRUE.

zyx zyx

Page 72: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

SAT ≤P VC

Theorem

f is satisfiable if and only if G has a VC of size k .

Page 73: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Outline

1 Preliminaries

2 Polynomial-time reductions

3 Polynomial-time Reduction: SAT ≤P 3SAT

4 Polynomial-time Reduction: SAT ≤P CLIQUE

5 Polynomial-time Reduction: SAT ≤P VERTEX COVER

6 Efficient certification, Nondeterministic Algorithm and the classNP

7 NP-Complete problems

Page 74: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Understanding Certifier

Decision problem and strings

We identify a decision problem L with the set of strings x ∈ {0, 1}∗on which the answer is YES.

Definition: The Class NP

A decision problem L is in NP if ∃ a polynomial p : N→ N and apolynomial-time algorithm M such that for every string x ,

x ∈ L ⇐⇒ ∃ a short certificate u such that M(x , u) = YES

u is a short certificate if |u| = p(|x |).If x ∈ L and u ∈ {0, 1}p(|x |) satisfy M(x , u) = YES, then we call ua certificate for x (w.r.t. problem L and algorithm M).

Examples

Traveling Salesperson, Subset sum, IP, LP, Graph Isomorphism, etc.

Page 75: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Understanding Certifier

Decision problem and strings

We identify a decision problem L with the set of strings x ∈ {0, 1}∗on which the answer is YES.

Definition: The Class NP

A decision problem L is in NP if ∃ a polynomial p : N→ N and apolynomial-time algorithm M such that for every string x ,

x ∈ L ⇐⇒ ∃ a short certificate u such that M(x , u) = YES

u is a short certificate if |u| = p(|x |).If x ∈ L and u ∈ {0, 1}p(|x |) satisfy M(x , u) = YES, then we call ua certificate for x (w.r.t. problem L and algorithm M).

Examples

Traveling Salesperson, Subset sum, IP, LP, Graph Isomorphism, etc.

Page 76: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Understanding Certifier

Decision problem and strings

We identify a decision problem L with the set of strings x ∈ {0, 1}∗on which the answer is YES.

Definition: The Class NP

A decision problem L is in NP if ∃ a polynomial p : N→ N and apolynomial-time algorithm M such that for every string x ,

x ∈ L ⇐⇒ ∃ a short certificate u such that M(x , u) = YES

u is a short certificate if |u| = p(|x |).If x ∈ L and u ∈ {0, 1}p(|x |) satisfy M(x , u) = YES, then we call ua certificate for x (w.r.t. problem L and algorithm M).

Examples

Traveling Salesperson, Subset sum, IP, LP, Graph Isomorphism, etc.

Page 77: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

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 takestwo input arguments x , u.

There is a polynomial function p so that for every string x , wehave 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” uthat x ∈ L - provided they are not too long.

Page 78: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

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 takestwo input arguments x , u.

There is a polynomial function p so that for every string x , wehave 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” uthat x ∈ L - provided they are not too long.

Page 79: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

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 takestwo input arguments x , u.

There is a polynomial function p so that for every string x , wehave 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” uthat x ∈ L - provided they are not too long.

Page 80: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

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 takestwo input arguments x , u.

There is a polynomial function p so that for every string x , wehave 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” uthat x ∈ L - provided they are not too long.

Page 81: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

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 takestwo input arguments x , u.

There is a polynomial function p so that for every string x , wehave 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” uthat x ∈ L - provided they are not too long.

Page 82: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

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 takestwo input arguments x , u.

There is a polynomial function p so that for every string x , wehave 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” uthat x ∈ L - provided they are not too long.

Page 83: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

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 ifM(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.

Page 84: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

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 ifM(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.

Page 85: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

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 ifM(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.

Page 86: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

The class NP

The class NP

We define NP to be the set of all problems for which there existsan efficient certifier.

Relation between the class P and NP

P ⊆ NP

Relation between the class P and NP

Does P = NP? Or, is P ⊂ NP?

Page 87: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

The class NP

The class NP

We define NP to be the set of all problems for which there existsan efficient certifier.

Relation between the class P and NP

P ⊆ NP

Relation between the class P and NP

Does P = NP? Or, is P ⊂ NP?

Page 88: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

The class NP

The class NP

We define NP to be the set of all problems for which there existsan efficient certifier.

Relation between the class P and NP

P ⊆ NP

Relation between the class P and NP

Does P = NP? Or, is P ⊂ NP?

Page 89: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Outline

1 Preliminaries

2 Polynomial-time reductions

3 Polynomial-time Reduction: SAT ≤P 3SAT

4 Polynomial-time Reduction: SAT ≤P CLIQUE

5 Polynomial-time Reduction: SAT ≤P VERTEX COVER

6 Efficient certification, Nondeterministic Algorithm and the classNP

7 NP-Complete problems

Page 90: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

NP-Complete Problems

NP-complete problems

We are interested in defining the hardest problems in the classNP.

We use the notion of polynomial reducibility to do it.

A problem L is NP-complete if it satisfies the following:

L ∈ NP and∀L′ ∈ NP, L′ ≤P L.

Page 91: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

NP-Complete Problems

NP-complete problems

We are interested in defining the hardest problems in the classNP.

We use the notion of polynomial reducibility to do it.

A problem L is NP-complete if it satisfies the following:

L ∈ NP and∀L′ ∈ NP, L′ ≤P L.

Page 92: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

NP-Complete Problems

NP-complete problems

We are interested in defining the hardest problems in the classNP.

We use the notion of polynomial reducibility to do it.

A problem L is NP-complete if it satisfies the following:

L ∈ NP and∀L′ ∈ NP, L′ ≤P L.

Page 93: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

NP-Complete Problems

NP-complete problems

We are interested in defining the hardest problems in the classNP.

We use the notion of polynomial reducibility to do it.

A problem L is NP-complete if it satisfies the following:

L ∈ NP and

∀L′ ∈ NP, L′ ≤P L.

Page 94: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

NP-Complete Problems

NP-complete problems

We are interested in defining the hardest problems in the classNP.

We use the notion of polynomial reducibility to do it.

A problem L is NP-complete if it satisfies the following:

L ∈ NP and∀L′ ∈ NP, L′ ≤P L.

Page 95: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

NP-Complete Problems

NP-complete problems

Suppose L is an NP-complete problem. Then L is solvable inpolynomial time if and only if P = NP.

Proof

If P = NP, then L can be solved in polynomial time.

Suppose L can be solved in polynomial time. Now, fix aproblem L′ ∈ NP.

As L is NP-complete, L′ ≤P L. So, L′ can also be solved inpolynomial time and hence, L′ ∈ P and P ⊆ NP.

With P ⊆ NP already known, we have P = NP.

Page 96: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

NP-Complete Problems

NP-complete problems

Suppose L is an NP-complete problem. Then L is solvable inpolynomial time if and only if P = NP.

Proof

If P = NP, then L can be solved in polynomial time.

Suppose L can be solved in polynomial time. Now, fix aproblem L′ ∈ NP.

As L is NP-complete, L′ ≤P L. So, L′ can also be solved inpolynomial time and hence, L′ ∈ P and P ⊆ NP.

With P ⊆ NP already known, we have P = NP.

Page 97: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

NP-Complete Problems

NP-complete problems

Suppose L is an NP-complete problem. Then L is solvable inpolynomial time if and only if P = NP.

Proof

If P = NP, then L can be solved in polynomial time.

Suppose L can be solved in polynomial time. Now, fix aproblem L′ ∈ NP.

As L is NP-complete, L′ ≤P L. So, L′ can also be solved inpolynomial time and hence, L′ ∈ P and P ⊆ NP.

With P ⊆ NP already known, we have P = NP.

Page 98: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

NP-Complete Problems

NP-complete problems

Suppose L is an NP-complete problem. Then L is solvable inpolynomial time if and only if P = NP.

Proof

If P = NP, then L can be solved in polynomial time.

Suppose L can be solved in polynomial time. Now, fix aproblem L′ ∈ NP.

As L is NP-complete, L′ ≤P L. So, L′ can also be solved inpolynomial time and hence, L′ ∈ P and P ⊆ NP.

With P ⊆ NP already known, we have P = NP.

Page 99: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

NP-Complete Problems

NP-complete problems

Suppose L is an NP-complete problem. Then L is solvable inpolynomial time if and only if P = NP.

Proof

If P = NP, then L can be solved in polynomial time.

Suppose L can be solved in polynomial time. Now, fix aproblem L′ ∈ NP.

As L is NP-complete, L′ ≤P L. So, L′ can also be solved inpolynomial time and hence, L′ ∈ P and P ⊆ NP.

With P ⊆ NP already known, we have P = NP.

Page 100: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

NP-Complete Problems

NP-complete problems

Suppose L is an NP-complete problem. Then L is solvable inpolynomial time if and only if P = NP.

Proof

If P = NP, then L can be solved in polynomial time.

Suppose L can be solved in polynomial time. Now, fix aproblem L′ ∈ NP.

As L is NP-complete, L′ ≤P L. So, L′ can also be solved inpolynomial time and hence, L′ ∈ P and P ⊆ NP.

With P ⊆ NP already known, we have P = NP.

Page 101: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Proving new problems NP-complete

To prove a new problem L to be NP-complete,

polynomially reduce all problems in the class NP to L.

Is it feasible to do such a thing??

Proving new problems NP-complete

If L′ is an NP-complete problem, and a problem L ∈ NP with theproperty that L′ ≤P L, then L is NP-complete.

Proof

Fix any problem Z ∈ NP. As L′ is NP-complete, Z ≤P L′.

Now, use transitivity to show Z ≤P L′ ≤P L.

The first NP-complete problem

How do you get the first such problem Z? Cook Levin Theoremshows SAT to be such a problem.

Page 102: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Proving new problems NP-complete

To prove a new problem L to be NP-complete,

polynomially reduce all problems in the class NP to L.

Is it feasible to do such a thing??

Proving new problems NP-complete

If L′ is an NP-complete problem, and a problem L ∈ NP with theproperty that L′ ≤P L, then L is NP-complete.

Proof

Fix any problem Z ∈ NP. As L′ is NP-complete, Z ≤P L′.

Now, use transitivity to show Z ≤P L′ ≤P L.

The first NP-complete problem

How do you get the first such problem Z? Cook Levin Theoremshows SAT to be such a problem.

Page 103: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Proving new problems NP-complete

To prove a new problem L to be NP-complete,

polynomially reduce all problems in the class NP to L.

Is it feasible to do such a thing??

Proving new problems NP-complete

If L′ is an NP-complete problem, and a problem L ∈ NP with theproperty that L′ ≤P L, then L is NP-complete.

Proof

Fix any problem Z ∈ NP. As L′ is NP-complete, Z ≤P L′.

Now, use transitivity to show Z ≤P L′ ≤P L.

The first NP-complete problem

How do you get the first such problem Z? Cook Levin Theoremshows SAT to be such a problem.

Page 104: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Proving new problems NP-complete

To prove a new problem L to be NP-complete,

polynomially reduce all problems in the class NP to L.

Is it feasible to do such a thing??

Proving new problems NP-complete

If L′ is an NP-complete problem, and a problem L ∈ NP with theproperty that L′ ≤P L, then L is NP-complete.

Proof

Fix any problem Z ∈ NP. As L′ is NP-complete, Z ≤P L′.

Now, use transitivity to show Z ≤P L′ ≤P L.

The first NP-complete problem

How do you get the first such problem Z? Cook Levin Theoremshows SAT to be such a problem.

Page 105: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Proving new problems NP-complete

To prove a new problem L to be NP-complete,

polynomially reduce all problems in the class NP to L.

Is it feasible to do such a thing??

Proving new problems NP-complete

If L′ is an NP-complete problem, and a problem L ∈ NP with theproperty that L′ ≤P L, then L is NP-complete.

Proof

Fix any problem Z ∈ NP. As L′ is NP-complete, Z ≤P L′.

Now, use transitivity to show Z ≤P L′ ≤P L.

The first NP-complete problem

How do you get the first such problem Z? Cook Levin Theoremshows SAT to be such a problem.

Page 106: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Proving new problems NP-complete

To prove a new problem L to be NP-complete,

polynomially reduce all problems in the class NP to L.

Is it feasible to do such a thing??

Proving new problems NP-complete

If L′ is an NP-complete problem, and a problem L ∈ NP with theproperty that L′ ≤P L, then L is NP-complete.

Proof

Fix any problem Z ∈ NP. As L′ is NP-complete, Z ≤P L′.

Now, use transitivity to show Z ≤P L′ ≤P L.

The first NP-complete problem

How do you get the first such problem Z? Cook Levin Theoremshows SAT to be such a problem.

Page 107: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Proving new problems NP-complete

To prove a new problem L to be NP-complete,

polynomially reduce all problems in the class NP to L.

Is it feasible to do such a thing??

Proving new problems NP-complete

If L′ is an NP-complete problem, and a problem L ∈ NP with theproperty that L′ ≤P L, then L is NP-complete.

Proof

Fix any problem Z ∈ NP. As L′ is NP-complete, Z ≤P L′.

Now, use transitivity to show Z ≤P L′ ≤P L.

The first NP-complete problem

How do you get the first such problem Z? Cook Levin Theoremshows SAT to be such a problem.

Page 108: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Proving new problems NP-complete

To prove a new problem L to be NP-complete,

polynomially reduce all problems in the class NP to L.

Is it feasible to do such a thing??

Proving new problems NP-complete

If L′ is an NP-complete problem, and a problem L ∈ NP with theproperty that L′ ≤P L, then L is NP-complete.

Proof

Fix any problem Z ∈ NP. As L′ is NP-complete, Z ≤P L′.

Now, use transitivity to show Z ≤P L′ ≤P L.

The first NP-complete problem

How do you get the first such problem Z? Cook Levin Theoremshows SAT to be such a problem.

Page 109: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

SAT NP-complete

SAT is NP-complete.

Page 110: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Basic strategy for proving a problem L to be NP-complete

Prove that L ∈ NP.

Choose a problem L′ that is known to be NP-complete.

Prove that L′ ≤P L. Elaborating further, consider an arbitraryinstance xL′ of L′ and show how to construct, in polynomialtime, an instance xL of L that satisfies the followingproperties:

If xL′ is a YES instance of L′, then xL is a YES instance of L;If xL is a YES instance of L, then xL′ is a YES instance of L′;The above two steps ensure that xL′ and xL have the sameanswer.

Page 111: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Basic strategy for proving a problem L to be NP-complete

Prove that L ∈ NP.

Choose a problem L′ that is known to be NP-complete.

Prove that L′ ≤P L. Elaborating further, consider an arbitraryinstance xL′ of L′ and show how to construct, in polynomialtime, an instance xL of L that satisfies the followingproperties:

If xL′ is a YES instance of L′, then xL is a YES instance of L;If xL is a YES instance of L, then xL′ is a YES instance of L′;The above two steps ensure that xL′ and xL have the sameanswer.

Page 112: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Basic strategy for proving a problem L to be NP-complete

Prove that L ∈ NP.

Choose a problem L′ that is known to be NP-complete.

Prove that L′ ≤P L. Elaborating further, consider an arbitraryinstance xL′ of L′ and show how to construct, in polynomialtime, an instance xL of L that satisfies the followingproperties:

If xL′ is a YES instance of L′, then xL is a YES instance of L;If xL is a YES instance of L, then xL′ is a YES instance of L′;The above two steps ensure that xL′ and xL have the sameanswer.

Page 113: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Basic strategy for proving a problem L to be NP-complete

Prove that L ∈ NP.

Choose a problem L′ that is known to be NP-complete.

Prove that L′ ≤P L. Elaborating further, consider an arbitraryinstance xL′ of L′ and show how to construct, in polynomialtime, an instance xL of L that satisfies the followingproperties:

If xL′ is a YES instance of L′, then xL is a YES instance of L;If xL is a YES instance of L, then xL′ is a YES instance of L′;The above two steps ensure that xL′ and xL have the sameanswer.

Page 114: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Basic strategy for proving a problem L to be NP-complete

Prove that L ∈ NP.

Choose a problem L′ that is known to be NP-complete.

Prove that L′ ≤P L. Elaborating further, consider an arbitraryinstance xL′ of L′ and show how to construct, in polynomialtime, an instance xL of L that satisfies the followingproperties:

If xL′ is a YES instance of L′, then xL is a YES instance of L;

If xL is a YES instance of L, then xL′ is a YES instance of L′;The above two steps ensure that xL′ and xL have the sameanswer.

Page 115: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Basic strategy for proving a problem L to be NP-complete

Prove that L ∈ NP.

Choose a problem L′ that is known to be NP-complete.

Prove that L′ ≤P L. Elaborating further, consider an arbitraryinstance xL′ of L′ and show how to construct, in polynomialtime, an instance xL of L that satisfies the followingproperties:

If xL′ is a YES instance of L′, then xL is a YES instance of L;If xL is a YES instance of L, then xL′ is a YES instance of L′;

The above two steps ensure that xL′ and xL have the sameanswer.

Page 116: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

Basic strategy for proving a problem L to be NP-complete

Prove that L ∈ NP.

Choose a problem L′ that is known to be NP-complete.

Prove that L′ ≤P L. Elaborating further, consider an arbitraryinstance xL′ of L′ and show how to construct, in polynomialtime, an instance xL of L that satisfies the followingproperties:

If xL′ is a YES instance of L′, then xL is a YES instance of L;If xL is a YES instance of L, then xL′ is a YES instance of L′;The above two steps ensure that xL′ and xL have the sameanswer.

Page 117: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

NP-complete problems

As SAT is NP-complete, and3SAT ∈ NP and SAT ≤P 3SAT,

so 3SAT is NP-complete.

Similarly, CLIQUE and VERTEX COVER areNP-complete.

Page 118: Introduction to NP-Completenessarijit/courses/spring2019/npc-intro.pdf · does there exist a clique of size k? Similarly, we have forindependent set,vertex cover,chromatic number,

Preliminaries Polynomial-time reductions Polynomial-time Reduction: SAT ≤P 3SAT Polynomial-time Reduction: SAT ≤P CLIQUE Polynomial-time Reduction: SAT ≤P VERTEX COVER Efficient certification, Nondeterministic Algorithm and the class NP NP-Complete problems

At Last!!!

Thank you