+ All Categories
Home > Documents > Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient...

Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient...

Date post: 10-Jul-2020
Category:
Upload: others
View: 0 times
Download: 0 times
Share this document with a friend
160
Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approxima Approximation Algorithms for Graphs Arijit Bishnu ([email protected]) Advanced Computing and Microelectronics Unit Indian Statistical Institute Kolkata 700108, India. Talk at NWCDMA, Jadavpur University, March 13, 2014
Transcript
Page 1: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Approximation Algorithms for Graphs

Arijit Bishnu([email protected])

Advanced Computing and Microelectronics UnitIndian Statistical Institute

Kolkata 700108, India.

Talk at NWCDMA, Jadavpur University, March 13, 2014

Page 2: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Organization

1 Polynomial-time reductions

2 Reductions via gadgets

3 Efficient certification and the class NP

4 NP-Complete problems

5 Approximation algorithms

Page 3: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Outline

1 Polynomial-time reductions

2 Reductions via gadgets

3 Efficient certification and the class NP

4 NP-Complete problems

5 Approximation algorithms

Page 4: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 5: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 6: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 7: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 8: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 9: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 10: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 11: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 12: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 13: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 14: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 15: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 16: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Polynomial-time reduction

Relative hardness among problems

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

Page 17: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Polynomial reductions

You have already done a polynomial reduction. Do youremember?

Bipartite Matching ≤P Max Flow

Let us do some more.

Page 18: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Polynomial reductions

You have already done a polynomial reduction. Do youremember?

Bipartite Matching ≤P Max Flow

Let us do some more.

Page 19: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Polynomial reductions

You have already done a polynomial reduction. Do youremember?

Bipartite Matching ≤P Max Flow

Let us do some more.

Page 20: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Polynomial reducibility is transitive

Transitivity of reductions

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

Page 21: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 22: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 23: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 24: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 27: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 28: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 29: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Outline

1 Polynomial-time reductions

2 Reductions via gadgets

3 Efficient certification and the class NP

4 NP-Complete problems

5 Approximation algorithms

Page 30: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 31: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 32: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 33: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 36: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 37: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 38: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 39: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 40: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 41: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 42: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 43: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 44: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 45: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 46: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 47: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 48: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 49: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 50: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 51: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 52: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

SAT ≤P VERTEX COVER: An example

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

Construct G as described above.

Page 57: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

SAT ≤P VERTEX COVER: An example

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

Construct G as described above.

Page 58: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

SAT ≤P VERTEX COVER: An example

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

Construct G as described above.

zyx zyx

Page 59: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 60: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 61: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 62: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 63: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 64: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 65: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 66: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 67: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 68: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

SAT ≤P VC

Theorem

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

Page 69: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Outline

1 Polynomial-time reductions

2 Reductions via gadgets

3 Efficient certification and the class NP

4 NP-Complete problems

5 Approximation algorithms

Page 70: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 71: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 72: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 73: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 74: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 75: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 76: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 77: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 80: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 81: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 82: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 83: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 84: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 85: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Outline

1 Polynomial-time reductions

2 Reductions via gadgets

3 Efficient certification and the class NP

4 NP-Complete problems

5 Approximation algorithms

Page 86: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 87: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 88: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 89: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 90: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 92: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 93: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 94: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 95: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 98: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 99: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 100: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 101: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

SAT NP-complete

SAT is NP-complete.

Page 106: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 107: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 108: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 109: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 110: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

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 114: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Outline

1 Polynomial-time reductions

2 Reductions via gadgets

3 Efficient certification and the class NP

4 NP-Complete problems

5 Approximation algorithms

Page 115: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Approximation ratio

Definition

An optimal solution OPTπ(I ) for an instance I of aminimization [maximization] problem π is a feasible solutionthat achieves the smallest [largest] objective function value.We would write OPT or OPT(I ) instead of OPTπ(I ).

Let π be a minimization [maximization] problem, and let δ bea function, δ : Z+ → Q+ with δ ≥ 1 [δ ≤ 1].

