computational complexity

26
1 Computational Complexity CPSC 468b, Spring 2007 Time: Tu & Th, 1:00-2:15 pm Room: AKW 500 Dist. Group: IV (not Natural Sci.) Satisfies “QR” http://zoo.cs.yale.edu/classes/ cs468

Upload: kitra-wells

Post on 31-Dec-2015

31 views

Category:

Documents


0 download

DESCRIPTION

Computational Complexity. CPSC 468b, Spring 2007 Time: Tu & Th, 1:00-2:15 pm Room: AKW 500 Dist. Group: IV (not Natural Sci.) Satisfies “QR” http://zoo.cs.yale.edu/classes/cs468. Partial Topic Outline. Complexity classes (P, NP, L, NL, etc .) Reductions and completeness - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Computational Complexity

1

Computational Complexity

CPSC 468b, Spring 2007Time: Tu & Th, 1:00-2:15 pmRoom: AKW 500

Dist. Group: IV (not Natural Sci.)Satisfies “QR”

http://zoo.cs.yale.edu/classes/cs468

Page 2: Computational Complexity

2

Partial Topic Outline

• Complexity classes (P, NP, L, NL, etc.)• Reductions and completeness• The roles of, e.g.,

– Randomness– Interaction– Approximation

• Circuits

Page 3: Computational Complexity

3

Schedule

Feb. 1: First HW Assignment DueFeb. 13: Second HW Assignment DueFeb. 22: Third HW Assignment DueMar. 1: First In-Class ExamMar. 6: Grades on HW1, HW2, HW3, and Ex1 will

be returned to students today or earlier.Mar. 9: Drop DateApr. 10: Fourth HW Assignment DueApr. 19: Fifth HW Assignment Due Apr. 26: Second In-Class Exam

Page 4: Computational Complexity

4

Requirements

• Modest reading assignments• 5 Written HW Assignments, 4 of

which will each be worth 15% of the course grade and one of which will be worth 10% of the course grade

• 2 In-Class Exams, each worth 15% of the course grade

• No final exam during exam week

Page 5: Computational Complexity

5

Rules and Guidelines

• Deadlines are firm. • Announcements and assignments will be

posted on the class webpage (as well as conveyed in class).

• No “collaboration” on homeworks unless you are told otherwise.

• Pick up your graded homeworks and exams promptly, and tell the TA promptly if one is missing.

Page 6: Computational Complexity

6

Instructor: Joan FeigenbaumOffice: AKW 512Office Hours: Tuesday 4-5 pm

Thursday 9-10 amPhone: 203-432-6432Assistant: Judi Paige([email protected], 203-436-1267, AKW

507a, 9am-2pm M-F)

Note: Do not send email to Professor Feigenbaum, who suffers from RSI. Contact her through Ms. Paige or the TA.

Page 7: Computational Complexity

7

TA: Nikhil SrivastavaOffice: AKW 413Office Hours:

Tuesday 10am-11amFriday 10am-11am

Email: [email protected]: 203-432-1245

Page 8: Computational Complexity

8

If you’re undecided … Check out:• www.cs.princeton.edu/theory/complexity/ (a new complexity-theory text by Sanjeev Arora

and Boaz Barak of Princeton)• www.cs.berkeley.edu/~luca/cs278-02/ (a complexity-theory course taught by Luca

Trevisan at Berkeley in 2002)• www.cs.lth.se/home/Rolf_Karlsson/bk/retro.pdf (“NP-Completeness: A Retrospective,” by

Christos Papadimitriou, 1997 International Colloquium on Automata, Languages, and Programming)

Page 9: Computational Complexity

9

Questions?

Page 10: Computational Complexity

10

Computational Complexity

Page 11: Computational Complexity

11

The Big Picture

• Analysis of Algorithms upper bounds on resources to solve a computational problem

• Complexity lower bounds…OR

• Computability Theory What can be computed?

• Complexity What can be computed, given limited resources?

Page 12: Computational Complexity

12

“Computational Problem”

input 2 {0,1}*

output 2 {0,1}*

R

Page 13: Computational Complexity

13

Decision Problem

• Does the input satisfy <property>?

input 2 {0,1}*

output 2 {YES/NO}

R

Page 14: Computational Complexity

14

Decision Problem ~ Language

• L = {YES instances}µ {0,1}*

YES

{0,1}*

Page 15: Computational Complexity

15

Examples

• Is n composite?• Is there a path of length at most k

between s and t in G? (input <G,s,t,k>)

• Does G contain a clique of size ¸ k?• Is G 3-colorable?

Page 16: Computational Complexity

16

Example -- SAT

• Is satisfiable?– Boolean formula on x1… xn

(x1Ç x3Ç x5)Æ(x3Ç x4)Æ(x4Çx5Ç x1)

– Is there a satisfying assignment?– YES: (1Ç 0Ç 0)Æ (0Ç 0)Æ (0Ç0Ç

1)

Page 17: Computational Complexity

17

Search Problem

• Given x, find y such that R(x,y), or output “no such y”.

x 2 {0,1}* y 2 {0,1}*/NO

R

Page 18: Computational Complexity

18

Examples

• Find a factor f of n such that 1<f<n.• Find an s-t path of length at most k.• Find a clique of size at least k in G.• Find a 3-coloring of G.

• Find an assignment to x1… xn that satisfies

Page 19: Computational Complexity

19

Optimization Problem

• Given x, find y that optimizes some criterion.

x 2 {0,1}* y 2 {0,1}*, that achieves the optimizing value

R

Page 20: Computational Complexity

20

Examples

• Find the largest factor f of n s.t. 1<f<n.

• Find the shortest path between s and t.

• Find the largest clique in G.• Find a coloring of G that uses as

few colors as possible.

Page 21: Computational Complexity

21

Optimization reduces to Decision

• Optimization problems can be reduced to decision problems with small overhead.

• For example, to find the size of the biggest clique in G, binary search on:

Does G contain a clique of size k?

Page 22: Computational Complexity

22

Counting Problem

• Given x, find #y satisfying R(x,y)

x 2 {0,1}* |{y:R(x,y)}|

R

Page 23: Computational Complexity

23

Self-Reducibility of SAT

• can be reduced to two smaller instances

• Each variable must be 0 or 1.

• (x1… xn)2 SAT

iff (0,x2…xn)2 SAT or (1,x2…xn)2 SAT

Page 24: Computational Complexity

24

An Algorithm

• Given (x1… xn)

– If (0,x2…xn)2 SAT, solve recursively on (0,x2…xn)

– If (1,x2…xn)2 SAT, solve recursively on (1,x2…xn)

– Else return UNSAT

• At most n recursive calls

Page 25: Computational Complexity

25

Why is this important?

• R is an NP-relation if 9 poly. p s.t.– For all (x,y)2 R, |y|· p(|x|)– Given x,y, we can check R(x,y) in time

· p(|x|)

• A search problem over such an R is an NP-search problem.

Page 26: Computational Complexity

26

So…

• NP-decision problem:– Given x, does 9y : R(x,y)?

• Cook’s theorem: – If there is a poly. time alg. For SAT,

there are poly. time algs for all NP decision problems

• By self-reducibility, this extends to search problems!