Computational Complexity Lecture 2 in which we talk about - - PowerPoint PPT Presentation

computational complexity
SMART_READER_LITE
LIVE PREVIEW

Computational Complexity Lecture 2 in which we talk about - - PowerPoint PPT Presentation

Computational Complexity Lecture 2 in which we talk about NP-completeness (reductions, reductions) 1 Recap 2 Recap Languages in NP are of the form: 2 Recap Languages in NP are of the form: L= { x | w, |w| < poly(|x|) s.t. (x,w)


slide-1
SLIDE 1

Computational Complexity

Lecture 2 in which we talk about NP-completeness (reductions, reductions)

1

slide-2
SLIDE 2

Recap

2

slide-3
SLIDE 3

Recap

Languages in NP are of the form:

2

slide-4
SLIDE 4

Recap

Languages in NP are of the form: L= { x | ∃w, |w| < poly(|x|) s.t. (x,w) ∈ L ’ }, where L ’ is in P

2

slide-5
SLIDE 5

Recap

Languages in NP are of the form: L= { x | ∃w, |w| < poly(|x|) s.t. (x,w) ∈ L ’ }, where L ’ is in P Today: Hardest problems in NP

2

slide-6
SLIDE 6

Reductions

3

slide-7
SLIDE 7

Reductions

At the heart of today’ s complexity theory

3

slide-8
SLIDE 8

Reductions

At the heart of today’ s complexity theory L1 ! L2 if problem of deciding L1 “reduces to that of deciding” L2

3

slide-9
SLIDE 9

Reductions

At the heart of today’ s complexity theory L1 ! L2 if problem of deciding L1 “reduces to that of deciding” L2 if can decide L2, can decide L1

3

slide-10
SLIDE 10

Turing and Many-One

4

slide-11
SLIDE 11

Turing reduction:

Turing and Many-One

4

slide-12
SLIDE 12

Turing reduction: Build a TM (oracle machine) ML1, s.t. using the oracle OL2 which decides L2, ML1^OL2 decides L1

Turing and Many-One

4

slide-13
SLIDE 13

Turing reduction: Build a TM (oracle machine) ML1, s.t. using the oracle OL2 which decides L2, ML1^OL2 decides L1 ML1 may query OL2 many times (with different inputs)

Turing and Many-One

4

slide-14
SLIDE 14

Turing reduction: Build a TM (oracle machine) ML1, s.t. using the oracle OL2 which decides L2, ML1^OL2 decides L1 ML1 may query OL2 many times (with different inputs) Many-One:

Turing and Many-One

4

slide-15
SLIDE 15

Turing reduction: Build a TM (oracle machine) ML1, s.t. using the oracle OL2 which decides L2, ML1^OL2 decides L1 ML1 may query OL2 many times (with different inputs) Many-One: ML1 can query OL2 only once, and must output what OL2 outputs

Turing and Many-One

4

slide-16
SLIDE 16

Turing reduction: Build a TM (oracle machine) ML1, s.t. using the oracle OL2 which decides L2, ML1^OL2 decides L1 ML1 may query OL2 many times (with different inputs) Many-One: ML1 can query OL2 only once, and must output what OL2 outputs ML1 maps its input x to an input f(x) for OL2

Turing and Many-One

4

slide-17
SLIDE 17

Turing reduction: Build a TM (oracle machine) ML1, s.t. using the oracle OL2 which decides L2, ML1^OL2 decides L1 ML1 may query OL2 many times (with different inputs) Many-One: ML1 can query OL2 only once, and must output what OL2 outputs ML1 maps its input x to an input f(x) for OL2 x ∈ L1 ⇒ f(x) ∈ L2 and x ! L1 ⇒ f(x) ! L2

Turing and Many-One

4

slide-18
SLIDE 18

Turing reduction: Build a TM (oracle machine) ML1, s.t. using the oracle OL2 which decides L2, ML1^OL2 decides L1 ML1 may query OL2 many times (with different inputs) Many-One: ML1 can query OL2 only once, and must output what OL2 outputs ML1 maps its input x to an input f(x) for OL2 x ∈ L1 ⇒ f(x) ∈ L2 and x ! L1 ⇒ f(x) ! L2 L1 L2

Turing and Many-One

4

slide-19
SLIDE 19

Turing reduction: Build a TM (oracle machine) ML1, s.t. using the oracle OL2 which decides L2, ML1^OL2 decides L1 ML1 may query OL2 many times (with different inputs) Many-One: ML1 can query OL2 only once, and must output what OL2 outputs ML1 maps its input x to an input f(x) for OL2 x ∈ L1 ⇒ f(x) ∈ L2 and x ! L1 ⇒ f(x) ! L2 L1 L2

Turing and Many-One

4

slide-20
SLIDE 20

Turing reduction: Build a TM (oracle machine) ML1, s.t. using the oracle OL2 which decides L2, ML1^OL2 decides L1 ML1 may query OL2 many times (with different inputs) Many-One: ML1 can query OL2 only once, and must output what OL2 outputs ML1 maps its input x to an input f(x) for OL2 x ∈ L1 ⇒ f(x) ∈ L2 and x ! L1 ⇒ f(x) ! L2 L1 L2

Turing and Many-One

4

slide-21
SLIDE 21

Polynomial-Time Reduction

5

slide-22
SLIDE 22

Polynomial-Time Reduction

Many-one reduction, where ML1 runs in polynomial time

5

slide-23
SLIDE 23

Polynomial-Time Reduction

Many-one reduction, where ML1 runs in polynomial time L1 !p L2

5

slide-24
SLIDE 24

Polynomial-Time Reduction

Many-one reduction, where ML1 runs in polynomial time L1 !p L2 L2 is “computationally (almost) as hard or harder” compared to L1

5

slide-25
SLIDE 25

Polynomial-Time Reduction

Many-one reduction, where ML1 runs in polynomial time L1 !p L2 L2 is “computationally (almost) as hard or harder” compared to L1 “almost”: reduction overheads (reduction time, size blow-up)

5

slide-26
SLIDE 26

Polynomial-Time Reduction

Many-one reduction, where ML1 runs in polynomial time L1 !p L2 L2 is “computationally (almost) as hard or harder” compared to L1 “almost”: reduction overheads (reduction time, size blow-up) L2 may be way harder

5

slide-27
SLIDE 27

Cook, Karp, Levin

6

slide-28
SLIDE 28

Cook, Karp, Levin

Polynomial-time reduction

6

slide-29
SLIDE 29

Cook, Karp, Levin

Polynomial-time reduction Cook: Turing reduction

6

slide-30
SLIDE 30

Cook, Karp, Levin

Polynomial-time reduction Cook: Turing reduction Karp: Many-one reduction

6

slide-31
SLIDE 31

Cook, Karp, Levin

Polynomial-time reduction Cook: Turing reduction Karp: Many-one reduction We use this for !p

6

slide-32
SLIDE 32

Cook, Karp, Levin

Polynomial-time reduction Cook: Turing reduction Karp: Many-one reduction We use this for !p Between NP languages

6

slide-33
SLIDE 33

Cook, Karp, Levin

Polynomial-time reduction Cook: Turing reduction Karp: Many-one reduction We use this for !p Between NP languages Levin: Karp + witnesses easily transformed back and forth

6

slide-34
SLIDE 34

Cook, Karp, Levin

Polynomial-time reduction Cook: Turing reduction Karp: Many-one reduction We use this for !p Between NP languages Levin: Karp + witnesses easily transformed back and forth Parsimonious: Karp + number

  • f witnesses doesn’

t change

6

slide-35
SLIDE 35

NP-completeness

7

slide-36
SLIDE 36

NP-completeness

A language L is NP-Hard if for all L ’ in NP, L ’ !p L

7

slide-37
SLIDE 37

NP-completeness

A language L is NP-Hard if for all L ’ in NP, L ’ !p L A language L is NP-Complete if it is NP-Hard and is in NP

7

slide-38
SLIDE 38

NP-completeness

A language L is NP-Hard if for all L ’ in NP, L ’ !p L A language L is NP-Complete if it is NP-Hard and is in NP To efficiently solve all problems in NP, you need to efficiently solve L and nothing more

7

slide-39
SLIDE 39

A simple NPC language

8

slide-40
SLIDE 40

A simple NPC language

TMSAT = { (M,z,1n,1t) | ∃w, |w|<n, s.t. TM represented by M accepts (z,w) within time t }

8

slide-41
SLIDE 41

A simple NPC language

TMSAT = { (M,z,1n,1t) | ∃w, |w|<n, s.t. TM represented by M accepts (z,w) within time t } TMSAT is in NP: TMVAL = { (M,z,1n,1t,w) | |w|<n and TM represented by M accepts (z,w) within time t } is in P

8

slide-42
SLIDE 42

A simple NPC language

TMSAT = { (M,z,1n,1t) | ∃w, |w|<n, s.t. TM represented by M accepts (z,w) within time t } TMSAT is in NP: TMVAL = { (M,z,1n,1t,w) | |w|<n and TM represented by M accepts (z,w) within time t } is in P TMSAT is NP-hard: Given a language L in NP defined as L = { x | ∃w, |w|<n s.t. ML

’ accepts (x,w) } and ML ’ runs

within time t, (where n,t are poly(|x|) ), let the Karp reduction be f(x) = (ML

’,x,1n,1t)

8

slide-43
SLIDE 43

A simple NPC language

TMSAT = { (M,z,1n,1t) | ∃w, |w|<n, s.t. TM represented by M accepts (z,w) within time t } TMSAT is in NP: TMVAL = { (M,z,1n,1t,w) | |w|<n and TM represented by M accepts (z,w) within time t } is in P TMSAT is NP-hard: Given a language L in NP defined as L = { x | ∃w, |w|<n s.t. ML

’ accepts (x,w) } and ML ’ runs

within time t, (where n,t are poly(|x|) ), let the Karp reduction be f(x) = (ML

’,x,1n,1t)

Any “natural” NPC language?

8

slide-44
SLIDE 44

Boolean Circuits

1

9

slide-45
SLIDE 45

Boolean Circuits

Boolean valued wires, AND, OR, NOT, CONST gates, inputs, output, directed acyclic graph

1

9

slide-46
SLIDE 46

Boolean Circuits

Boolean valued wires, AND, OR, NOT, CONST gates, inputs, output, directed acyclic graph Circuit evaluation CKT-VAL: given (ckt,inputs) find ckt’ s boolean

  • utput value

1

9

slide-47
SLIDE 47

Boolean Circuits

Boolean valued wires, AND, OR, NOT, CONST gates, inputs, output, directed acyclic graph Circuit evaluation CKT-VAL: given (ckt,inputs) find ckt’ s boolean

  • utput value

Can be done very efficiently: CKT-VAL is in P

1

9

slide-48
SLIDE 48

Boolean Circuits

Boolean valued wires, AND, OR, NOT, CONST gates, inputs, output, directed acyclic graph Circuit evaluation CKT-VAL: given (ckt,inputs) find ckt’ s boolean

  • utput value

Can be done very efficiently: CKT-VAL is in P CKT-SAT: given ckt, is there a “satisfying” input (output=1). In NP.

1

9

slide-49
SLIDE 49

CKT-SAT is NP-Complete

10

slide-50
SLIDE 50

CKT-SAT is NP-Complete

Reduce any NP language L to CKT-SAT

10

slide-51
SLIDE 51

CKT-SAT is NP-Complete

Reduce any NP language L to CKT-SAT Let’ s start from the TM for verifying membership in L, with time bound T

10

slide-52
SLIDE 52

CKT-SAT is NP-Complete

Reduce any NP language L to CKT-SAT Let’ s start from the TM for verifying membership in L, with time bound T Build a circuit which on input w outputs what the TM outputs on (x,w), within T steps

10

slide-53
SLIDE 53

CKT-SAT is NP-Complete

Reduce any NP language L to CKT-SAT Let’ s start from the TM for verifying membership in L, with time bound T Build a circuit which on input w outputs what the TM outputs on (x,w), within T steps This circuit is an instance of CKT-SAT

10

slide-54
SLIDE 54

CKT-SAT is NP-Complete

Reduce any NP language L to CKT-SAT Let’ s start from the TM for verifying membership in L, with time bound T Build a circuit which on input w outputs what the TM outputs on (x,w), within T steps This circuit is an instance of CKT-SAT Ensure reduction is poly-time

10

slide-55
SLIDE 55

TM to Circuit

(x,w)

11

slide-56
SLIDE 56

TM to Circuit

Wires for configurations: a bundle for each tape cell, encoding (content,state), where state is encoded in the cell with the head (x,w)

11

slide-57
SLIDE 57

TM to Circuit

Wires for configurations: a bundle for each tape cell, encoding (content,state), where state is encoded in the cell with the head (x,w)

11

slide-58
SLIDE 58

TM to Circuit

Wires for configurations: a bundle for each tape cell, encoding (content,state), where state is encoded in the cell with the head Circuitry for evolution: each bundle depends (as specified by the TM) on 3 neighboring bundles at the previous level (x,w)

11

slide-59
SLIDE 59

TM to Circuit

Wires for configurations: a bundle for each tape cell, encoding (content,state), where state is encoded in the cell with the head Circuitry for evolution: each bundle depends (as specified by the TM) on 3 neighboring bundles at the previous level (Part of) initial configuration, namely w, to be plugged in as input (x,w)

11

slide-60
SLIDE 60

TM to Circuit

Wires for configurations: a bundle for each tape cell, encoding (content,state), where state is encoded in the cell with the head Circuitry for evolution: each bundle depends (as specified by the TM) on 3 neighboring bundles at the previous level (Part of) initial configuration, namely w, to be plugged in as input x,q0 (x,w)

11

slide-61
SLIDE 61

TM to Circuit

Wires for configurations: a bundle for each tape cell, encoding (content,state), where state is encoded in the cell with the head Circuitry for evolution: each bundle depends (as specified by the TM) on 3 neighboring bundles at the previous level (Part of) initial configuration, namely w, to be plugged in as input x,q0 (x,w) w

11

slide-62
SLIDE 62

TM to Circuit

Wires for configurations: a bundle for each tape cell, encoding (content,state), where state is encoded in the cell with the head Circuitry for evolution: each bundle depends (as specified by the TM) on 3 neighboring bundles at the previous level (Part of) initial configuration, namely w, to be plugged in as input T configurations, T bundles each x,q0 (x,w) w

11

slide-63
SLIDE 63

TM to Circuit

Wires for configurations: a bundle for each tape cell, encoding (content,state), where state is encoded in the cell with the head Circuitry for evolution: each bundle depends (as specified by the TM) on 3 neighboring bundles at the previous level (Part of) initial configuration, namely w, to be plugged in as input T configurations, T bundles each Circuit size = O(T2) x,q0 (x,w) w

11

slide-64
SLIDE 64

TM to Circuit

x,q0 (x,w) w

12

slide-65
SLIDE 65

TM to Circuit

Reducing any NP language L to CKT-SAT x,q0 (x,w) w

12

slide-66
SLIDE 66

TM to Circuit

Reducing any NP language L to CKT-SAT TM for verifying membership in L, time-bound T, and input x " A circuit which on input w

  • utputs what the TM outputs
  • n (x,w) within T steps

x,q0 (x,w) w

12

slide-67
SLIDE 67

TM to Circuit

Reducing any NP language L to CKT-SAT TM for verifying membership in L, time-bound T, and input x " A circuit which on input w

  • utputs what the TM outputs
  • n (x,w) within T steps

Poly-time reduction x,q0 (x,w) w

12

slide-68
SLIDE 68

TM to Circuit

Reducing any NP language L to CKT-SAT TM for verifying membership in L, time-bound T, and input x " A circuit which on input w

  • utputs what the TM outputs
  • n (x,w) within T steps

Poly-time reduction CKT-SAT is NP-complete x,q0 (x,w) w

12

slide-69
SLIDE 69

Other NP-complete problems

13

slide-70
SLIDE 70

Other NP-complete problems

SAT and 3SAT

13

slide-71
SLIDE 71

Other NP-complete problems

SAT and 3SAT SAT: Are all given “clauses” simultaneously satisfiable? (Conjunctive Normal Form)

13

slide-72
SLIDE 72

Other NP-complete problems

SAT and 3SAT SAT: Are all given “clauses” simultaneously satisfiable? (Conjunctive Normal Form) 3SAT: Each clause has at most 3 literals

13

slide-73
SLIDE 73

Other NP-complete problems

SAT and 3SAT SAT: Are all given “clauses” simultaneously satisfiable? (Conjunctive Normal Form) 3SAT: Each clause has at most 3 literals CLIQUE, INDEP-SET, VERTEX-COVER

13

slide-74
SLIDE 74

Other NP-complete problems

SAT and 3SAT SAT: Are all given “clauses” simultaneously satisfiable? (Conjunctive Normal Form) 3SAT: Each clause has at most 3 literals CLIQUE, INDEP-SET, VERTEX-COVER Hundreds (thousands?) more known

13

slide-75
SLIDE 75

Other NP-complete problems

SAT and 3SAT SAT: Are all given “clauses” simultaneously satisfiable? (Conjunctive Normal Form) 3SAT: Each clause has at most 3 literals CLIQUE, INDEP-SET, VERTEX-COVER Hundreds (thousands?) more known Shown using already known ones:

13

slide-76
SLIDE 76

Other NP-complete problems

SAT and 3SAT SAT: Are all given “clauses” simultaneously satisfiable? (Conjunctive Normal Form) 3SAT: Each clause has at most 3 literals CLIQUE, INDEP-SET, VERTEX-COVER Hundreds (thousands?) more known Shown using already known ones: If L !p L1 and L1 !p L2, then L !p L2

13

slide-77
SLIDE 77

CKT-SAT #p SAT

14

slide-78
SLIDE 78

CKT-SAT #p SAT

Converting a circuit to a collection of clauses:

14

slide-79
SLIDE 79

CKT-SAT #p SAT

Converting a circuit to a collection of clauses: For each wire (connected component), add a variable

14

slide-80
SLIDE 80

CKT-SAT #p SAT

Converting a circuit to a collection of clauses: For each wire (connected component), add a variable For each gate, add a clause involving variables for wires connected to the gate:

14

slide-81
SLIDE 81

CKT-SAT #p SAT

Converting a circuit to a collection of clauses: For each wire (connected component), add a variable For each gate, add a clause involving variables for wires connected to the gate: e.g. : (z⇒x), (z⇒y), (¬z ⇒ ¬x ∨ ¬y). i.e., (¬z ∨ x), (¬z ∨ y), (z ∨ ¬x ∨ ¬y).

AND

x y z

14

slide-82
SLIDE 82

CKT-SAT #p SAT

Converting a circuit to a collection of clauses: For each wire (connected component), add a variable For each gate, add a clause involving variables for wires connected to the gate: e.g. : (z⇒x), (z⇒y), (¬z ⇒ ¬x ∨ ¬y). i.e., (¬z ∨ x), (¬z ∨ y), (z ∨ ¬x ∨ ¬y). and : (z⇒x ∨ y), (¬z⇒¬x), (¬z⇒¬y).

AND

x y z

OR

x y z

14

slide-83
SLIDE 83

SAT #p 3SAT

15

slide-84
SLIDE 84

SAT #p 3SAT

Previous reduction was to 3SAT, so 3SAT is NP-complete. And SAT is in NP. So SAT !p 3SAT.

15

slide-85
SLIDE 85

SAT #p 3SAT

Previous reduction was to 3SAT, so 3SAT is NP-complete. And SAT is in NP. So SAT !p 3SAT. More directly:

15

slide-86
SLIDE 86

SAT #p 3SAT

Previous reduction was to 3SAT, so 3SAT is NP-complete. And SAT is in NP. So SAT !p 3SAT. More directly: (a ∨ b ∨ c ∨ d ∨ e) " (a ∨ b ∨ x), (¬x ∨ c ∨ d ∨ e) " (a ∨ b ∨ x), (¬x ∨ c ∨ y), (¬y ∨ d ∨ e)

15

slide-87
SLIDE 87

SAT #p 3SAT

Previous reduction was to 3SAT, so 3SAT is NP-complete. And SAT is in NP. So SAT !p 3SAT. More directly: (a ∨ b ∨ c ∨ d ∨ e) " (a ∨ b ∨ x), (¬x ∨ c ∨ d ∨ e) " (a ∨ b ∨ x), (¬x ∨ c ∨ y), (¬y ∨ d ∨ e) Reduction needs 3SAT

15

slide-88
SLIDE 88

SAT #p 3SAT

Previous reduction was to 3SAT, so 3SAT is NP-complete. And SAT is in NP. So SAT !p 3SAT. More directly: (a ∨ b ∨ c ∨ d ∨ e) " (a ∨ b ∨ x), (¬x ∨ c ∨ d ∨ e) " (a ∨ b ∨ x), (¬x ∨ c ∨ y), (¬y ∨ d ∨ e) Reduction needs 3SAT 2SAT is in fact in P! [Exercise]

15

slide-89
SLIDE 89

SAT #p 3SAT

Previous reduction was to 3SAT, so 3SAT is NP-complete. And SAT is in NP. So SAT !p 3SAT. More directly: (a ∨ b ∨ c ∨ d ∨ e) " (a ∨ b ∨ x), (¬x ∨ c ∨ d ∨ e) " (a ∨ b ∨ x), (¬x ∨ c ∨ y), (¬y ∨ d ∨ e) Reduction needs 3SAT 2SAT is in fact in P! [Exercise] Reduction not parsimonious (can you make it? [Exercise])

15

slide-90
SLIDE 90

3SAT #p CLIQUE

16

slide-91
SLIDE 91

3SAT #p CLIQUE

Clauses " Graph

16

slide-92
SLIDE 92

3SAT #p CLIQUE

Clauses " Graph

(x ∨ ¬y ∨ ¬z) (w ∨ x ∨ ¬z) (w ∨ y)

16

slide-93
SLIDE 93

3SAT #p CLIQUE

Clauses " Graph vertices: each clause’ s satisfying assignments (for its variables)

(x ∨ ¬y ∨ ¬z) (w ∨ x ∨ ¬z) (w ∨ y)

16

slide-94
SLIDE 94

3SAT #p CLIQUE

Clauses " Graph vertices: each clause’ s satisfying assignments (for its variables)

(x ∨ ¬y ∨ ¬z) (w ∨ x ∨ ¬z)

0*1* 1*1* 1*0*

(w ∨ y)

16

slide-95
SLIDE 95

3SAT #p CLIQUE

Clauses " Graph vertices: each clause’ s satisfying assignments (for its variables)

(x ∨ ¬y ∨ ¬z) (w ∨ x ∨ ¬z)

0*1* 1*1* 1*0*

(w ∨ y)

16

slide-96
SLIDE 96

3SAT #p CLIQUE

Clauses " Graph vertices: each clause’ s satisfying assignments (for its variables)

(x ∨ ¬y ∨ ¬z)

*000 *001 *010 *100 *101 *110 *111

(w ∨ x ∨ ¬z)

0*1* 1*1* 1*0*

(w ∨ y)

16

slide-97
SLIDE 97

3SAT #p CLIQUE

Clauses " Graph vertices: each clause’ s satisfying assignments (for its variables)

(x ∨ ¬y ∨ ¬z)

*000 *001 *010 *100 *101 *110 *111

(w ∨ x ∨ ¬z)

0*1* 1*1* 1*0*

(w ∨ y)

16

slide-98
SLIDE 98

3SAT #p CLIQUE

Clauses " Graph vertices: each clause’ s satisfying assignments (for its variables)

(x ∨ ¬y ∨ ¬z)

*000 *001 *010 *100 *101 *110 *111

(w ∨ x ∨ ¬z)

00*0 01*1 01*0 10*0 10*1 11*0 11*1 0*1* 1*1* 1*0*

(w ∨ y)

16

slide-99
SLIDE 99

3SAT #p CLIQUE

Clauses " Graph vertices: each clause’ s satisfying assignments (for its variables) edges between consistent assignments

(x ∨ ¬y ∨ ¬z)

*000 *001 *010 *100 *101 *110 *111

(w ∨ x ∨ ¬z)

00*0 01*1 01*0 10*0 10*1 11*0 11*1 0*1* 1*1* 1*0*

(w ∨ y)

16

slide-100
SLIDE 100

3SAT #p CLIQUE

Clauses " Graph vertices: each clause’ s satisfying assignments (for its variables) edges between consistent assignments

(x ∨ ¬y ∨ ¬z)

*000 *001 *010 *100 *101 *110 *111

(w ∨ x ∨ ¬z)

00*0 01*1 01*0 10*0 10*1 11*0 11*1 0*1* 1*1* 1*0*

(w ∨ y)

16

slide-101
SLIDE 101

3SAT #p CLIQUE

Clauses " Graph vertices: each clause’ s satisfying assignments (for its variables) edges between consistent assignments

(x ∨ ¬y ∨ ¬z)

*000 *001 *010 *100 *101 *110 *111

(w ∨ x ∨ ¬z)

00*0 01*1 01*0 10*0 10*1 11*0 11*1 0*1* 1*1* 1*0*

(w ∨ y)

16

slide-102
SLIDE 102

3SAT #p CLIQUE

Clauses " Graph vertices: each clause’ s satisfying assignments (for its variables) edges between consistent assignments

(x ∨ ¬y ∨ ¬z)

*000 *001 *010 *100 *101 *110 *111

(w ∨ x ∨ ¬z)

00*0 01*1 01*0 10*0 10*1 11*0 11*1 0*1* 1*1* 1*0*

(w ∨ y)

16

slide-103
SLIDE 103

3SAT #p CLIQUE

Clauses " Graph vertices: each clause’ s satisfying assignments (for its variables) edges between consistent assignments

(x ∨ ¬y ∨ ¬z)

*000 *001 *010 *100 *101 *110 *111

(w ∨ x ∨ ¬z)

00*0 01*1 01*0 10*0 10*1 11*0 11*1 0*1* 1*1* 1*0*

(w ∨ y)

16

slide-104
SLIDE 104

3SAT #p CLIQUE

Clauses " Graph vertices: each clause’ s satisfying assignments (for its variables) edges between consistent assignments

(x ∨ ¬y ∨ ¬z)

*000 *001 *010 *100 *101 *110 *111

(w ∨ x ∨ ¬z)

00*0 01*1 01*0 10*0 10*1 11*0 11*1 0*1* 1*1* 1*0*

(w ∨ y)

16

slide-105
SLIDE 105

3SAT #p CLIQUE

Clauses " Graph vertices: each clause’ s satisfying assignments (for its variables) edges between consistent assignments m-clique iff all m clauses satisfiable

(x ∨ ¬y ∨ ¬z)

*000 *001 *010 *100 *101 *110 *111

(w ∨ x ∨ ¬z)

00*0 01*1 01*0 10*0 10*1 11*0 11*1 0*1* 1*1* 1*0*

(w ∨ y)

16

slide-106
SLIDE 106

3SAT #p CLIQUE

Clauses " Graph vertices: each clause’ s satisfying assignments (for its variables) edges between consistent assignments m-clique iff all m clauses satisfiable

(x ∨ ¬y ∨ ¬z)

*000 *001 *010 *100 *101 *110 *111

(w ∨ x ∨ ¬z)

00*0 01*1 01*0 10*0 10*1 11*0 11*1 0*1* 1*1* 1*0*

(w ∨ y)

16

slide-107
SLIDE 107

3SAT #p CLIQUE

Clauses " Graph vertices: each clause’ s satisfying assignments (for its variables) edges between consistent assignments m-clique iff all m clauses satisfiable

(x ∨ ¬y ∨ ¬z)

*000 *001 *010 *100 *101 *110 *111

(w ∨ x ∨ ¬z)

00*0 01*1 01*0 10*0 10*1 11*0 11*1 0*1* 1*1* 1*0*

(w ∨ y)

1*1* *110 11*0

  • 1110

sat assignment 3-Clique

16

slide-108
SLIDE 108

INDEP-SET and VERTEX-COVER

17

slide-109
SLIDE 109

INDEP-SET and VERTEX-COVER

CLIQUE !p INDEP-SET

17

slide-110
SLIDE 110

INDEP-SET and VERTEX-COVER

CLIQUE !p INDEP-SET G has an m-clique iff G’ has an m-independent-set

17

slide-111
SLIDE 111

INDEP-SET and VERTEX-COVER

CLIQUE !p INDEP-SET G has an m-clique iff G’ has an m-independent-set INDEP-SET !p VERTEX-COVER

17

slide-112
SLIDE 112

INDEP-SET and VERTEX-COVER

CLIQUE !p INDEP-SET G has an m-clique iff G’ has an m-independent-set INDEP-SET !p VERTEX-COVER G has an m-indep-set iff G has an (n-m)-vertex-cover

17

slide-113
SLIDE 113

NP, P, co-NP and NPC

P NP coNP

NPC coNPC

18

slide-114
SLIDE 114

NP, P, co-NP and NPC

We say class X is “closed under polynomial reductions” if (L1 !p L2 and L2 in class X) implies L1 in X

P NP coNP

NPC coNPC

18

slide-115
SLIDE 115

NP, P, co-NP and NPC

We say class X is “closed under polynomial reductions” if (L1 !p L2 and L2 in class X) implies L1 in X e.g. P, NP are closed under polynomial reductions

P NP coNP

NPC coNPC

18

slide-116
SLIDE 116

NP, P, co-NP and NPC

We say class X is “closed under polynomial reductions” if (L1 !p L2 and L2 in class X) implies L1 in X e.g. P, NP are closed under polynomial reductions So is co-NP (If X is closed, so is co-X. Why?)

P NP coNP

NPC coNPC

18

slide-117
SLIDE 117

NP, P, co-NP and NPC

We say class X is “closed under polynomial reductions” if (L1 !p L2 and L2 in class X) implies L1 in X e.g. P, NP are closed under polynomial reductions So is co-NP (If X is closed, so is co-X. Why?) If any NPC language is in P, then NP = P

P NP coNP

NPC coNPC

18

slide-118
SLIDE 118

NP, P, co-NP and NPC

We say class X is “closed under polynomial reductions” if (L1 !p L2 and L2 in class X) implies L1 in X e.g. P, NP are closed under polynomial reductions So is co-NP (If X is closed, so is co-X. Why?) If any NPC language is in P, then NP = P If any NPC language is in co-NP, then NP = co-NP

P NP coNP

NPC coNPC

18

slide-119
SLIDE 119

NP, P, co-NP and NPC

We say class X is “closed under polynomial reductions” if (L1 !p L2 and L2 in class X) implies L1 in X e.g. P, NP are closed under polynomial reductions So is co-NP (If X is closed, so is co-X. Why?) If any NPC language is in P, then NP = P If any NPC language is in co-NP, then NP = co-NP Note: X ⊆ co-X ⇒ X = co-X (Why?)

P NP coNP

NPC coNPC

18

slide-120
SLIDE 120

NP, P, co-NP and NPC

We say class X is “closed under polynomial reductions” if (L1 !p L2 and L2 in class X) implies L1 in X e.g. P, NP are closed under polynomial reductions So is co-NP (If X is closed, so is co-X. Why?) If any NPC language is in P, then NP = P If any NPC language is in co-NP, then NP = co-NP Note: X ⊆ co-X ⇒ X = co-X (Why?) L is NP-complete iff Lc is co-NP-complete (Why?)

P NP coNP

NPC coNPC

18

slide-121
SLIDE 121

NP, P, co-NP and NPC

We say class X is “closed under polynomial reductions” if (L1 !p L2 and L2 in class X) implies L1 in X e.g. P, NP are closed under polynomial reductions So is co-NP (If X is closed, so is co-X. Why?) If any NPC language is in P, then NP = P If any NPC language is in co-NP, then NP = co-NP Note: X ⊆ co-X ⇒ X = co-X (Why?) L is NP-complete iff Lc is co-NP-complete (Why?) co-NP complete = co-(NP-complete)

P NP coNP

NPC coNPC

18

slide-122
SLIDE 122

Today

19

slide-123
SLIDE 123

Today

Polynomial-time reductions

19

slide-124
SLIDE 124

Today

Polynomial-time reductions NP-completeness (using Karp reductions)

19

slide-125
SLIDE 125

Today

Polynomial-time reductions NP-completeness (using Karp reductions) Trivially, TMSAT

19

slide-126
SLIDE 126

Today

Polynomial-time reductions NP-completeness (using Karp reductions) Trivially, TMSAT Interestingly, CKT-SAT, SAT, 3SAT, CLIQUE, INDEP-SET, VERTEX-COVER

19

slide-127
SLIDE 127

Today

Polynomial-time reductions NP-completeness (using Karp reductions) Trivially, TMSAT Interestingly, CKT-SAT, SAT, 3SAT, CLIQUE, INDEP-SET, VERTEX-COVER If any NPC language in P, then P=NP

19

slide-128
SLIDE 128

Next Time

20

slide-129
SLIDE 129

Next Time

Ladner’ s Theorem: If NP ! P, then non-P, non-NPC languages

20

slide-130
SLIDE 130

Next Time

Ladner’ s Theorem: If NP ! P, then non-P, non-NPC languages Time hierarchy theorems: More time, more power, strictly!

20