11 views

Uploaded by Ade Gunawan

dgfhhio

- The 3-satisﬁability problem
- Lecture QR
- Tancet 2013 cse department rank list
- Class XII Result Highlights 2019 (Web Version)_Patna.pdf
- Code Optimization
- IRJET-Challenges and Importance of ICT in Quality Improvement of Higher Education
- advalg9.pdf
- IEOM2011 IEOM Challenges[1]
- Exam Preparation for Delf a1
- 1708.03486
- Intel
- Computer Science
- Third International Conference on Artificial Intelligence
- lesson1.ppt
- KernelStruct-I1
- IPDCA
- trace1-7
- Case Study IT
- Macro
- UT Dallas Syllabus for cs6354.581.07u taught by Lawrence Chung (chung)

You are on page 1of 37

Complexity 1

D.Moshkovitz

Introduction

Objectives:

To introduce more NP-Complete

problems.

Overview:

3SAT

CLIQUE & INDEPENDENT-SET

SUBSET-SUM

Complexity 2

D.Moshkovitz

Method

How to show a problem is in NPC?

First show its in NP

Then show it is NP-hard by reducing

some NP-Hard problem to it.

Complexity 3

D.Moshkovitz

New Base Problems

The only NP-Complete problem we

currently know of is SAT.

Unfortunately, its not very comfortable to

work with.

Thus well start by introducing several

useful variants of SAT.

Well use them as our base problems.

Complexity 4

D.Moshkovitz

3SAT

Instance: a 3CNF formula

Problem: To decide if the formula is satisfiable.

Complexity 5

D.Moshkovitz

SIP 259-260

3SAT is NP-Complete

3SAT is a special case of SAT, and is

therefore clearly in NP.

In order to show its also NP-Complete,

well alter the proof of SATs NP-

Completeness,

so it produces 3CNF formulas.

be enough?

Complexity 6

D.Moshkovitz

Revisiting SATs NP-

Completeness Proof

Given a TM and an input weve produced a conjunction of:

cell xi,j,s (xi,j,s xi,j,t )

1i,jnk sC s tC

start x1,1,# x1,2,q0 x1,3,w1 ... x1,n2,_ ... x1,nk 1,_ x1,nk ,#

move k x

1i,jn legal a ,...,a

1 6

i1,j,a1 ... xi1,j1,a6

accept

1i,jnk

xi,j,qaccept

Complexity 7

D.Moshkovitz

Transforming the Formula

into a CNF Formula

All the sub-formulas, but move, form a

CNF formula.

Using the distributive law we can

transform move into a conjunction of

clauses.

The formula stays succinct (check!).

Complexity 8

D.Moshkovitz

CNF 3CNF

(xy)(x1x2... xt)...

clauses with 1 or clauses with more than 3

2 literals literals

replication split

Complexity 9

D.Moshkovitz

3SAT is NP-Complete

Since weve shown a reduction from

any NP problem to 3SAT,

and 3SAT is in NP,

3SAT is NP-Complete.

Complexity 10

D.Moshkovitz

CLIQUE

Instance: A graph G=(V,E) and a threshold k.

Problem: To decide if there is a set of nodes

C={v1,...,vk}V, s.t for any u,vC: (u,v)E.

Complexity 11

D.Moshkovitz

CLIQUE is in NP

On input G=(V,E),k:

Guess C={v1,...,vk}V

For any u,vC: verify (u,v)E

Reject if one of the tests fail,

accept otherwise.

(n=|V|)

Time complexity: O(n2)

Complexity 12

D.Moshkovitz

SIP 251-253

CLIQUE is NP-Complete

Proof: Well show 3SATpCLIQUE.

Complexity 13

D.Moshkovitz

The Reduction

for any clause ()

|V| = formulas length

K= no. of clauses

connected

iff

Complexity 14

D.Moshkovitz

Proof of Correctness

NOT

connected!

contain one node from

.

every layer.

.

k

Complexity 15

D.Moshkovitz

Correctness

given a k-clique, assign x TRUE or

FALSE according to whether x or x

is in the clique; this satisfies the

formula

.

.

(.. .. ..) ... (.. .. ..) .

comprising of one satisfied literal of

each clause forms a k-clique.

Complexity 16

D.Moshkovitz

INDEPENDENT-SET

Instance: A graph G=(V,E) and a goal k.

Problem: To decide if there is a set of nodes

I={v1,...,vk}V, s.t for any u,vI: (u,v)E.

Complexity 17

D.Moshkovitz

INDEPENDENT-SET NP

On input G=(V,E),k:

Guess I={v1,...,vk}V

For any u,vC: verify (u,v)E

Reject if one of the tests fail,

accept otherwise.

(n=|V|)

Time complexity: O(n2)

Complexity 18

D.Moshkovitz

INDEPENDENT-SET is NPC

Proof: By the previous claim and a

trivial reduction from CLIQUE.

of size k in a size k in its

graph complement

Complexity 19

D.Moshkovitz

SUBSET-SUM

Instance: A multi-set of numbers denoted S

and a target number t.

Problem: To decide if there exists a subset

YS, s.t yYy=t.

Complexity 20

