• 検索結果がありません。

多項式時間還元可能性

N/A
N/A
Protected

Academic year: 2021

シェア "多項式時間還元可能性"

Copied!
38
0
0

読み込み中.... (全文を見る)

全文

(1)

6

章 多項式時間計算可能性の分析 第

6

章 多項式時間計算可能性の分析

6.1.

多項式時間還元可能性

定義

6.1:

A

B

を任意の集合とする.

(1)

関数

h: AÆB:

多項式時間還元

(polynomial-time reduction) (a) h

Σ

から

Σ

への全域的関数

(b)

(c) h

は多項式時間計算可能.

(2) A

から

B

への多項式時間還元が存在するとき,

A

B

へ多項式時間還元可能という

(polynomial time reducible).

このとき,次のように書く:

] )

( [

* x A h x B

xΣ

P

A m B

1/14

(2)

Chapter 6. Analysis on Polynomial-Time Computability

Chapter 6. Analysis on Polynomial-Time Computability

6.1. Polynomial-time Reducibility

Def.6.1:

Let A and B be arbitrary sets.

(1) function h: AÆB: polynomial-time reduction (a) h is a total function from Σonto Σ

(b)

(c) h is polynomial-time computable

(2) When there is a polynomial-time reduction from A to B

we say A is polynomial-time reducible to B.

Then

we denote by

] )

