<<

1 Polynomial Time Reducibility

The question of whether P = NP is one of the greatest unsolved problems in the theoretical computer science. Two possibilities of relationship between P and NP

•P = NP; • P⊂NP.

Intuition of the reduction idea:

If a problem A is reducible to a problem B, an algorithm for solving B can be used to construct an algorithm for A.

If A is polynomially reducible to B, then a polyno- mial algorithm for B can be used to construct a polyno- mial algorithm for A.

1 Definition 1 Language A is polynomial time (map- ping) reducible to language B, written A ≤P B, if a polynomial time f :Σ∗ → Σ∗ exists, where for every w, w ∈ A iff f(w) ∈ B.

AB f

f A B

2 Theorem 1 If A ≤P B and B ≤P C, then A ≤P C.

Definition 2

A language is called NP-complete iff

1. L ∈NP; 2. for every language L′ ∈ NP, there is a polynomial- time mapping from L′ to L.

Proposition 1

Let L be an NP-complete language. Then P = NP iff L ∈P.

Theorem 2 SAT ≤P 3SAT .

Theorem 3 3SAT ≤p CLIQUE.

Corollary 1 SAT ≤P CLIQUE.

3 2 More Computational Classes

Class P of problems that can be decided in polynomial time on a deterministic Turing machine.

Class NP of problems that can be decided in polynomial time on a non-deterministic Turing machine.

Class CNP of NP-complete problems; a language A ∈NP is called NP-complete if ∀ B ∈NP

B ≤P A.

Class co-NP of problems {L} such that L ∈NP.

4 Definition 3 Two graphs G1(V1,E1) and G2(V2,E2) are called isomorphic if there is a one-to-one mapping f from V1 onto V2 such that

(x,y) ∈ E1 iff (f(x),f(y)) ∈ E2.

Graph Isomorphism Problem: Given two graphs G and H, is it true that they are isomorphic? This is a with a polynomial verifier.

A polynomial verifier is known to check if graphs are iso- morphic.

5 Graph Non-isomorphism Problem: Given two graphs G and H, is it true that they are not isomorphic? This is a decision problem for which no polynomial veri- fier was found. The complement to this problem belongs to NP; thus, the problem is in co-NP.

No polynomial verifier is known to check if two graphs are non-isomorphic.

6 3 Decision problems vs Optimization Problems

Example:

Clique (decision version): Given a graph G(V,E) and an integer k > 0, is there a clique of size k in G ?

L = {hG(V,E),ki : G contains a clique of size k}. Clique (optimization version): Given a graph G(V,E), find a clique in G of the maximal size.

Proposition 2 If A is an algorithm for the decision version of the Clique-problem, then O(log n) appli- cations of A solves the optimization version of the Clique-problem.

7 Problem 1 If A is an algorithm for the decision ver- sion of the Clique-problem, and A accepted hG(V,E),ki, how to find a clique of size k in G?

Solution idea:

Repeat

1. for every vertex v of G, apply A to hH,ki where H is the subgraph induced on the set containing v and its neighbors; 2. include into the clique the first v for which the application of A above yielded acceptance; Reset G to be the subgraph induced on the neighbors of v and k = k − 1.

8 Problem 2 If A is an algorithm for the decision ver- sion of the Partitioning-problem, and A accepted hS,Ci, how to find a subset T ⊆ S for which

X ai = C? ai∈T

Solution idea: Let S = {a1, a2,...,an}.

Repeat

1. find ai ∈ S for which A accepts

hS −{ai},C − aii;

include ai into T .

2. reset S and C by S = S−{ai} and C = C−ai.

9 4 Vertex Coloring

A k-vertex-coloring of a graph G(V,E) is a functioon f : V → [1,k], such that for any edge xy ∈ E, f(x) 6= f(y).

Vertex Color (decision version): Given a graph G(V,E) and an integer k > 0, is there a vertex coloring of G which uses ≤ k colors?

L = {hG(V,E),ki : G : there exists k vertex coloring.} Vertex Color (optimization version): Given a graph G(V,E), find a vertex-coloring of G which uses the smallest number of colors.

Proposition 3 If A is an algorithm for the decision version of Vertex Color, then O(log n) applications of A are sufficient to determine the smallest number k for which there exists a k-vertex- coloring of G.

Question: How to discover an optimal vertex-coloring?

10 Given an algorithm A for the decision version of Vertex_Color, we design a coloring algorithm Construct (G) which for every graph

G outputs a k coloring, where k is such that A accepted

yes is G complete? color G

no select non−adjacent pair xy.

Form graph G[x,y] by fusing x and y apply A yes is G k−colorable? Construct (G[x,y])

no Form graph H by Use k−coloring of G[x,y] adding xy to G to create k−coloring of G

Construct (H)

Use k−coloring of H to create k−coloring of G

11 Proposition 4 Let G be k-colorable and complete (any two vertiices are adjacent). Then, a k-coloring is ob- tained by the following rule: every vertex gets its own color. Proposition 5 Let G be k-colorable and not com- plete, and let x and y be two non-adjacent vertices in G. Form two graphs G[x,y] and H as follows: G[x,y]: remove x and y and add a new vertex [x,y] making it adjacent to vertices in G that were ad- jacent to x or to y; H: add edge xy to G.

Then there exists a k-coloring f of G iff at least one of the two options is correct: f(x)= f(y), in which case there is a k-coloring g of G[x,y] which preserves all colors and uses color f(x) for vertex [x,y]; f(x) 6= f(y), in which case there is a k-coloring h on H which preserves all colors of f on G. Theorem 4 Assume that every application of proce- dure A is executed in one time unit. Prove that under this assumption, there is a polynomial algorithm for k-vertex-coloring.

12