• 沒有找到結果。

NP-Completene ss

N/A
N/A
Protected

Academic year: 2022

Share "NP-Completene ss"

Copied!
18
0
0

加載中.... (立即查看全文)

全文

(1)

Michael Tsai 2011/5/6

(2)

NP-Complete

1. 這些問題目前尚未找到可以在 polynomial time 內解決的

algorithm.

(

) , ��� �����

 

2. 這些問題目前尚未被證明無法在 polynomial time 內解決 .

(3)

NP P

這些問題可以在 polynomial time 內解

2011/05/04 為 P v.s. NP 提出之四十周年紀念 !!

Ref: http://blog.computationalcomplexity.org/2011/05/forty-years- of-p-v-np.html

這些問題可以在 polynomial time 內被 verify

P=NP???

(4)

Euler tour versus hamiltonian c ycle

Digraph

Euler tour: 每個邊都走過一遍 , 可以重複 走過某個 vertex

Hamiltonian cycle: 一個 simple cycle 把所 有的 vertex 都走一遍

 

(5)

一些 NP-complete 的問題

Shortest simple path

Longest simple path

Solvable in polynomial time

NP-Complete

Hamiltonian Cycle

Euler Tour 2-CNF satisfiability

3-CNF satisfiability

2-CNF example:

CNF: conjunctive normal form  

(6)

NP-Complete

一個問題是 NP, 而且跟 NP 裡面的其他問題”一樣難”

( 一樣難 : 所有 NP 裡面的問題可以在 polynomial time 裡 面轉換成 NP-complete 的問題 )

因為以上 , 所以”一解則全解”

學這個有什麼用 ?

雖然還沒有人證明出 NP-complete problems 無法在 polyno mial time 裡面解出來

但是經過了 40 年了 , 沒有任何 NP-complete problem 被 解出來 (polynomial time), 因此證明某問題為 NP-comple te 某種程度上也證明了它非常難解 ( 或甚至無法解 )

(7)
(8)

Decision problem v.s. optimizat ion problem

Decision problem: 輸出是 yes/no (1/0) ( 可不可以找到答案 )

Optimization problem: 輸出是最好的解 ( 可以的答案中找出最好的那個 )

例子 : Shortest path v.s. Path

NP-Complete 只適用於 decision problems

(9)

Decision problem v.s. optimizat ion problem

怎麼將 optimization problem 轉換成 decisio n problem 呢 ?

對要 optimize 的值設定一個 bound

將 Shortest path 轉換成 decision problem:

給定 graph G, vertices u & v, integer k, 有沒有從 u 到 v 的路徑使用少於 k 個 edge?

(10)

Reduction

(11)

用 Reduction 證明”一樣難”

假設以下兩樣存在

則 B 也沒有 polynomial-time algorithm 可以 解

使用反證法 , 假設有

A: no polynomial-time algorithm exist

Polynomial-time reduction algorithm:

instances of A  instances of B

B: polynomial-time algorithm Polynomial-time reduction

algorithm:

instances of A  instances of B

A: polynomial-time

algorithm 矛盾 . 所以 B 也沒有 .

(12)

為什麼 Polynomial time 就是”容 易解” ?

雖然是 polynomial time, 但實務上這麼高次的多項 式並不常見

通常如果找到一個 polynomial-time algorithm, 比 較快的方法很快也會被找到

通常使用不同的 computation model( 之後自動機會 教到 , 現在可以想像是單 CPU v.s. 多 CPU 的機器 ) , 某 model 可用 polynomial-time 解的問題在另外一 個 model 也可用 polynomial-time 解

Polynomials are closed under addition, multipl ication, and composition.

 

(13)

Abstract problem

I: instances

of problem S: solutions

Q: Abstract problem

(binary relation) Decision problem:

S={0,1}

Example: PATH

�= 

�,�,� ,�

 

���� ( )= 0

 

if a shortest path from u to v has at most k edges

otherwise

(14)

Encoding

A set S of

abstract objects The set of

binary strings encoding:

mapping Polygons,

numbers, graphs, functions,

ordered pairs, programs, …

(15)

Some more definitions

Concrete problem: 一個 problem 的 instance 是 binary string 的 set, 則稱為 concrete p roblem.

An algorithm solves a concrete problem in O(T(n)): 一個 problem 的 instance 長度為 n (i 的長度 , 即為 binary string 長度 ), 而 此 algorithm 可在 O(T(n)) 時間產生解

A concrete problem is polynomial-time sol vable: 有一個的 algorithm 可以解此 problem

 

(16)

P 的正式定義

The complexity class P:

The set of concrete decision

problems that are polynomial-

time solvable

(17)

Abstract problem 轉換成 encoding problem

I: instances of problem

S: solutions Q: Abstract

problem

(binary relation) Decision problem:

S={0,1}

e(I): {0,1}*

�: � →  {0,1}

e(Q): Concrete problem

(18)

Encoding 和花的時間有關嗎 ?

有 !

參考文獻

相關文件

• As the binary quadratic programming program is NP-hard in general, identifying polynomially solvable subclasses of binary quadratic programming problems not only offers the-

Then, it is easy to see that there are 9 problems for which the iterative numbers of the algorithm using ψ α,θ,p in the case of θ = 1 and p = 3 are less than the one of the

Besides the above various complementarity problems, SVNCP(F, Ω) has a close rela- tion with the Quasi-variational inequality, a special of the extended general variational

Basing on the observation and assessment results, this study analyzes and discusses the effects and problems of learning the polynomial derivatives on different level students

The vertex-cover problem is to find a vertex cover of minimum size in a given undirected graph. • 此問題的decision版本為NP-Complete

這些問題目前尚未找到可以在 polynomial time 內解決的 algorithm.. 這些問題目前尚未被證明無法在 polynomial time

If P6=NP, then for any constant ρ ≥ 1, there is no polynomial-time approximation algorithm with approximation ratio ρ for the general traveling-salesman problem...

 The class of languages decided by polynomi al-time algorithms 是 the class of languages accepted by polynomial-time algorithms 的 su bset.. G=(V,E) is a simple cycle that contains