D.Moshkovitz

SUBSET-SUM is in NP

On input S,t:

Guess YS

Accept iff yYy=t.

Time complexity: O(n)

Complexity 21

D.Moshkovitz

SIP 269-271

SUBSET-SUM is NP-

Complete

Proof: Well show 3SATpSUBSET-

SUM.

Complexity 22

D.Moshkovitz

Satisfying Clauses

digit per clause

c1 c2 ck

number per variable xi

assigned true:

yi

assigned false:

zi

1 if xi is in cj

1 if xi is in cj 0 otherwise

0 otherwise

Complexity 23

D.Moshkovitz

Achieving Target

digit per clause

c1 c2 ck

0<d<4

target:

Complexity 24

D.Moshkovitz

Achieving Target

digit per clause

c1 c2 ck

1

1

target: 3

Complexity 25

D.Moshkovitz

Achieving Target

c1 c2 c k

y1

1 0 0

z1 0 0 0

...

make sure a yl 1 0 1

good subset zl 1 1 0

contains

1 0 0

exactly one

of yi and zi 1 0 0

...

0 0 1

0 0 1

3 3 3

Complexity 26

D.Moshkovitz

Imposing Consistency

c1 c2 c k

y1

1 0 0

z1 10 0 0

...

yl 1 0

0 1

zl 1 0

0 1 10

1 0 0

1 0 0

...

0 0 1

0 0 1

Complexity

1 1 1 3 3 3 27

D.Moshkovitz

Succinctness

l k

2l

2k

Complexity 28

D.Moshkovitz

Completeness

If there is a satisfying assignment,

build the subset as follows: 1 in

If the i-th variable is assigned the

TRUE, take yi, else take zi. leftmost

l digits

Add as many auxiliary numbers as

needed.

satisfiability 3

in the rightmost

k digits

Complexity 29

D.Moshkovitz

Soundness

If there is a subset which sums up to

the target, construct an assignment

as follows:

If yi is in the subset, assign TRUE to the

i-th variable.

If zi is in the subset, assign FALSE to

the i-th variable.

Complexity 30

D.Moshkovitz

Observation: No Carry

c1 c2 ck

All digits are either 1 0 0 1 0 0 y1

0 or 1. 1 0 0 0 0 0 z1

Each column

0 0 1 1 0 1 yl

contains at most

0 0 1 1 1 0 z

five 1s. l

1 0 0

Hence, a carry 1 0 0

into the next column

never occurs. 0 0 1

0 0 1

Complexity

1 1 1 3 3 3 31

D.Moshkovitz

Consistency

c1 c2 ck

0 y1

Thus, to get 1 in 1 0 0 1 0

1 0 0 0 0 0 z1

the leftmost l

digits, our subset 0 0 1 1 0 1 yl

necessarily 0 0 1 1 1 0 z

l

contains either yi 1 0 0

or zi (Not both!). 1 0 0

0 0 1

0 0 1

Complexity

1 1 1 3 3 3 32

D.Moshkovitz

Satisfiablity

c1 c2 ck

0 y1

In each column, 1 0 0 1 0

1 0 0 0 0 0 z1

at most 2 can

come from the 0 0 1 1 0 1 yl

auxiliary 0 0 1 1 1 0 z

l

numbers, so all 1 0 0

clauses are 1 0 0

satisfied.

0 0 1

0 0 1

Complexity

1 1 1 3 3 3 33

D.Moshkovitz

Summing Up

1. SUBSET-SUM is in NP

2. 3SATpSUBSET-SUM

3. Thus SUBSET-SUM is NP-Complete

Complexity 34

D.Moshkovitz

Summary

In this lecture weve added many new

problems to our NPC bank.

Interestingly, NPC contains over 1000

different problems !

Complexity 35

D.Moshkovitz

Appendix

Complexity 36

D.Moshkovitz

Dictionary

negation: not ()

conjunction: and ()

literal: (negated or not) Boolean variable disjunction: or ()

Examples: x, x

clause: several literals connected with

Example: (xyz)

CNF (Conjunctive Normal Form): several clauses

connected with

Example: (x y)(xyz)

3CNF: a CNF formula with three literals in each clause.

Example: (xyz)(xyz)

Complexity 37

D.Moshkovitz

