Loading Now

NP-Completeness

內容目錄

首先需要一個問題叫做布林公式(Boolean formula)會像:

    quicklatex.com-9ec07f78e20f956306f56af1de45a787_l3 NP-Completeness

裡面的每一個符號稱作variable,每一個variable可以給0或1的值就像在做布林運算,一個boolean formula要滿足的話要讓各個variable做完計算後quicklatex.com-2a02105f55dd25533f23c795b9dcf821_l3 NP-Completeness輸出1
而有一種問題叫做satisfiability problem就是倚靠boolean formula是否滿足來達成條件

    quicklatex.com-778469cce877c5601321dfcfb5a47a12_l3 NP-Completeness

定理:Cook-Levin Theorem

    quicklatex.com-a34c137872626790247439c490c12d80_l3 NP-Completeness

定義:
quicklatex.com-a5b77feb7fcae626b4acd8f4e47c4f5a_l3 NP-Completeness如果存在多項式時間的Turing Machine M可以接受任何輸入w,並且在tape裡quicklatex.com-4a56138217af368b570e9d20add722a7_l3 NP-Completeness步驟之後停止並且輸出結果就稱這是一個多項式時間可運算的function
定義:
如果存在一個多項式時間可計算的function quicklatex.com-a5b77feb7fcae626b4acd8f4e47c4f5a_l3 NP-Completenessquicklatex.com-d2a75ce81009068de4558e758023a045_l3 NP-Completeness能輸入任何字串quicklatex.com-9d2a8c257a6d1853308c4a818045c137_l3 NP-Completeness,代表可以讓language A在多項式時間內映射(mapping)轉換(reducible)到language B上,可以表示成quicklatex.com-dbdd048eb225d090109c19a09b166970_l3 NP-Completeness或者可以表示成以下的對應函數:

    quicklatex.com-af9bd93d33d49ed5768d31ae6a2cf55c_l3 NP-Completeness

Reduce NP-Completeness

這個function quicklatex.com-d2a75ce81009068de4558e758023a045_l3 NP-Completeness做的事情是讓問題A在多項式時間內轉換到問題B
定義:如果quicklatex.com-dbdd048eb225d090109c19a09b166970_l3 NP-Completeness 並且 quicklatex.com-fbf6b6390d05dc8fde16cd1a61220034_l3 NP-Completeness, 則代表quicklatex.com-c2f8b9ed4cf0728d04ff458cfd9f316d_l3 NP-Completeness
證明:
存在一組多項式時間Turing Machine M可以決定B的結果並且quicklatex.com-d2a75ce81009068de4558e758023a045_l3 NP-Completeness作為多項式時間轉換將A問題換成B問題
N = 輸入任何字串 quicklatex.com-9d2a8c257a6d1853308c4a818045c137_l3 NP-Completeness

  1. 計算quicklatex.com-4a56138217af368b570e9d20add722a7_l3 NP-Completeness
  2. 放進輸入執行M並且不管M有沒有輸出quicklatex.com-4a56138217af368b570e9d20add722a7_l3 NP-Completeness都一定要輸出一個結果(這樣才符合algorithm的定義)
    定義:
    如果一個language B滿足以下兩個條件就可以稱作NP-complete
    (1) 問題B屬於NP
    (2) 任何問題A屬於NP並且在多項式時間轉換到問題B
    (如果只有條件(2)滿足的話叫做NP-hard的特性)
    定理:如果B是NP-complete並且quicklatex.com-fbf6b6390d05dc8fde16cd1a61220034_l3 NP-Completeness,那麼quicklatex.com-26ff1dd3f3b7c3f85cd4bcf56b770bfb_l3 NP-Completeness
    證明:參照多項式時間轉換的定義
    定義:如果B是NP-complete並且quicklatex.com-72d6d8e6be3995480812ab3e43f50e41_l3 NP-Completeness對於quicklatex.com-c0a85e25be9a4a2a29faadd067b14937_l3 NP-Completeness,那麼C也會是NP-complete
    證明:存在任何的language quicklatex.com-e30879c9babcbb357c5e09d0d557f1da_l3 NP-Completeness能夠在多項式時間內轉換到quicklatex.com-c4b823c512136d9c67e5e335f493da82_l3 NP-Completeness
    quicklatex.com-ddc19a8025ee80a82a04cedafe250828_l3 NP-Completeness是NP-complete, quicklatex.com-b1fde5271dd1cc44722eb915605ef438_l3 NP-Completeness 任何的language quicklatex.com-0c798f90897133ec5b4d5d0ec7003475_l3 NP-Completeness都可以在多項式時間內轉換到B

    quicklatex.com-d01fd0b929bd23226c5007c84c5009c2_l3 NP-Completeness