An algorithm A is said to be a factor δ approximationalgorithm for π if, on each instance I , A produces a feasiblesolution s for I such that

fπ(I , s) ≤ δ(|I |) · OPT(I ) [fπ(I , s) ≥ δ(|I |) · OPT(I )].

The running time of A is bounded by a fixed polynomial in |I |.

Page 116: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Approximation ratio

Definition

An optimal solution OPTπ(I ) for an instance I of aminimization [maximization] problem π is a feasible solutionthat achieves the smallest [largest] objective function value.We would write OPT or OPT(I ) instead of OPTπ(I ).

Let π be a minimization [maximization] problem, and let δ bea function, δ : Z+ → Q+ with δ ≥ 1 [δ ≤ 1].

An algorithm A is said to be a factor δ approximationalgorithm for π if, on each instance I , A produces a feasiblesolution s for I such that

fπ(I , s) ≤ δ(|I |) · OPT(I ) [fπ(I , s) ≥ δ(|I |) · OPT(I )].

The running time of A is bounded by a fixed polynomial in |I |.

Page 117: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Approximation ratio

Definition

An optimal solution OPTπ(I ) for an instance I of aminimization [maximization] problem π is a feasible solutionthat achieves the smallest [largest] objective function value.We would write OPT or OPT(I ) instead of OPTπ(I ).

Let π be a minimization [maximization] problem, and let δ bea function, δ : Z+ → Q+ with δ ≥ 1 [δ ≤ 1].

An algorithm A is said to be a factor δ approximationalgorithm for π if, on each instance I , A produces a feasiblesolution s for I such that

fπ(I , s) ≤ δ(|I |) · OPT(I ) [fπ(I , s) ≥ δ(|I |) · OPT(I )].

The running time of A is bounded by a fixed polynomial in |I |.

Page 118: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Approximation ratio

Definition

An optimal solution OPTπ(I ) for an instance I of aminimization [maximization] problem π is a feasible solutionthat achieves the smallest [largest] objective function value.We would write OPT or OPT(I ) instead of OPTπ(I ).

Let π be a minimization [maximization] problem, and let δ bea function, δ : Z+ → Q+ with δ ≥ 1 [δ ≤ 1].

An algorithm A is said to be a factor δ approximationalgorithm for π if, on each instance I , A produces a feasiblesolution s for I such that

fπ(I , s) ≤ δ(|I |) · OPT(I ) [fπ(I , s) ≥ δ(|I |) · OPT(I )].

The running time of A is bounded by a fixed polynomial in |I |.

Page 119: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Approximation ratio

Definition

An optimal solution OPTπ(I ) for an instance I of aminimization [maximization] problem π is a feasible solutionthat achieves the smallest [largest] objective function value.We would write OPT or OPT(I ) instead of OPTπ(I ).

Let π be a minimization [maximization] problem, and let δ bea function, δ : Z+ → Q+ with δ ≥ 1 [δ ≤ 1].

An algorithm A is said to be a factor δ approximationalgorithm for π if, on each instance I , A produces a feasiblesolution s for I such that

fπ(I , s) ≤ δ(|I |) · OPT(I ) [fπ(I , s) ≥ δ(|I |) · OPT(I )].

The running time of A is bounded by a fixed polynomial in |I |.

Page 120: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Approximation ratio

Definition

An optimal solution OPTπ(I ) for an instance I of aminimization [maximization] problem π is a feasible solutionthat achieves the smallest [largest] objective function value.We would write OPT or OPT(I ) instead of OPTπ(I ).

Let π be a minimization [maximization] problem, and let δ bea function, δ : Z+ → Q+ with δ ≥ 1 [δ ≤ 1].

An algorithm A is said to be a factor δ approximationalgorithm for π if, on each instance I , A produces a feasiblesolution s for I such that

fπ(I , s) ≤ δ(|I |) · OPT(I ) [fπ(I , s) ≥ δ(|I |) · OPT(I )].

The running time of A is bounded by a fixed polynomial in |I |.