( [

* x A h x B

x Σ

P

A m B

1/14

(3)

6.2.

多項式時間還元可能性に基づく完全性

6.2.1.

完全性の定義とその基本的性質

定義

6.2:

計算量クラス

C

に対し,集合

A

が次の条件を満たすとき,

それを( の下で)

C-

完全という.

(a) L C [L A]

(b) A C

補注:条件

(a)

を満たす集合は

C-

困難.

P

m

Pm

7/14

6.5.

クラス

NP

の完全集合の例

3SAT, SAT, ExSAT, DHAM, KNAP, BIN, VC

など クラス

EXP

の完全集合

EVAL-IN-E, HALT-IN-E

など

(4)

6.2.Completeness based on Polynomial-time Reducibility

6.2.1. Definition of Completeness and its Basic Properties

Def.6.2: For a class C

if a set A satisfies the following conditions, then it is called C-complete (under )

(a) L C [L A]

(b) A C

Note

Sets satisfying the condition (a) are called C-hard

P

m

mP

7/14

Ex.6.5. Examples of NP-complete sets

3SAT, SAT, ExSAT, DHAM, KNAP, BIN, VC, etc EXP-complete sets

EVAL-IN-E, HALT-IN-E, etc.

(5)

定理

6.3.

任意の

C-

困難集合(含:

C-

完全集合)

A

に対し,

(1) A P Æ C

P

対偶は

C P Æ A P

(2) A NP Æ C

NP

対偶は

C NP Æ A NP

(3) A co-NP Æ C

co-NP

対偶は

C co-NP Æ A co-NP

(4) A EXP Æ C

EXP

対偶は

C EXP Æ A EXP

証明:

(1) B

を任意の

C

集合とすると,

A

C-

困難だから,

A

B mP

一方,

A P

の仮定より,

B P

(定理

6.1

(2), (3), (4)

も同様

9/14

(6)

Theorem 6.3. For any C-hard (or C-complete) set A

(1) A P Æ C

P CP: C P Æ A P

(2) A NP Æ C

NP CP: C NP Æ A NP

(3) A co-NP Æ C

co-NP CP: C co-NP Æ A co-NP (4) A EXP Æ C

EXP CP: C EXP Æ A EXP

Proof

CP: contraposition

(1) Let B be any C-set. Then, since A is C-hard,

A

B Pm and by the assumption A P we have B P

Th. 6.1

(2), (3), (4) are similar.

9/14

(7)

6.6.

定理

6.3

の意味(クラス

NP) A

NP-

完全集合とする.

定理

6.3(1)

の対偶より,

NP P Î A P

定理

6.3(3)

の対偶と定理

5.9(1)

の対偶より,

A co-NP

つまり,

NP-

完全集合は

P NP

である限り,

多項式時間では認識できない.

10/14

定理

5.9.

(1) NP

co-NP Æ NP = co-NP

定理

6.3.

任意の

C-

困難集合(含:

C-

完全集合)

A

に対し,

(1) A P Æ C

P

対偶は

C P Æ A P

(2) A NP Æ C

NP

対偶は

C NP Æ A NP

(3) A co-NP Æ C

co-NP

対偶は

C co-NP Æ A co-NP

(4) A EXP Æ C

EXP

対偶は

C EXP Æ A EXP

(8)

Ex.6.6: Meaning of Theorem 6.3

class NP) Let A be NP-complete set

By the contraposition of Theorem 6.3(1) we have NP P Î A P

By the contraposition of Theorem 6.3(3) and that of Theorem 5.9(1)

A co-NP

That is

NP-complete sets are NP-sets that cannot be recognized in polynomial time unless P = NP.

10/14

Theorem 5.9.

(1) NP

co-NP Æ NP = co-NP Theorem 6.3. For any C-hard (or C-complete) set A

(1) A P Æ C

P CP: C P Æ A P

(2) A NP Æ C

NP CP: C NP Æ A NP

(3) A co-NP Æ C

co-NP CP: C co-NP Æ A co-NP (4) A EXP Æ C

EXP CP: C EXP Æ A EXP

(9)

NP-

完全集合は

P NP

である限り,

NP co-NP

には入らない

NP

集合である.

NP

P

co-NP

NP

完全

co-NP

完全

11/14

(10)

NP-compete sets are NP-sets that do not belong to NP co-NP unless P = NP.

NP

P

co-NP

NP-complete

co-NP -complete

11/14

(11)

6.7.

定理

6.3

の意味(クラス

EXP) D

EXP-

完全集合とする.

定理

6.3(1)

の対偶(

C P Æ A P ,

ここでは

EXP P ÆD P) P EXP Æ EXP P ( P

EXP ) Æ D P

定理

6.3(2)

の対偶(

C NP Æ A NP,

ここでは

EXP NP ÆD NP )

NP EXP Æ EXP NP ( NP

EXP ) Æ D NP

定理

6.3(3)

の対偶(

C co-NP Æ A co-NP ,

ここでは

EXP co-NP ÆD co-NP )

co-NP EXP ÆEXP co-NP ÆD co-NP

ところが定理

5.7

から であるから,

D P.

EXP-

完全集合は多項式時間では計算不可能.

12/14

P yEXP

(12)

Ex. 6.7. Meaning of Theorem 6.3

class EXP) Let D be an EXP-complete set

Contraposition of Theorem 6.3(1)

C P Æ A P , where EXP P ÆD P ) P EXP Æ EXP P ( P

EXP ) Æ D P

Contraposition of Theorem 6.3(2)

C NP Æ A NP, Here, EXP NP ÆD NP )

NP EXP Æ EXP NP ( NP

EXP ) Æ D NP

Contraposition of Theorem 6.3(3)

C co-NP Æ A co-NP , here, EXP co-NP ÆD co-NP )

co-NP EXP ÆEXP co-NP ÆD co-NP

But

by Theorem 5.7

since we know

we have D P.

EXP-complete sets are not computable in polynomial time

12/14

P yEXP

(13)

定理

6.4. A:

任意の

C-

完全集合 すべての集合

B

に対し,

(1) A B ÆB

C-

困難.

(2) A B B C Æ B

C-

完全.

P

m P

m

証明:

定義

6.2

より,

定理

6.2

より,

したがって,

すなわち,

B

C-

困難.

[ ]

[ ]

P m

P P P

m m m

P m

L L A

L A A B L B

L L B

∀ ∈

∧ ≤

∀ ∈ C

C

13/14

(14)

Theorem 6.4. A: any C-complete set For any set B we have

(1) A B ÆB is C-hard.