至此所有的language屬於NP都可以在多項式時間內轉換到C
定義:
literal: 一個boolean variable或是一個negated boolean(variable quicklatex.com-4eded1e1dff989904cefab30257782dc_l3 NP-Completeness 或者 quicklatex.com-3b67f49406b36f85f39e74b22a48e80b_l3 NP-Completeness)
clause: quicklatex.com-cc2be0f286b64feec21ff2d6d2c3aea0_l3 NP-Completeness
conjunctive normal form (CNF):

    quicklatex.com-a835b039d6777628e2d50a3eab7b76cf_l3 NP-Completeness

3CNF-formula:

    quicklatex.com-153eaab956ce4d8dfd5035ef32e2566b_l3 NP-Completeness

3SAT = quicklatex.com-3569092ddbf0fc97b9a61eed773c4650_l3 NP-Completeness是一個satisfiable 3cnf-formulaquicklatex.com-adc6326db4059cd20c2de71f76bea1fd_l3 NP-Completeness
定理:3SAT可以在多項式時間內轉換到CLIQUE
證明:讓quicklatex.com-2a02105f55dd25533f23c795b9dcf821_l3 NP-Completeness作為一個formula擁有quicklatex.com-44898a6f13ac28ec3124ed4f5f7acd9b_l3 NP-Completeness個clauses:

    quicklatex.com-8c111570d8c4d14f7854cee82f330547_l3 NP-Completeness

    quicklatex.com-7e1886b1bb9fee3cf20480074ebc389d_l3 NP-Completeness

3SATtoCLIQUE NP-Completeness

其中quicklatex.com-d2a75ce81009068de4558e758023a045_l3 NP-Completeness為多項式時間的轉換function
quicklatex.com-2a02105f55dd25533f23c795b9dcf821_l3 NP-Completeness要能夠滿足的話若且唯若quicklatex.com-be1d1b3611eb40e6a73a6a2fe72399f2_l3 NP-Completeness

Cook-Levin Theorem

quicklatex.com-0b223e3fbeb3eb2a764c9919df171deb_l3 NP-Completeness
證明:

  1. quicklatex.com-19af98d4618d6409d00260555ac47c4f_l3 NP-Completeness
    • 一個NTM可以猜formula的variable並且在驗證過後看是否滿足quicklatex.com-2a02105f55dd25533f23c795b9dcf821_l3 NP-Completeness
  2. 對於任何的quicklatex.com-e30879c9babcbb357c5e09d0d557f1da_l3 NP-Completeness並且A可以在多項式時間內轉換到SAT問題上
    • 假設N是一個Non-deterministic Turing Machine可以在quicklatex.com-f0b882a20b62722c3ed0e247d695a6d1_l3 NP-Completeness時間內決定A的輸出,quicklatex.com-7616d15bb2a0ad44ebf9721fb7143848_l3 NP-Completeness,NTM N存在一組表輸入w制定出quicklatex.com-0cb07c9828bd5381bac8ba50bb50edef_l3 NP-Completeness大小的表,每一列是NTM的每一條分支在計算輸入w的configuration,如果任何一列結果是accepting的configuration就代表整個表輸出就是accepting
Tableau NP-Completeness

任何accepting的表都是跟NTM N輸入w字串計算後的分支有關

TableauBranch NP-Completeness

NTM N能夠accept輸入w就代表存在accepting表能決定輸出結果是accept或是reject

quicklatex.com-d7aa6c8f9ac3a36cb82d5eaf94bfe45c_l3 NP-Completeness多項式時間轉換問題A到SAT問題
輸入w作為問題A的instance,將w轉換產生成formula quicklatex.com-2a02105f55dd25533f23c795b9dcf821_l3 NP-Completeness
假設quicklatex.com-5b28d8bd7b3d2f145f26535674e1f1dc_l3 NP-Completenessquicklatex.com-9c4265b2508533ec8ce95404bae41822_l3 NP-Completeness作為N的state集合以及tape的alphabet
quicklatex.com-992a702940ba4a8d0118701ea2f24aca_l3 NP-Completenessquicklatex.com-94bb4c8aeb0486d1a60abb687bc26349_l3 NP-Completeness以及每一個quicklatex.com-da016ef195e88e9d73871ddd18df6a70_l3 NP-Completeness,可以產生quicklatex.com-1d045644917aff695fa37d8d84b1ac9e_l3 NP-Completeness個variable
如果quicklatex.com-56e7e2cadd9f2e7351225800de2c000f_l3 NP-Completeness代表cell[i, j]包含quicklatex.com-57927b2143eeeaf1684c0c356d8ef2f6_l3 NP-Completeness
設計一組quicklatex.com-2a02105f55dd25533f23c795b9dcf821_l3 NP-Completeness可以滿足variable與NTM N輸入w的結果產生一組accepting表

    quicklatex.com-9d7be3f511fb96b028bb88ac971e58ee_l3 NP-Completeness