Page 121: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Lower bounding idea for designing approximation algorithm

Lower bounding OPT

We have to fix a bound for δ, i.e. fπ(I ,s)OPT ≤ δ, but we know

nothing of OPT.

The technique is to lower bound OPT; i.e. find a k1 such thatOPT ≥ k1 and find a k2 such that fπ(I , s) ≤ k2. Then,fπ(I ,s)OPT ≤

k2k1

= δ.

Page 122: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Lower bounding idea for designing approximation algorithm

Lower bounding OPT

We have to fix a bound for δ, i.e. fπ(I ,s)OPT ≤ δ, but we know

nothing of OPT.

The technique is to lower bound OPT; i.e. find a k1 such thatOPT ≥ k1 and find a k2 such that fπ(I , s) ≤ k2. Then,fπ(I ,s)OPT ≤

k2k1

= δ.

Page 123: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Lower bounding idea for designing approximation algorithm

Lower bounding OPT

We have to fix a bound for δ, i.e. fπ(I ,s)OPT ≤ δ, but we know

nothing of OPT.

The technique is to lower bound OPT; i.e. find a k1 such thatOPT ≥ k1 and find a k2 such that fπ(I , s) ≤ k2. Then,fπ(I ,s)OPT ≤

k2k1

= δ.

Page 124: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Approximation algorithm for Vertex Cover

Some background preparation: Matching

Given a graph G = (V ,E ), a subset of the edges M ⊆ E issaid to be a matching if no two edges of M share an endpoint.

A matching of maximum cardinality in G is called a maximummatching, and a matching that is maximal under inclusion iscalled a maximal matching.

A maximal matching can be computed in polynomial time bysimply greedily picking edges and removing endpoints ofpicked edges.

Size of maximal matching in G provides a lower bound

Any vertex cover has to pick at least one endpoint of eachmatched edge.

Page 125: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Approximation algorithm for Vertex Cover

Some background preparation: Matching

Given a graph G = (V ,E ), a subset of the edges M ⊆ E issaid to be a matching if no two edges of M share an endpoint.

A matching of maximum cardinality in G is called a maximummatching, and a matching that is maximal under inclusion iscalled a maximal matching.

A maximal matching can be computed in polynomial time bysimply greedily picking edges and removing endpoints ofpicked edges.

Size of maximal matching in G provides a lower bound

Any vertex cover has to pick at least one endpoint of eachmatched edge.

Page 126: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Approximation algorithm for Vertex Cover

Some background preparation: Matching

Given a graph G = (V ,E ), a subset of the edges M ⊆ E issaid to be a matching if no two edges of M share an endpoint.

A matching of maximum cardinality in G is called a maximummatching, and a matching that is maximal under inclusion iscalled a maximal matching.

A maximal matching can be computed in polynomial time bysimply greedily picking edges and removing endpoints ofpicked edges.

Size of maximal matching in G provides a lower bound

Any vertex cover has to pick at least one endpoint of eachmatched edge.

Page 127: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Approximation algorithm for Vertex Cover

Some background preparation: Matching

Given a graph G = (V ,E ), a subset of the edges M ⊆ E issaid to be a matching if no two edges of M share an endpoint.

A matching of maximum cardinality in G is called a maximummatching, and a matching that is maximal under inclusion iscalled a maximal matching.

A maximal matching can be computed in polynomial time bysimply greedily picking edges and removing endpoints ofpicked edges.

Size of maximal matching in G provides a lower bound

Any vertex cover has to pick at least one endpoint of eachmatched edge.

Page 128: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Approximation algorithm for Vertex Cover

Some background preparation: Matching

Given a graph G = (V ,E ), a subset of the edges M ⊆ E issaid to be a matching if no two edges of M share an endpoint.

A matching of maximum cardinality in G is called a maximummatching, and a matching that is maximal under inclusion iscalled a maximal matching.

A maximal matching can be computed in polynomial time bysimply greedily picking edges and removing endpoints ofpicked edges.