(2) A B B C Æ B is C-complete

P

m P

m

Proof

By Def. 6.2

By Theorem 6.2

Therefore

That is

B is C-hard

13/14

[ ]

[ ]

P m

P P P

m m m

P m

L L A

L A A B L B

L L B

∀ ∈

∧ ≤

∀ ∈ C

C

(15)

EXPC {L: L

EXP-

完全

} NPC {L: L

NP-

完全

}

とすると,次の定理が成り立つ.

定理

6.5.

(1) EXPC P = φ

(2) EXP – (EXPC P) φ

EXP

EXPC

P

定理

6.6: P NP

を仮定すると

(1) NPC P = φ

(2) NP – (NPC P) φ

NP

NPC

P

NPco-NP

}

14/14

(16)

EXPC {L: L is EXP-complete}

NPC {L: L is NP-complete}

Then, we have the following theorems

Theorem 6.5.

(1) EXPC P = φ

(2) EXP – (EXPC P) φ

EXP

EXPC

P Theorem 6.6: Assuming P NP

(1) NPC P = φ

(2) NP – (NPC P) φ

NP

NPC

P

NPco-NP

}

14/14

(17)

6.2.2.

完全性の証明

(NP)

完全性の証明方法

(I)

定義通りに

[

すべての

L]

について示す

(II)

すでに完全であることがわかっている問題を利用する

(I)

の例

:

定理

6.7,

定理

6.9(

Cook

の定理

(SAT

TM

を模倣

))

(II)

の例

:

6.4(3SAT DHAM),

定理

6.10, … DHAM

は一般のグラフ上でNP完全

DHAM

は平面グラフに限定しても

NP

完全

DHAM

は「頂点の次数=

3

」に限定しても

NP

完全

DHAM

2

部グラフに限定しても

NP

完全

1/11

P

m

基本的には

1. 多項式時間で動く標準プログラムを考えて 2. プログラムの動作を命題論理式で模倣する

→とても大変

(

手間がかかる

) 3SAT

などは、形式

が一様なので扱い

やすい

(18)

6.2.2. Proof for completeness

Two ways to prove (NP-)completeness

(I) show ‘for all L’ according to definition (II) use some known complete problems Ex for (I) : Theorem 6.7,

Theorem 6.9(

Cook’s Theorem; simulate TM by SAT)

Ex for (II): Example 6.4(3SAT DHAM), Theorem 6.10, … DHAM is NP-complete for general graphs

DHAM is NP-complete even for planar graphs

DHAM is NP-complete even for graphs with max degree=3 DHAM is NP-complete even for bipartite graphs …

1/11

P

m

Basically…

1. For any program in standard form, 2. simulate it by SAT formulae

pretty complicated and tedious Easy to manipulate

since, e.g., 3SAT has a uniform structure.

(19)

定理

6.10:

以下にあげる集合はすべて

NP-

完全

(1) 3SAT, SAT (ExSAT

からの還元)

(2) DHAM, VC (3SAT

からの還元)

(3) KNAP, BIN (3SAT

からの還元と

KNAP BIN)mP

2/11

(II) NP

完全性がわかっている問題からの多項式時間還元

: 1. 3SAT VC

2. DHAM mP

頂点の次数が高々

5

に制限された

DHAM

P

m

Vertex Cover:

すべての辺の、少なくとも一方の頂点を含む集合

Hamiltonian cycle:

すべての頂点を一度ずつ通る閉路

おまけ

: DHAM

は次数高々

3

でも

NP

完全。

高々

2

だと多項式時間で計算可能。

(20)

Theorem 6.10 The following sets are all NP-complete:

(1) 3SAT, SAT (reduction from ExSAT

(2) DHAM, VC (reduction from 3SAT

(3) KNAP, BIN (reduction from 3SAT and KNAP BIN)mP

(II) Polynomial time reductions from NP-complete problems:

1. 3SAT VC

2. DHAM DHAM with vertices of degree mP

5

P

m

2/11

Vertex Cover: a vertex set that contains

at least one endpoint for each edge

Hamiltonian cycle: a cycle that visits each vertex exactly once

Note : DHAM remains NP-complete even if max degree 3.

But it is polynomial time solvable if max degree 2.

(21)

定理

6.10(2) : VC

NP

完全問題

P

m

3/11

[

証明

] VC

NP

なので、

3SAT VC

であることを示せばよい。

論理式

F(x1,x2,…,xn)

が与えられたとする。

F

から以下の条件を満たすグラフと自然数の組

<G, k>

が 多項式時間で構成できることを示す:

F

1

にする割当が存在する⇔

G

がサイズ

k

の頂点被覆を持つ

G

の構成

(F

n

変数

m

項とする

):

1. F

の各変数

xi

に対し、頂点

xi+,xi-

と、辺

(xi+,xi-)

を加える

2. F

の各項

Cj=(li1

li2

li3)

に対し、頂点

li1, li2, li3

と辺

(li1,li2), (li2,li3), (li3,li1)

を加える

3.

Cj

のリテラル

li1

xi

のときは辺

(li1,xi+)

を、¬

xi

のときは辺

(li1,xi-)

を加える。

4. k = n+2m

(22)

Theorem 6.10(2) : VC is NP-complete

3/11

[Proof] Since VC

NP, we show 3SAT VC.

For given formula F(x1,x2,…,xn), we construct a pair <G,k>

of a graph and an integer in polynomial time.

There is an assignment that makes F()=1

G has a vertex cover of size k

Construction of G (F has n variables and m clauses):

1. add vertices xi+,xi- and the edge (xi+,xi-) for each variable xi in F 2. For each clause Cj=(li1

li2

li3) in F, add vertices li1, li2, li3 and

three edges (li1,li2), (li2,li3), (li3,li1)

3. add the edge (li1,xi+) if the literal li1 is xi, or add (li1,xi-) if it is

xi for each clause Cj

4. let k = n+2m

P

m

(23)

F

1

にする割当が存在する⇔

G

がサイズ

k

の頂点被覆を持つ

G

の構成

(F

n

変数

m

項とする

):

1. F

の各変数

xi

に対し、頂点

xi+,xi-

と、辺

(xi+,xi-)

を加える

2. F

の各項

Cj=(li1

li2

li3)

に対し、頂点

li1, li2, li3

と辺

(li1,li2), (li2,li3), (li3,li1)

を加える

3.

Cj

のリテラル

li1

xi

のときは辺

(li1,xi+)

を、¬

xi

のときは 辺

(li1,xi-)

を加える。

4. k = n+2m

: F(x1,x2,x3,x4) = (x1

x2

x3)

(

x1

x3

x4)

(x1

∨¬

x3

x4) x1+ x1- x2+ x2- x3+ x3- x4+ x4-

x1

x2 x3

x1 x3 x4

x1

x3 x4

G k = 4+2

×

3=10

4/11

(24)

Ex: F(x1,x2,x3,x4) = (x1

x2

x3)

(

x1

x3

x4)

(x1

∨¬

x3

x4) x1+ x1- x2+ x2- x3+ x3- x4+ x4-

x1

x2 x3

x1 x3 x4

x1

x3 x4

G k = 4+2

×

3=10

4/11 There is an assignment that makes F()=1

G has a vertex cover of size k

Construction of G (F has n variables and m clauses):

1. add vertices xi+,xi- and the edge (xi+,xi-) for each variable xi in F 2. For each clause Cj=(li1

li2

li3) in F, add vertices li1, li2, li3 and

three edges (li1,li2), (li2,li3), (li3,li1)

3. add the edge (li1,xi+) if the literal li1 is xi, or add (li1,xi-) if it is

xi for each clause Cj

4. let k = n+2m

(25)

F

1

にする割当が存在する⇔

G

がサイズ

k

の頂点被覆を持つ

G

の構成は、与えられた

F

から

F

のサイズに対する多項式時間

で可能 。したがって以下を示せばよい

:

: F(x1,x2,x3,x4) = (x1

x2

x3)

(

x1

x3

x4)

(x1

∨¬

x3

x4) x1+ x1- x2+ x2- x3+ x3- x4+ x4-

x1

x2 x3

x1 x3 x4

x1

x3 x4

G k = 4+2

×

3=10

G

の構成から任意の頂点被覆

S

xi+,xi-

のどちらかを含む

Cj

3

頂点中、最低

2

つ含む よって

|S|

n+2m = k

である。

観察

:

5/11

(26)

It is easy to see that the construction of G from F can be done in polynomial time of the size of F. Hence, we show that…

Ex: F(x1,x2,x3,x4) = (x1

x2

x3)

(

x1

x3

x4)

(x1

∨¬

x3

x4) x1+ x1- x2+ x2- x3+ x3- x4+ x4-

x1

x2 x3

x1 x3 x4

x1

x3 x4

G k = 4+2

×

3=10

From the construction of G,

any vertex cover S should contain

at least one of xi+ or xi-

at least 2 of 3 vertices in Cj Hence we have |S|

n+2m = k.

Observation:

5/11

There is an assignment that makes F()=1

G has a vertex cover of size k

x1

(27)

F

1

にする割当が存在する⇒

G

がサイズ

k

の頂点被覆を持つ

: F(x1,x2,x3,x4) = (x1

x2

x3)

(

x1

x3

x4)

(x1

∨¬

x3

x4) x1+ x1- x2+ x2- x3+ x3- x4+ x4-

x1

x2 x3

x1 x3 x4

x1

x3 x4

G k = 4+2

×

3=10

1.

それぞれの変数

xi

xi=1

なら

xi+

S

に入れる

xi=0

なら

xi-

S

に入れる

2.

それぞれの項

Cj=(li1,li2,li3)

は充足されているので、

最低

1

つのリテラル

(li1)

については変数との間の辺

(li1,xi1)

xi1

によって被覆されている。したがって、それ以外の 二つのリテラル

(li2,li3)

S

に入れる。

観察 より、S はサイズ

k

の頂点被覆になる。

6/11

(28)

Ex: F(x1,x2,x3,x4) = (x1

x2

x3)

(

x1

x3

x4)

(x1

∨¬

x3

x4) x1+ x1- x2+ x2- x3+ x3- x4+ x4-

x1

x2 x3

x1 x3 x4

x1

x3 x4

G k = 4+2

×

3=10

1. Put xi+ if xi=1

into S for each xi.

2. Since each clause Cj=(li1,li2,li3) is satisfied, at least one literal, say li1, the edge (li1,xi1) is covered by the variable xi1. Therefore, put the remaining literals (li2,li3) into S.

Observation, S is a vertex cover of size k.

If there is an assignment that makes F()=1, 6/11 G has a vertex cover of size k

xi- if xi=0

From the

(29)

G

がサイズ

k

の頂点被覆を持つ⇒

F

1

にする割当が存在する

: F(x1,x2,x3,x4) = (x1

x2

x3)

(

x1

x3

x4)

(x1

∨¬

x3

x4) x1+ x1- x2+ x2- x3+ x3- x4+ x4-

x1

x2 x3

x1 x3 x4

x1

x3 x4

G k = 4+2

×

3=10

1.

2.

さらに各変数

xi

については

xi+

xi-

の一方しか、

各項

Cj

についてはちょうど

2

つの頂点しか

S

に含むことができない。

観察 より、被覆S は項から

2m

個、変数から

n

個の頂点を含む。

xi+

S

に含まれるなら

xi=1

xi-

S

に含まれるなら

xi=0

という割当は

F

を充足する。

3.

よって各項

Cj

S

に含まれないリテラル

li

を含むが、

これに付随する辺は他方が被覆されていなければならない。

QED.

7/11

(30)

Ex: F(x1,x2,x3,x4) = (x1

x2

x3)

(

x1

x3

x4)

(x1

∨¬

x3

x4) x1+ x1- x2+ x2- x3+ x3- x4+ x4-

x1

x2 x3

x1 x3 x4

x1

x3 x4

G k = 4+2

×

3=10

1. From Observation,

xi=1 if xi+ in S

xi=0 if xi- in S The following assignment satisfies F:

QED.

7/11 If G has a vertex cover of size k, there is an assignment s.t. F()=1

a cover S contains 2m vertices from the clauses, and n vertices from the variables.

3. Hence each clause Cj contains exactly one literal li which is not in S, and hence incident edge should be covered by a variable vertex.

2. Thus the cover S contains exactly one of xi+ and xi- and exactly two literals of a clause Cj.

x1

(31)

充足できない例

:

F(x1,x2,x3) = (x1

x1

x1)

(

x1

∨¬

x2

∨¬

x2)

(x2

x3

x3)

(

x1

x2

∨¬

x3)

x1+ x1- x2+ x2- x3+ x3-

x1

x1 x1

x1

x2

x2

x2

x3 x3 G

k = 3+2

×

4=11 8/11

x1

x2

x3

充足できない

F

では、どのリテラルも頂点でカバーされていない 項が必ず存在する。この項のリテラルは

3

つとも

Vertex Cover

入れざるを得ない。よって

Vertex Cover

のサイズは

k+1

以上になる。

(32)

Unsatisfiable example:

F(x1,x2,x3) = (x1

x1

x1)

(

x1

∨¬

x2

∨¬

x2)

(x2

x3

x3)

(

x1

x2

∨¬

x3)

x1+ x1- x2+ x2- x3+ x3-

x1

x1 x1

x1

x2

x2

x2

x3 x3 G

k = 3+2

×

4=11 8/11

x1

x2

x3

When F is unsatisfiable, it contains at least one clause such that each literal is not covered by a vertex. So, Vertex Cover should

contain three literals in the clause. Hence any vertex cover has size at least k+1.

(33)

定理

:

次数高々

5

の有向グラフ上の

DHAM

NP

完全問題

P

m

[

証明

] (

上記の問題を

DHAM5

と略記する

)

DHAM5

NP

に属するのは、

DHAM

NP

属することから自明。したがって完全性を示せばよい。

DHAM DHAM5

を示す。

次数

:

頂点に付 随する辺の本数

v

v

アイデア

:

次数

14

の頂点

v(

)

(

入ってくる辺集合

)

(

出ていく辺集合

)

を右図 の

`gadget’

で置き換える 左図で

v

1

度だけ通る 閉路と右図で

v

1

度だ け通る閉路は対応する。

v

v

9/11

(34)

Theorem: DHAM on a directed graph with max. degree=5 (abb. DHAM5) is NP-complete

P

m

[Proof]

Since DHAM

NP, DHAM5

NP

.

We DHAM DHAM5.

degree: the number of edges incident to a vertex

v

v Idea:

Replace the set of “arcs to v”

and the set of “arcs from v”

by a right ‘gadget’.

A Hamiltonian cycle through v on the original graph

corresponds to the

Hamiltonian cycle through v on the resultant graph.

v

v

9/11

参照

関連したドキュメント

Shamir and Adleman, A Method for Obtaining Digital Signatures and Public-Key Cryptosystems, Communications of the ACM, Vol. Wiener, Cryptanalysis of short RSA secret ex- ponents,

and Uzna´ nski, P.: Rendezvous of distance-aware mobile agents in unknown graphs, International Colloquium on Structural Information and Communication Complexity, Springer,

Berenbrink, Parallel rotor walks on finite graphs and applications in discrete load balancing, Proc.. Propp, Discrete low

Computational Complexity of a Pop-up Book, 4 th International Conference on Origami in Science, Mathematics, and Education,

Computational Complexity of a Pop-up Book, 4 th International Conference on Origami in Science, Mathematics, and Education,

6 2 Completeness based on Polynomial time

6 2 Completeness based on Polynomial time

6.2.Completeness based on Polynomial-time