(1)

    quicklatex.com-ccb58cc635795d6099c61d8396b76061_l3 NP-Completeness

TableauCell NP-Completeness

(2)

    quicklatex.com-9474cd78b5a758d7073091729f26f6bf_l3 NP-Completeness

要確認的是第一個row是NTM N輸入w的start configuration,以上就完成表內的一行row,還要再另外產生quicklatex.com-f8f2e4a263f615ace6dba0746c3b8107_l3 NP-Completeness組row
(3)quicklatex.com-c5122276f2a04a82d1ad967aa733cd32_l3 NP-Completeness保證表內一定會產生一組accepting的configuration

    quicklatex.com-5b12c7af5a79814a9ad96538a4b65556_l3 NP-Completeness

(4)quicklatex.com-1bf94086346e7fba0c25d2982aad9d0c_l3 NP-Completeness
保證表裡面的每一個row都可以合法地透過NTM N的transition rule來產生
quicklatex.com-5c95b9c3870dc49dfaae16288d3e710c_l3 NP-Completeness
quicklatex.com-7a3cbd8173892dff9b74fcd2f251b389_l3 NP-Completeness
quicklatex.com-6a3eea0c1251df331e4719b6876579b1_l3 NP-Completeness

TableauSixCell NP-Completeness
TableauLegalWindows NP-Completeness

合法範例

Tableau3Example NP-Completeness

Claim: 首先檢查第一層的row是不是start configuration,如果是的話代表接下來表內的內容都是合法的,並且上一層跟下一層的configuration都要遵照transition rule

TableauCheckTwoRow NP-Completeness

quicklatex.com-4b3af2b2822657094339c3a6884e3349_l3 NP-Completeness(quicklatex.com-b8e805d0c706dc384df25934bf97b7a5_l3 NP-Completeness的表格內容必須是合法的) =

    quicklatex.com-08b510afdfce649613374a34eded835d_l3 NP-Completeness

需要一次看六格是不是合法的

TableauSixLegalCell NP-Completeness

quicklatex.com-2a02105f55dd25533f23c795b9dcf821_l3 NP-Completeness的大小是quicklatex.com-751cd3db04379c854c4e26c2464b9655_l3 NP-Completeness,讓quicklatex.com-5f7d527e5567e4d72273e2fc296d3335_l3 NP-Completeness 依據N設計的transition大小
總共所有variable會有quicklatex.com-751cd3db04379c854c4e26c2464b9655_l3 NP-Completeness
quicklatex.com-9abad19315e933b4bfd8b617fd720f19_l3 NP-Completeness
quicklatex.com-0ed0e35224cdc6ce690c312e840f3a6d_l3 NP-Completeness因此轉換可以在多項式時間內完成

推論(Cor):3SAT是NP-complete

證明:3SAT屬於NP
quicklatex.com-ef765ea69eb1f3567ad1ce08fcf4d3b1_l3 NP-Completeness
quicklatex.com-77b032de2524faf029cf693ae2aa396e_l3 NP-Completeness
如果quicklatex.com-98e5fc6e9c933c22b0048187039b32a5_l3 NP-Completeness

    quicklatex.com-d84fa69ede35bb676fc4bd12c44a485e_l3 NP-Completeness

推論(Cor):CLIQUE屬於NP-complete

圖G的頂點覆蓋(Vertex cover of G):如果G屬於一個無向圖,G裡覆蓋的頂點(Vertex cover)是圖G裡一個子集合能夠讓G的每一條邊都接著一個點

VertexCover NP-Completeness

quicklatex.com-68facf6c5e445ff037e4debc3ac7d6a0_l3 NP-Completeness是一組vertex cover
quicklatex.com-ff12f8fee8d7c377732de619f9e960df_l3 NP-Completeness不是一組vertex cover
Vertex-Cover = {quicklatex.com-e1684a97ac9f2efcd9f5a931913d8eb5_l3 NP-Completeness|G是一個無向圖並且擁有k個點的vertex cover}
定理:Vertex-Cover屬於NP-complete
證明:Vertex-Cover屬於NP

    quicklatex.com-29fd1af7ee9df20bf9ff61001ea50863_l3 NP-Completeness

    quicklatex.com-7e1886b1bb9fee3cf20480074ebc389d_l3 NP-Completeness