Size of maximal matching in G provides a lower bound

Any vertex cover has to pick at least one endpoint of eachmatched edge.

Page 129: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Approximation algorithm for Vertex Cover

Algorithm for vertex cover

Algorithm:

Find a maximal matching M in G .

Output both the endpoints of M in G . Let this set of verticesbe V ′, i.e. |V ′| = 2 |M|.

Proof

No edge can be left uncovered, otherwise such an edge couldhave been added to the matching, contradicting itsmaximality.

Because of the lower bound, |M| ≤ OPT.

Our algorithm returned a vertex cover of size 2 |M|.Thus, the approximation ratio is 2.

Page 130: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Approximation algorithm for Vertex Cover

Algorithm for vertex cover

Algorithm:

Find a maximal matching M in G .

Output both the endpoints of M in G . Let this set of verticesbe V ′, i.e. |V ′| = 2 |M|.

Proof

No edge can be left uncovered, otherwise such an edge couldhave been added to the matching, contradicting itsmaximality.

Because of the lower bound, |M| ≤ OPT.

Our algorithm returned a vertex cover of size 2 |M|.Thus, the approximation ratio is 2.

Page 131: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Approximation algorithm for Vertex Cover

Algorithm for vertex cover

Algorithm:

Find a maximal matching M in G .

Output both the endpoints of M in G . Let this set of verticesbe V ′, i.e. |V ′| = 2 |M|.

Proof

No edge can be left uncovered, otherwise such an edge couldhave been added to the matching, contradicting itsmaximality.

Because of the lower bound, |M| ≤ OPT.

Our algorithm returned a vertex cover of size 2 |M|.Thus, the approximation ratio is 2.

Page 132: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Approximation algorithm for Vertex Cover

Algorithm for vertex cover

Algorithm:

Find a maximal matching M in G .

Output both the endpoints of M in G . Let this set of verticesbe V ′, i.e. |V ′| = 2 |M|.

Proof

No edge can be left uncovered, otherwise such an edge couldhave been added to the matching, contradicting itsmaximality.

Because of the lower bound, |M| ≤ OPT.

Our algorithm returned a vertex cover of size 2 |M|.Thus, the approximation ratio is 2.

Page 133: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Approximation algorithm for Vertex Cover

Algorithm for vertex cover

Algorithm:

Find a maximal matching M in G .

Output both the endpoints of M in G . Let this set of verticesbe V ′, i.e. |V ′| = 2 |M|.

Proof

No edge can be left uncovered, otherwise such an edge couldhave been added to the matching, contradicting itsmaximality.

Because of the lower bound, |M| ≤ OPT.

Our algorithm returned a vertex cover of size 2 |M|.Thus, the approximation ratio is 2.

Page 134: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Approximation algorithm for Vertex Cover

Algorithm for vertex cover

Algorithm:

Find a maximal matching M in G .

Output both the endpoints of M in G . Let this set of verticesbe V ′, i.e. |V ′| = 2 |M|.

Proof

No edge can be left uncovered, otherwise such an edge couldhave been added to the matching, contradicting itsmaximality.

Because of the lower bound, |M| ≤ OPT.

Our algorithm returned a vertex cover of size 2 |M|.Thus, the approximation ratio is 2.

Page 135: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Approximation algorithm for Vertex Cover

Algorithm for vertex cover

Algorithm:

Find a maximal matching M in G .

Output both the endpoints of M in G . Let this set of verticesbe V ′, i.e. |V ′| = 2 |M|.

Proof

No edge can be left uncovered, otherwise such an edge couldhave been added to the matching, contradicting itsmaximality.

Because of the lower bound, |M| ≤ OPT.

Our algorithm returned a vertex cover of size 2 |M|.

Thus, the approximation ratio is 2.

Page 136: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Approximation algorithm for Vertex Cover

Algorithm for vertex cover

Algorithm:

Find a maximal matching M in G .

Output both the endpoints of M in G . Let this set of verticesbe V ′, i.e. |V ′| = 2 |M|.