- The 3-satisﬁability problemUploaded byterminatory808
- Lecture QRUploaded byJanne Spijkervet
- Tancet 2013 cse department rank listUploaded byganapathi22
- Class XII Result Highlights 2019 (Web Version)_Patna.pdfUploaded byPRANIT KUMAR
- Code OptimizationUploaded byPraveenkumar Aepuri
- IRJET-Challenges and Importance of ICT in Quality Improvement of Higher EducationUploaded byIRJET Journal
- advalg9.pdfUploaded byKasapa
- IEOM2011 IEOM Challenges[1]Uploaded byRita Ranita
- Exam Preparation for Delf a1Uploaded byjalbertosc
- 1708.03486Uploaded bychew20
- IntelUploaded bysaifullah
- Computer ScienceUploaded byStrange Fellow II
- Third International Conference on Artificial IntelligenceUploaded byCS & IT
- lesson1.pptUploaded bysmwangi
- KernelStruct-I1Uploaded bysivar22
- IPDCAUploaded byCS & IT
- trace1-7Uploaded byAndy Xie
- Case Study ITUploaded byImranKasumović
- MacroUploaded byFredVoria
- UT Dallas Syllabus for cs6354.581.07u taught by Lawrence Chung (chung)Uploaded byUT Dallas Provost's Technology Group
- edmos-karp.txtUploaded byDavid Yepes
- MELJUN CORTES AUTOMATA_LECTURE_Equivalence of Regular Expressions and Finite Automata_Part 2_1Uploaded byMELJUN CORTES, MBA,MPA
- CS_IT_SE course contents HECUploaded byAdeel Rifaat Mirza
- Bachelor of Science in Information TechnologyUploaded byNicaii Prado - Bartolome
- OM AssignmentUploaded byVikas Sahota
- snake.cUploaded bySyed Sharjeelullah
- MC0063–01_discrete_mathematicsUploaded byssharma79
- IPDCA-2015Uploaded byCS & IT
- Regular LanguagesUploaded byvineetipt
- dual charts.pdfUploaded byUtkarsh Agarwal

- DOHUploaded byChandra_INHU_Riau
- septic shock.pptxUploaded byAde Gunawan
- cardiogenik shock.pptxUploaded byAde Gunawan
- 2018 01 08 Surveillance Update 306Uploaded byAde Gunawan
- arteritis temporalisUploaded byPrimaditya
- 17-0246Uploaded byAde Gunawan
- xyxfyxguxgxxUploaded byAde Gunawan
- napza baruUploaded byAde Gunawan
- aaaaa.id.enUploaded byAde Gunawan
- Diabetic NeuropathyUploaded byAde Gunawan
- MAKALAH LENGKAP TBC.docxUploaded byramdani
- file.en.idUploaded byAde Gunawan
- 179857487 BEDAH ONKOLOGI Kelenjar Parotis PptUploaded byAde Gunawan
- Sectio Caesarea a.i Sectio Caesarea BerulangUploaded byicha shafira
- penyakit hirschsprungUploaded byHervin Febrina
- Kata Pengantar Daftar Isi BaruUploaded byAde Gunawan
- Print GambarUploaded byAde Gunawan
- Distonia ReferatUploaded byDavid Afredy
- tugas post test paru.docxUploaded byAde Gunawan
- CoverUploaded byAde Gunawan
- Basics of Fluid Therapy and PhysiologyUploaded byAde Gunawan
- Qué es la toxicología forenseUploaded byCarlos Roque
- SOFT AAFS Forensic Laboratory Guidelines 2006 FinalUploaded byroquehn
- Translate Jurnal Kranial Arteritis.id.EnUploaded byAde Gunawan
- toksikologi ForensikUploaded byAde Gunawan
- lapkas shUploaded byAde Gunawan
- TOKSIKOLOGI FORENSIKUploaded byAde Gunawan
- Toxicology.pdfUploaded byAde Gunawan
- IVO-MMR.pdfUploaded byAde Gunawan

- Understanding SIFT Algorithm and its usesUploaded byIJSTE
- Tutorial - Gallery Component With GallerifficUploaded bySaurabh S Gattani
- Citrix on VMware V2.3Uploaded byEbitomo Anthony Tobi
- How to Create a Persistent Back Door in Android Using Kali Linux_ « Null Byte __ WonderHowToUploaded bysigillus.primus
- PIN Experion HMIUploaded byAvinash Choudhari
- Java AdvantagesUploaded byKhai Milomoccha
- A Review of Elastic Search: Performance Metrics and challengesUploaded byEditor IJRITCC
- 6.2.3.9 Lab - Configuring Multiarea OSPFv3Uploaded byvvicious3331
- Theme #031 StitchUploaded byAli Moran
- 8668PBIOUploaded byDonkan Alfredo Martines Gonzales
- APEX Multi Language ApplicationsUploaded byFernando
- Sample Questions C C4C30 2015Uploaded byNgoc Linh Hoang
- Daily Report (1)Uploaded byManish Mattha
- Java Examination (Include Answer)Uploaded byDuy Trung
- The Threat of Social Engineering and Your Defense Against ItUploaded bybrunnehild
- lecture_170_405Uploaded byMinusree
- Distributed Shared MemoryUploaded byAsemSaleh
- Excel and JavaUploaded byg26720038462
- ICTL Notes - ProgrammingUploaded bysarah johari
- 3 SrsUploaded byapi-3775463
- 61941412-tgaUploaded byChiranjivi Kottam
- Java Interview Questions Part-1.docxUploaded byrohit
- CLRS_Solutions_Manual.pdfUploaded bySrinjay Kumar
- UiPath - Senior Software ArchitectUploaded byOana Termen
- Nexpose InstallUploaded bymayi_rm
- Vmware 1Uploaded bygaborszondi
- Bca Project.doc111Uploaded byMohd Shaan
- Cloning Procedure of R12 Single TierUploaded bymuhammadimran730
- fx12SolUploaded byJeremie
- radhakrishnan_ugthesisUploaded byaniknit