3SAT-VertexCover NP-Completeness

靠以上的轉換方法來證明滿足quicklatex.com-2a02105f55dd25533f23c795b9dcf821_l3 NP-Completeness的話代表G確實存在k個node的vertex cover
quicklatex.com-2a02105f55dd25533f23c795b9dcf821_l3 NP-Completeness擁有quicklatex.com-6d22c131d7ee7256bb9fba35aa75cb66_l3 NP-Completeness個variable以及quicklatex.com-85ab9160fd0c7db350f288e3edec3320_l3 NP-Completeness個clauses使得quicklatex.com-f3ddcaf0707d30b466e1f3a3fe57bf68_l3 NP-Completeness

  1. 另外設計gadgets作為輔助的元件,一個true variable來自每個variable gadgets,兩個node來自clause gadget
  2. 每三個邊可以連接variable gadgets跟clause gadget來覆蓋

SUBSET-SUM

SUBSET-SUM = {quicklatex.com-db9dc11e9514546dda4b8847d705b313_l3 NP-Completeness以及對於某些quicklatex.com-66d3e069379bf49311e71e37f8c2993e_l3 NP-Completeness}
定理:SUBSET-SUM屬於NP-complete
證明:SUBSET-SUM屬於NP

    quicklatex.com-e9f1824745a85faba243aae53df0a982_l3 NP-Completeness

存在quicklatex.com-2a02105f55dd25533f23c795b9dcf821_l3 NP-Completeness是一個boolean formula擁有variables quicklatex.com-023ee90c25621588ac21d06c7477fc19_l3 NP-Completeness以及clauses quicklatex.com-074f6abfb2eb39f3d5c165c5a8c29fe0_l3 NP-Completeness

    quicklatex.com-0be775979011e41b6dc55fa126faa66b_l3 NP-Completeness

VertexCoverTableau NP-Completeness
VertexCoverSum NP-Completeness
  1. 假設quicklatex.com-2a02105f55dd25533f23c795b9dcf821_l3 NP-Completeness滿足的話,建構一個子集合quicklatex.com-f397127b9f73615f759d0eb6118c82c4_l3 NP-Completeness,如果quicklatex.com-c0eb4e454a72eed083f1d1d5dd851aab_l3 NP-Completeness給的值是TRUE,選擇quicklatex.com-10b6394de00136971aef3d906b14ecd4_l3 NP-Completeness,否則就另外選擇quicklatex.com-0c3eef72cc3571ecc291b8a3a60fd006_l3 NP-Completeness,對於每一次的i,一次只會選擇quicklatex.com-10b6394de00136971aef3d906b14ecd4_l3 NP-Completenessquicklatex.com-0c3eef72cc3571ecc291b8a3a60fd006_l3 NP-Completeness代表true或false,最後k個digits會把整個quicklatex.com-07c32326e2a7c347c1c49015f105ee79_l3 NP-Completeness加總起來算1,如果不到3的話由quicklatex.com-0b793fa2941e638f08a361b75e127908_l3 NP-Completenessquicklatex.com-9c6da664c538ca082a760908a4714e0b_l3 NP-Completeness來補到3
  1. 假設一組S的子集合可以加總到quicklatex.com-a0bc2466872fc888677c06ed53cf2f32_l3 NP-Completeness,可以建構一組滿足quicklatex.com-2a02105f55dd25533f23c795b9dcf821_l3 NP-Completeness的公式,如果這組子集合包含quicklatex.com-10b6394de00136971aef3d906b14ecd4_l3 NP-Completeness我們就設定quicklatex.com-c0eb4e454a72eed083f1d1d5dd851aab_l3 NP-Completeness為TRUE,否則設定quicklatex.com-c0eb4e454a72eed083f1d1d5dd851aab_l3 NP-Completeness為FALSE,而這樣的條件可以滿足quicklatex.com-2a02105f55dd25533f23c795b9dcf821_l3 NP-Completeness
    整張表的大小是quicklatex.com-3b36f3d9c83d29c57df3429ec298a12c_l3 NP-Completeness

定理:quicklatex.com-0e0de71a8a529ef751e2082144007a71_l3 NP-Completeness

    quicklatex.com-e6be92ec056b4e67aa9b7d23bc3d8bce_l3 NP-Completeness

證明:存在一組3cnf-formula擁有k個clauses

    quicklatex.com-9cb61241583b443223f85a81b979e0d3_l3 NP-Completeness