Proof

No edge can be left uncovered, otherwise such an edge couldhave been added to the matching, contradicting itsmaximality.

Because of the lower bound, |M| ≤ OPT.

Our algorithm returned a vertex cover of size 2 |M|.Thus, the approximation ratio is 2.

Page 137: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

TSP and Hamiltonian cycle

Hamiltonian (HAM) cycle

Given an undirected graph G = (V ,E ). does it have a cycle thatvisits each vertex exactly once?

TSP

Given a complete graph with nonnegative edge weights, find aminimum cost cycle visiting every vertex exactly once.

NP-complete

TSP and Hamiltonian cycle are NP-complete problems.

Page 138: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

TSP and Hamiltonian cycle

Hamiltonian (HAM) cycle

Given an undirected graph G = (V ,E ). does it have a cycle thatvisits each vertex exactly once?

TSP

Given a complete graph with nonnegative edge weights, find aminimum cost cycle visiting every vertex exactly once.

NP-complete

TSP and Hamiltonian cycle are NP-complete problems.

Page 139: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

TSP and Hamiltonian cycle

Hamiltonian (HAM) cycle

Given an undirected graph G = (V ,E ). does it have a cycle thatvisits each vertex exactly once?

TSP

Given a complete graph with nonnegative edge weights, find aminimum cost cycle visiting every vertex exactly once.

NP-complete

TSP and Hamiltonian cycle are NP-complete problems.

Page 140: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Approximation algorithm for (metric) Traveling SalesmanProblem

Inapproximability result for TSP

For any polynomial time computable function f (n), TSP cannot beapproximated within a factor of f (n), unless P=NP.

Proof

Assume, for a contradiction, there is a f (n)-factorapproximation algorithm, A for TSP. We show that A can beused for deciding the HAM cycle problem.

Use a HAM ≤P TSP as follows:

Assign a weight of 1 to edges of G and a weight of f (n) · n tononedges, to obtain G ′.

Page 141: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Approximation algorithm for (metric) Traveling SalesmanProblem

Inapproximability result for TSP

For any polynomial time computable function f (n), TSP cannot beapproximated within a factor of f (n), unless P=NP.

Proof

Assume, for a contradiction, there is a f (n)-factorapproximation algorithm, A for TSP. We show that A can beused for deciding the HAM cycle problem.

Use a HAM ≤P TSP as follows:

Assign a weight of 1 to edges of G and a weight of f (n) · n tononedges, to obtain G ′.

Page 142: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Approximation algorithm for (metric) Traveling SalesmanProblem

Inapproximability result for TSP

For any polynomial time computable function f (n), TSP cannot beapproximated within a factor of f (n), unless P=NP.

Proof

Assume, for a contradiction, there is a f (n)-factorapproximation algorithm, A for TSP. We show that A can beused for deciding the HAM cycle problem.

Use a HAM ≤P TSP as follows:

Assign a weight of 1 to edges of G and a weight of f (n) · n tononedges, to obtain G ′.

Page 143: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Approximation algorithm for (metric) Traveling SalesmanProblem

Inapproximability result for TSP

For any polynomial time computable function f (n), TSP cannot beapproximated within a factor of f (n), unless P=NP.

Proof

Assume, for a contradiction, there is a f (n)-factorapproximation algorithm, A for TSP. We show that A can beused for deciding the HAM cycle problem.

Use a HAM ≤P TSP as follows:

Assign a weight of 1 to edges of G and a weight of f (n) · n tononedges, to obtain G ′.

Page 144: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Approximation algorithm for (metric) Traveling SalesmanProblem

Inapproximability result for TSP

For any polynomial time computable function f (n), TSP cannot beapproximated within a factor of f (n), unless P=NP.

Proof

Assume, for a contradiction, there is a f (n)-factorapproximation algorithm, A for TSP. We show that A can beused for deciding the HAM cycle problem.

Use a HAM ≤P TSP as follows:

Assign a weight of 1 to edges of G and a weight of f (n) · n tononedges, to obtain G ′.

