ADVANCED ALGORITHMS Lecture 26: Intractability, review 1 - - PowerPoint PPT Presentation

advanced algorithms
SMART_READER_LITE
LIVE PREVIEW

ADVANCED ALGORITHMS Lecture 26: Intractability, review 1 - - PowerPoint PPT Presentation

ADVANCED ALGORITHMS Lecture 26: Intractability, review 1 ANNOUNCEMENTS HW 6 is due this Friday zip file on Canvas f Project final deadline: Tomorrow! one submission per group Final exam see practice finals and finals of


slide-1
SLIDE 1

ADVANCED ALGORITHMS

Lecture 26: Intractability, review

1

slide-2
SLIDE 2

ANNOUNCEMENTS

➤ HW 6 is due this Friday ➤ Project final deadline: Tomorrow! ➤ Final exam — see practice finals and finals of 2016-17

2

f

zip file

  • n Canvas
  • ne submission

pergroup

OR

everything offline

printed allowed

in this classroom

tuesday

slide-3
SLIDE 3

COMPLEXITY CLASSES, P, NP

3

➤ Decision problems — classes P and NP ➤ NP — non-deterministic polynomial time

slide-4
SLIDE 4

CLASS NP

4

Verifier

(polynomial time) witness w Decision problem. does the given graph have an independent set of size k? Verifier accepts witness iff G is a YES instance

Sudoku

slide-5
SLIDE 5

REDUCTIONS — LAST CLASS

5

Two decision problems, Q and Q’ instances of Q of size N instances of Q’ of size poly(N) YES NO YES NO mapping “f”

  • 1. Mapping poly time
  • 2. Yes instances get

mapped to Yes

  • 3. No instances get

mapped to No

N

p Q

fl I

IT

slide-6
SLIDE 6

REDUCTIONS — WHY?

6

➤ If problem Q’ can be solved in polynomial time, so can problem Q ➤ If problem Q cannot be solved in polynomial time, neither can Q’ ➤ Proving “easyness”: reduce given problem to a known easy problem ➤ Proving “hardness”: reduce a “hard” problem to given problem!

example hard problem?

Q Epa

e.g

reducing a Ebbinghaus

slide-7
SLIDE 7

SATISFIABILITY (SAT)

7

y Do there exist boolean variables x such that y is true?

  • 1. Believe there is NO

polynomial time algorithm

  • 2. Can’t do better than

exhaustive search

  • 3. Don’t know how to prove

this!

  • 4. (Cook-Levin): any problem

in NP reduces to SAT

a

  • r

in

slide-8
SLIDE 8

REDUCTIONS FROM SAT

8

“SAT reduces to my problem”

slide-9
SLIDE 9

OTHER COMMENTS

9

➤ Complexity “classes” P

, NP; notions of NP-hard, NP-complete

➤ Why is it useful to know a problem is NP-hard? ➤ Difficulty of proving P != NP

Q

is NP hard if

SAT 1pA

f

Q is NP complete

can't hope to solve in general

sayEpa

I Emi.ESm

9ei I

hiafqq.sa

i

run

ForSA

best known

2

known lower bounds

Ion

slide-10
SLIDE 10

3-SAT

11

➤ 3-SAT is a basic NP-complete problem — starting point for many

reductions

➤ 2-SAT is easy ➤ 4-SAT, 5-SAT, etc. are only harder — can you see why?

7

SAT Ep

3 SAT 3 SAT Ep Q

slide-11
SLIDE 11

REDUCTIONS — EXAMPLE

10

➤ Last class — outline of SAT —> 3-SAT

SAT reduces to 3-SAT, thus 3-SAT is NP-hard

SAT Ep

3 SAT

I

l

l

It

t

slide-12
SLIDE 12

3-SAT <P INDEPENDENT SET

12

NO

Xl

X

i XgXy

Xn

T

F

T F

8

n

size

polyk

C

X

VI

VX

C

g

s

cx.IT i

I

i

i

cm

O

slide-13
SLIDE 13

I

I

  • n

avg m

and

Guha

3m

ventices

Edgesi

II

across clause edges

in clause edges

between Xi

Xi

Goat

Does there exist

an IS ofsizeE

Can be shown

if

we start with a YES instance

  • f 3 SAT

we

can find such an I S

if

we start

NO

r

get

a

  • unce of I S
slide-14
SLIDE 14

INDEPENDENT SET

13

Cousy

IS

is also NP hard

SAT Ep3 SAT Ep IS

t

t

earlier

how

slide-15
SLIDE 15

APPROXIMATION

14

➤ Fundamental question: do NP-complete problems have good

approximation algorithms? (saw many examples)

➤ Are there limits to approximation?

2

hiring problem

O 63 factor

approx

slide-16
SLIDE 16

PCP THEOREM

15

➤ “Gap inducing reductions” ➤ SAT —> GAP-3-SAT

there

are problems for which

even

approximating

is NP hard

i

g

graphs

with indset

X

I

i

t

Ind set

pdg.cm

slide-17
SLIDE 17

n

n

slide-18
SLIDE 18

REVIEW

16

slide-19
SLIDE 19

THOUGHTS ON COURSE

17

➤ Most variance in background I’ve seen ➤ Focus on the high level, but know that details can be hard (HWs,

project)

➤ “

Algorithmic thinking” — not just a few “basic algorithms” that apply everywhere

➤ Notions of efficiency, complexity are everywhere; space, time,

approximation, …

a

b

randomness

Importanceof reasoning

slide-20
SLIDE 20

TOPICS FOR THE INTERESTED

18

➤ Details of basic graph algorithms ➤ Distributed algorithms ➤ “Online” and other models ➤ Noise tolerant computation ➤ Quantum algorithms

most textbooks

factor efficiently

n digit

number

qubits j

Dt

in

01ns

A

2

I

G l

r

O

slide-21
SLIDE 21

EXAM

19

➤ More of sanity check ➤ Much easier than HW — think simple ➤ Identify key “ideas” covered and understand to reasonable detail