每一個quicklatex.com-c0f6b762556d6d0d3c92526662b03af7_l3 NP-Completeness可以看作literal的quicklatex.com-c0eb4e454a72eed083f1d1d5dd851aab_l3 NP-Completeness或者quicklatex.com-a8fc05362258ee083cdedb1c787165d2_l3 NP-Completeness以及quicklatex.com-44514555c5c486368e856508aba36e96_l3 NP-Completeness都是quicklatex.com-2a02105f55dd25533f23c795b9dcf821_l3 NP-Completeness的variables

HAMPATH-3CNF NP-Completeness
HAMPATH-3CNF-Body NP-Completeness
HAMPATH-3CNF-3k+1 NP-Completeness
HAMPATH-3CNF-zig-zag NP-Completeness

如果存在一組可以滿足的參數,選擇clause裡面其中一個literal給TRUE
如果存在可以得到true的結果,代表存在一組Hamiltonian path從quicklatex.com-57927b2143eeeaf1684c0c356d8ef2f6_l3 NP-Completeness走到quicklatex.com-a0bc2466872fc888677c06ed53cf2f32_l3 NP-Completeness
如果Hamiltonian path是quicklatex.com-c7dd74debfb52af7901a7f18f57c00ed_l3 NP-Completeness,意思是可以從上面的鑽石型路徑頂端node走到最尾端的node,代表可以輕鬆找到一組滿足3CNF的路徑,因為每一組clause的點出現在路徑裡,只要點存在並且給TRUE的值,就可以接著走下去,如果是走quicklatex.com-3003d7bec6666abda75619d133c4cc71_l3 NP-Completeness路徑就讓每一個node放TRUE,反之走quicklatex.com-76f223b487555734449aa1b3e64d87d0_l3 NP-Completeness每一個點給False。
而Hamiltonian path必須是quicklatex.com-c7dd74debfb52af7901a7f18f57c00ed_l3 NP-Completeness

HAMPATH-normal NP-Completeness

假設有兩種case:
case 1: quicklatex.com-180dd481b058b3d5edf788b96ad29318_l3 NP-Completeness是一個離群的點
case 2: quicklatex.com-05109ad33453b4a775d79bd7c1ba0cb0_l3 NP-Completeness是一個離群的點
在兩種情況下,路徑不包含quicklatex.com-180dd481b058b3d5edf788b96ad29318_l3 NP-Completeness的點
在case 1: 路徑沒辦法從quicklatex.com-fb6134157016591674e9b9c5cdf58729_l3 NP-Completeness或者quicklatex.com-81a28fc2c2c83ad9a69e04866a90c34a_l3 NP-Completeness進入,因為路徑走到了其他的點上
在case 2: 路徑沒辦法從quicklatex.com-05109ad33453b4a775d79bd7c1ba0cb0_l3 NP-Completeness進入,因為quicklatex.com-05109ad33453b4a775d79bd7c1ba0cb0_l3 NP-Completenessquicklatex.com-180dd481b058b3d5edf788b96ad29318_l3 NP-Completeness一樣是獨立的node在此種情況

定理:UHAMPATH屬於NP-complete

證明:

    quicklatex.com-0467cc4657f6c90fff31a24653bad606_l3 NP-Completeness

    quicklatex.com-00fe8cc69606e0f0cc2961716fc65823_l3 NP-Completeness

quicklatex.com-e7a00bb8f3ee90607d771dd4fc84f124_l3 NP-Completeness
quicklatex.com-2b55a337fd2dbea54f56e8fa0d92ade7_l3 NP-Completeness的點: quicklatex.com-98d1b8a6e00dfe5581d4d0f238bd6046_l3 NP-Completeness
quicklatex.com-856ce9fd757a4fc5a481f1a916661747_l3 NP-Completeness
quicklatex.com-2b55a337fd2dbea54f56e8fa0d92ade7_l3 NP-Completeness的邊: quicklatex.com-ab43b3d50a0ce4ef0521f026b83486c8_l3 NP-Completeness

HAMPATH-UHAMPATH NP-Completeness

如果quicklatex.com-1685d72c0f70f05d82752da9416b665f_l3 NP-Completenessquicklatex.com-fbbb7f15bc14ef6b8aa38af3fba7ccf6_l3 NP-Completeness裡的Hamiltonian path
quicklatex.com-87e49688721cce60d3614d4429fe95f9_l3 NP-Completeness屬於quicklatex.com-2b55a337fd2dbea54f56e8fa0d92ade7_l3 NP-Completeness裡的無向Hamiltonian path。

Share this content:

I'm Scientia, currently a graduate student. My research interests include Cryptology, Cryptographic Engineering, Security and Privacy, Computational Complexity, Quantum Cryptography, Hardware Security, Cybersecurity and Anomaly Detection.

Post Comment