Page 145: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Proof continued

Proof continued

If G has a HAM cycle, then the corresponding tour in G ′ hascost n, and A should return a solution of cost ≤ f (n) · n.

If G has no HAM cycle, any tour in G ′ must use an edge ofcost f (n) · n, and therefore, A should return a solution of cost> f (n) · n.

Recall A runs in polynomial time. Thus, HAM cycle can bedecided in polynomial time, and P=NP.

Page 146: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Proof continued

Proof continued

If G has a HAM cycle, then the corresponding tour in G ′ hascost n, and A should return a solution of cost ≤ f (n) · n.

If G has no HAM cycle, any tour in G ′ must use an edge ofcost f (n) · n, and therefore, A should return a solution of cost> f (n) · n.

Recall A runs in polynomial time. Thus, HAM cycle can bedecided in polynomial time, and P=NP.

Page 147: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Proof continued

Proof continued

If G has a HAM cycle, then the corresponding tour in G ′ hascost n, and A should return a solution of cost ≤ f (n) · n.

If G has no HAM cycle, any tour in G ′ must use an edge ofcost f (n) · n, and therefore, A should return a solution of cost> f (n) · n.

Recall A runs in polynomial time. Thus, HAM cycle can bedecided in polynomial time, and P=NP.

Page 148: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Proof continued

Proof continued

If G has a HAM cycle, then the corresponding tour in G ′ hascost n, and A should return a solution of cost ≤ f (n) · n.

If G has no HAM cycle, any tour in G ′ must use an edge ofcost f (n) · n, and therefore, A should return a solution of cost> f (n) · n.

Recall A runs in polynomial time. Thus, HAM cycle can bedecided in polynomial time, and P=NP.

Page 149: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Approximation algorithm for metric TSP

Metric TSP

Given a complete graph G with nonnegative edge weights thatsatisfy triangle inequality, find a minimum cost cycle visiting everyvertex exactly once.Metric TSP is NP-complete but is approximable.

Approximation algorithm for metric TSP

Find an MST, T of G .

Double every edge of T to obtain an Eulerian graph G . (AnEulerian graph is one where all vertices can be visited bytraversing each edge exactly once.)

Find an Eulerian tour T of G.

Output the tour that visits vertices of G in order of their firstappearance (short cutting)in T . Let C be this tour.

Page 150: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Approximation algorithm for metric TSP

Metric TSP

Given a complete graph G with nonnegative edge weights thatsatisfy triangle inequality, find a minimum cost cycle visiting everyvertex exactly once.Metric TSP is NP-complete but is approximable.

Approximation algorithm for metric TSP

Find an MST, T of G .

Double every edge of T to obtain an Eulerian graph G . (AnEulerian graph is one where all vertices can be visited bytraversing each edge exactly once.)

Find an Eulerian tour T of G.

Output the tour that visits vertices of G in order of their firstappearance (short cutting)in T . Let C be this tour.

Page 151: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Approximation algorithm for metric TSP

Metric TSP

Given a complete graph G with nonnegative edge weights thatsatisfy triangle inequality, find a minimum cost cycle visiting everyvertex exactly once.Metric TSP is NP-complete but is approximable.

Approximation algorithm for metric TSP

Find an MST, T of G .

Double every edge of T to obtain an Eulerian graph G . (AnEulerian graph is one where all vertices can be visited bytraversing each edge exactly once.)

Find an Eulerian tour T of G.

Output the tour that visits vertices of G in order of their firstappearance (short cutting)in T . Let C be this tour.

Page 152: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Approximation algorithm for metric TSP

Metric TSP

Given a complete graph G with nonnegative edge weights thatsatisfy triangle inequality, find a minimum cost cycle visiting everyvertex exactly once.Metric TSP is NP-complete but is approximable.

Approximation algorithm for metric TSP

Find an MST, T of G .

Double every edge of T to obtain an Eulerian graph G . (AnEulerian graph is one where all vertices can be visited bytraversing each edge exactly once.)

