Lecture: Approximation Algorithms Lecture: Approximation Algorithms - - PowerPoint PPT Presentation

lecture approximation algorithms lecture approximation
SMART_READER_LITE
LIVE PREVIEW

Lecture: Approximation Algorithms Lecture: Approximation Algorithms - - PowerPoint PPT Presentation

Lecture: Approximation Algorithms Lecture: Approximation Algorithms Jannik Matuschke November 5, 2018 Dynamic Programming Example I: The Knapsack Problem The Knapsack Problem Input: set of n items I , capacity B , for each item i [ n ]:


slide-1
SLIDE 1

Jannik Matuschke November 5, 2018

Lecture: Approximation Algorithms Lecture: Approximation Algorithms

slide-2
SLIDE 2

Dynamic Programming

Example I: The Knapsack Problem

slide-3
SLIDE 3

The Knapsack Problem

Input: set of n items I, capacity B, for each item i ∈ [n]: value vi, size si (all integers) Task: find S ⊆ I with

i∈S si ≤ B,

maximizing value

i∈S vi

slide-4
SLIDE 4

A dynamic program

Idea: store all “good” subsets of {1, . . . , j} in A(j)

slide-5
SLIDE 5

A dynamic program

Idea: store all “good” subsets of {1, . . . , j} in A(j) Dominance: X Y :⇔ s(X) ≤ s(Y ) and v(X) ≥ v(Y ) We don’t need Y if we have X ...

slide-6
SLIDE 6

A dynamic program

Idea: store all “good” subsets of {1, . . . , j} in A(j) Dominance: X Y :⇔ s(X) ≤ s(Y ) and v(X) ≥ v(Y ) We don’t need Y if we have X ... Algorithm 1 (DP for Knapsack)

1 A(0) := {∅} 2 for j := 1 to n

A(j) := A(j − 1) for each X ∈ A(j) if s(X) + sj ≤ B then add X ∪ {j} to A(j) while (∃X, Y ∈ A(j) with X Y ) remove Y from A(j)

3 return X ∈ A(n) maximizing v(X)

slide-7
SLIDE 7

An approximation scheme

Idea: make V smaller by scaling all vi down (and rounding)

slide-8
SLIDE 8

An approximation scheme

Idea: make V smaller by scaling all vi down (and rounding) Let’s try to get a (1 − ε)-approximation for some ε > 0.

slide-9
SLIDE 9

An approximation scheme

Idea: make V smaller by scaling all vi down (and rounding) Let’s try to get a (1 − ε)-approximation for some ε > 0. Algorithm 2 (FPTAS for Knapsack)

1 M := max{vi : i ∈ [n], si ≤ B},

µ := εM

n

2 v′

i := ⌊vi/µ⌋ for all i ∈ [n]

3 Solve instance with v′ instead of v, using Algorithm 1.

slide-10
SLIDE 10

An approximation scheme

Idea: make V smaller by scaling all vi down (and rounding) Let’s try to get a (1 − ε)-approximation for some ε > 0. Algorithm 2 (FPTAS for Knapsack)

1 M := max{vi : i ∈ [n], si ≤ B},

µ := εM

n

2 v′

i := ⌊vi/µ⌋ for all i ∈ [n]

3 Solve instance with v′ instead of v, using Algorithm 1.

Polynomial-time Approximation Scheme (PTAS): (1 − ε)-approximation for every ε > 0 Fully Polynomial-time Approximation Scheme (FPTAS): (1 − ε)-approximation for every ε > 0, running time polynomial in encoding and 1/ε