0 Up votes0 Down votes

11 views37 pagesdgfhhio

Jul 30, 2017

© © All Rights Reserved

PPT, PDF, TXT or read online from Scribd

dgfhhio

© All Rights Reserved

11 views

dgfhhio

© All Rights Reserved

- Steve Jobs
- Wheel of Time
- NIV, Holy Bible, eBook
- NIV, Holy Bible, eBook, Red Letter Edition
- Cryptonomicon
- The Woman Who Smashed Codes: A True Story of Love, Spies, and the Unlikely Heroine who Outwitted America's Enemies
- Contagious: Why Things Catch On
- Crossing the Chasm: Marketing and Selling Technology Project
- Everybody Lies: Big Data, New Data, and What the Internet Can Tell Us About Who We Really Are
- Zero to One: Notes on Start-ups, or How to Build the Future
- Console Wars: Sega, Nintendo, and the Battle that Defined a Generation
- Dust: Scarpetta (Book 21)
- Hit Refresh: The Quest to Rediscover Microsoft's Soul and Imagine a Better Future for Everyone
- The Innovators: How a Group of Hackers, Geniuses, and Geeks Created the Digital Revolution
- Crushing It!: How Great Entrepreneurs Build Their Business and Influence—and How You Can, Too
- Make Time: How to Focus on What Matters Every Day
- Algorithms to Live By: The Computer Science of Human Decisions
- Wild Cards

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

- BUploaded byEarl Lauriece S. Butlay
- Lecture 38Uploaded byYilun Du
- s03Uploaded bymaslele72
- Metodo CEUploaded byMilagros Laynes
- Introduction To Geographic Information SystemUploaded byy.b.ari.handoko.s3949
- CV TitchievUploaded byIna Farcos
- UntitledUploaded byNawaz Baba
- Deway Classification 000Uploaded byEmmanuel Habumuremyi
- ACM Communications march 2011 editionUploaded byALI HANZALA
- MTH 221 TUTORIALS Inspiring Minds/mth221tutorials.comUploaded bydavidkumar
- 9495Uploaded bynandakishore.nalla
- Mathematical modeling - a personal philosophyUploaded byJohn
- 76.I2C PROTOCOL BASED REAL TIME CLOCK CONTROL APPLICATION..docUploaded bySVSEMBEDDED
- Algorithmics APIIT 2012 AssignmentUploaded byDokhi Irani
- sachin_resume12Uploaded bySachin Saxena
- BEALL.docxUploaded byAbdu Mohammed
- Slow Adaptive OFDMA System Through Chance Constrained ProgrammingUploaded bynimmi9
- AnotheroneUploaded byscribduser53
- PhDUploaded byRbKahn
- SAARMSTE13tocCMKUploaded byjohn
- Engleski 1Uploaded bySrdjan Spasic
- UGC Journals list - 1Uploaded byAmal Living Miracle
- The Tale of One-Way FunctionsUploaded bystalafuse
- CYBI 2014Uploaded byCS & IT
- First International Conference on Cybernetics & Informatics (CYBI 2014)Uploaded byCS & IT
- UnionUploaded byLara Mia Retuya Lara
- MT(A)Uploaded byRUSSEL ROSMIN -
- STATEMENT OF PURPOSE-UIUC.docUploaded byPrithwiraj Paul
- The Beginners Method for Solving the Rubiks CubeUploaded byLê Hoàng Tâm
- Fall 2018 CS 161 SyllabusUploaded bywho cares

- Diabetic NeuropathyUploaded byAde Gunawan
- Atresia AniUploaded byAde Gunawan
- spinal cord compression.docxUploaded byAde Gunawan
- 2018 01 08 Surveillance Update 306Uploaded byAde Gunawan
- Translate Jurnal Kranial Arteritis.id.EnUploaded byAde Gunawan
- ThtUploaded byAde Gunawan
- 17-0246Uploaded byAde Gunawan
- aaaaa.id.enUploaded byAde Gunawan
- Basics of Fluid Therapy and PhysiologyUploaded byAde Gunawan
- Toxicology.pdfUploaded byAde Gunawan
- Qué es la toxicología forenseUploaded byCarlos Roque
- SOFT AAFS Forensic Laboratory Guidelines 2006 FinalUploaded byroquehn
- vol2-no3-1Uploaded bycmgarun
- 1ef167b516504e7b8dad3a22ff837cc35307Uploaded byAde Gunawan
- 5a28335e986df1fbb6cac3e2f5bffd15dd50.pdfUploaded byAde Gunawan
- fs43_musclecrampsanddystoniaUploaded byAde Gunawan
- 71e02a6a-19ff-4be3-806b-2581599f05a9Uploaded byAde Gunawan
- AcuteOtitismedia_ghalebUploaded byAde Gunawan
- fisiologiUploaded byAde Gunawan

- Leaders Guide to AFP Applications 2-2Uploaded byali
- GagesUploaded byAdhithya Bhat
- Modality analysis of the newspaper articles about.pdfUploaded byBudi Leo
- Making of Portrait of Graham and Amanda by Ian Spriggs _ CG TUTORIALUploaded byKennedyKisusi
- IT Service Management (ITSM)Uploaded bySaikat Banerjee
- 15 sudanUploaded bySalih Ahmed Obeid
- About Text in Custom Linetypes-AutocadUploaded byShoukat Ali Shaikh
- Lecture Notes on System Identification and Data AnalysisUploaded bychrisbatty
- Bilingv - Speaking 2015Uploaded byana
- ListingsUploaded byjurrenpen
- Medical Writing PDFUploaded bybrain
- Repetitive Behavior ScaleUploaded byPatras Vladut
- A788-11.pdfUploaded bycj7man80
- RE-1999-12Uploaded byEnéas Barone
- Correlation Proof (1)Uploaded byAlan Zhong
- masseyUploaded byapi-328248103
- 25-3-404-1-10-20160311Uploaded byMaríaJosé542
- 857410_89058003EN_Manual_905_TitrandoUploaded byJosh Ndoky Santos
- A Project Report OnUploaded byketanjc
- The Impact of Globalization on HRD in BangladeshUploaded byDr. Mohammad Shamsuddoha
- JN-AN-1086-JenNet-Over-Network-Download-1v3.pdfUploaded byFatih Okuyucu
- Guidelines for Selection & Accreditation of Training Delivery Partner – ASDCUploaded byAutomotive Skills Development Council
- Instructions OpenPlant Power PID and Modeler workshopUploaded bycem2karaku2
- Uses of Bendable ConcreteUploaded byDhruv Attarwala
- Manual for Level ControlUploaded byReeve Tang Csv
- Canny Edge Detection TutorialUploaded byRahim Rasyid Siregar
- Advanced Practical CRT Monitor Repair CourseUploaded byMohamed Mehdi Fehem
- Parameter Inconsistencies Check FDD OriginalUploaded bycutterjambrong
- Door CloserUploaded byAjit Singh Rathore
- PCM4000MGUploaded byTien Dung Tran

## Much more than documents.

Discover everything Scribd has to offer, including books and audiobooks from major publishers.

Cancel anytime.