Find an Eulerian tour T of G.

Output the tour that visits vertices of G in order of their firstappearance (short cutting)in T . Let C be this tour.

Page 153: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Approximation algorithm for metric TSP

Metric TSP

Given a complete graph G with nonnegative edge weights thatsatisfy triangle inequality, find a minimum cost cycle visiting everyvertex exactly once.Metric TSP is NP-complete but is approximable.

Approximation algorithm for metric TSP

Find an MST, T of G .

Double every edge of T to obtain an Eulerian graph G . (AnEulerian graph is one where all vertices can be visited bytraversing each edge exactly once.)

Find an Eulerian tour T of G.

Output the tour that visits vertices of G in order of their firstappearance (short cutting)in T . Let C be this tour.

Page 154: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Approximation algorithm for metric TSP

Metric TSP

Given a complete graph G with nonnegative edge weights thatsatisfy triangle inequality, find a minimum cost cycle visiting everyvertex exactly once.Metric TSP is NP-complete but is approximable.

Approximation algorithm for metric TSP

Find an MST, T of G .

Double every edge of T to obtain an Eulerian graph G . (AnEulerian graph is one where all vertices can be visited bytraversing each edge exactly once.)

Find an Eulerian tour T of G.

Output the tour that visits vertices of G in order of their firstappearance (short cutting)in T . Let C be this tour.

Page 155: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Approximation algorithm for metric TSP

Approximation ratio for metric TSP is 2

Use lower bound idea again. cost(T ) ≤ OPT as deleting anyedge from an optimal solution to TSP gives us a spanningtree.

T contains each edge of T twice, so cost(T ) = 2 · cost(T ).

Because of triangle inequality, after the short cutting step,cost(C) ≤ cost(T ).

Combining the above, we get cost(C) ≤ 2 · OPT.

Page 156: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Approximation algorithm for metric TSP

Approximation ratio for metric TSP is 2

Use lower bound idea again. cost(T ) ≤ OPT as deleting anyedge from an optimal solution to TSP gives us a spanningtree.

T contains each edge of T twice, so cost(T ) = 2 · cost(T ).

Because of triangle inequality, after the short cutting step,cost(C) ≤ cost(T ).

Combining the above, we get cost(C) ≤ 2 · OPT.

Page 157: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Approximation algorithm for metric TSP

Approximation ratio for metric TSP is 2

Use lower bound idea again. cost(T ) ≤ OPT as deleting anyedge from an optimal solution to TSP gives us a spanningtree.

T contains each edge of T twice, so cost(T ) = 2 · cost(T ).

Because of triangle inequality, after the short cutting step,cost(C) ≤ cost(T ).

Combining the above, we get cost(C) ≤ 2 · OPT.

Page 158: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Approximation algorithm for metric TSP

Approximation ratio for metric TSP is 2

Use lower bound idea again. cost(T ) ≤ OPT as deleting anyedge from an optimal solution to TSP gives us a spanningtree.

T contains each edge of T twice, so cost(T ) = 2 · cost(T ).

Because of triangle inequality, after the short cutting step,cost(C) ≤ cost(T ).

Combining the above, we get cost(C) ≤ 2 · OPT.

Page 159: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

Approximation algorithm for metric TSP

Approximation ratio for metric TSP is 2

Use lower bound idea again. cost(T ) ≤ OPT as deleting anyedge from an optimal solution to TSP gives us a spanningtree.

T contains each edge of T twice, so cost(T ) = 2 · cost(T ).

Because of triangle inequality, after the short cutting step,cost(C) ≤ cost(T ).

Combining the above, we get cost(C) ≤ 2 · OPT.

Page 160: Approximation Algorithms for Graphs · Polynomial-time reductionsReductions via gadgetsE cient certi cation and the class NPNP-Complete problemsApproximation algorithms Decision and

Polynomial-time reductions Reductions via gadgets Efficient certification and the class NP NP-Complete problems Approximation algorithms

At Last!!!

Thank you


Recommended