An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For...

58
An Improved FPTAS for 0-1 Knapsack Ce Jin Tsinghua University

Transcript of An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For...

Page 1: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

An Improved FPTAS for 0-1 Knapsack

Ce Jin

Tsinghua University

Page 2: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

𝑛 items

Each item 𝑖 has weight 0 < 𝑀𝑖 ≀ π‘Šand profit 𝑝𝑖 > 0

Given:

β€’ 𝑀 𝐼 ≔ Οƒπ‘–βˆˆπΌπ‘€π‘– ≀ π‘Šβ€’ 𝑝 𝐼 ≔ Οƒπ‘–βˆˆπΌ 𝑝𝑖 is maximized

Find a subset of items 𝐼 βŠ† 𝑛 such that:

0-1 Knapsack Problem

Knapsack capacity π‘Š > 0

Page 3: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

𝑛 items

Each item 𝑖 has weight 0 < 𝑀𝑖 ≀ π‘Šand profit 𝑝𝑖 > 0

Given:

β€’ 𝑀 𝐼 ≔ Οƒπ‘–βˆˆπΌπ‘€π‘– ≀ π‘Šβ€’ 𝑝 𝐼 ≔ Οƒπ‘–βˆˆπΌ 𝑝𝑖 is maximized

Find a subset of items 𝐼 βŠ† 𝑛 such that:

A well-known NP-hard problem

0-1 Knapsack Problem

Knapsack capacity π‘Š > 0

Page 4: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

FPTAS for 0-1 Knapsack

OPT = optimal total profit 𝑝(𝐼)

For πœ€ > 0, find a subset 𝐼 βŠ† 𝑛 such that:

β€’ 𝑀 𝐼 ≀ π‘Š

β€’ 𝑝 𝐼 β‰₯OPT

1+

Solvable in poly 𝑛,1

time

Page 5: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

Prior Work

β€’ ෨𝑂(𝑛3/πœ€) (textbook algorithm)

β€’ ෨𝑂(𝑛 + πœ€βˆ’4) [Ibarra and Kim, 1975]

β€’ ෨𝑂(𝑛 + πœ€βˆ’3) [Kellerer and Pferschy, 2004]

β€’ ෨𝑂(𝑛 + πœ€βˆ’2.5) [Rhee, 2015]

β€’ ෩𝑢(𝒏 + πœΊβˆ’πŸ.πŸ’) [Chan, 2018]

FPTAS for 0-1 Knapsack:

Page 6: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

Prior Work

β€’ ෨𝑂(𝑛3/πœ€) (textbook algorithm)

β€’ ෨𝑂(𝑛 + πœ€βˆ’4) [Ibarra and Kim, 1975]

β€’ ෨𝑂(𝑛 + πœ€βˆ’3) [Kellerer and Pferschy, 2004]

β€’ ෨𝑂(𝑛 + πœ€βˆ’2.5) [Rhee, 2015]

β€’ ෩𝑢(𝒏 + πœΊβˆ’πŸ.πŸ’) [Chan, 2018]

‒෩𝑢(𝒏 + πœΊβˆ’πŸ.πŸπŸ“) (this work)

FPTAS for 0-1 Knapsack:

No 𝑂 𝑛 + πœ€βˆ’1 2βˆ’π›Ώ time algorithm,

unless 𝐦𝐒𝐧,+ convolution has truly subquadratic algo

[Cygan, Mucha, WΔ™grzycki, and WΕ‚odarczyk, 2017]

Conditional Lower Bound:

Page 7: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

A Special Case

FPTAS for Subset Sum (𝑝𝑖 = 𝑀𝑖):

β€’ ෨𝑂 min 𝒏 + πœΊβˆ’πŸ, π‘›πœ€βˆ’1

[Kellerer, Mansini, Pferschy, and Speranza, 2003]

Page 8: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

A Special Case

FPTAS for Subset Sum (𝑝𝑖 = 𝑀𝑖):

β€’ ෨𝑂 min 𝒏 + πœΊβˆ’πŸ, π‘›πœ€βˆ’1

[Kellerer, Mansini, Pferschy, and Speranza, 2003]

Our 0-1 Knapsack algorithm utilizes this result

Page 9: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

β€’Our ෩𝑢(𝒏 + πœΊβˆ’πŸ.πŸπŸ“) algorithm builds on Chan’s ෩𝑢(𝒏 + πœΊβˆ’πŸ.πŸ’) algorithm

β€’Two new ideas

1. Extending Chan’s number-theoretic technique from two levels to multiple levels.

Page 10: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

β€’Our ෩𝑢(𝒏 + πœΊβˆ’πŸ.πŸπŸ“) algorithm builds on Chan’s ෩𝑢(𝒏 + πœΊβˆ’πŸ.πŸ’) algorithm

β€’Two new ideas

1. Extending Chan’s number-theoretic technique from two levels to multiple levels.

2. A greedy argument β‡’ less computationspent on cheap items (small unit profit 𝑝𝑖/𝑀𝑖)

Page 11: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

β€’Our ෩𝑢(𝒏 + πœΊβˆ’πŸ.πŸπŸ“) algorithm builds on Chan’s ෩𝑢(𝒏 + πœΊβˆ’πŸ.πŸ’) algorithm

β€’Two new ideas

1. Extending Chan’s number-theoretic technique from two levels to multiple levels.

2. A greedy argument β‡’ less computationspent on cheap items (small unit profit 𝑝𝑖/𝑀𝑖)

This talk

Page 12: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

β€’Our ෩𝑢(𝒏 + πœΊβˆ’πŸ.πŸπŸ“) algorithm builds on Chan’s ෩𝑢(𝒏 + πœΊβˆ’πŸ.πŸ’) algorithm

β€’Two new ideas

1. Extending Chan’s number-theoretic technique from two levels to multiple levels.

2. A greedy argument β‡’ less computationspent on cheap items (small unit profit 𝑝𝑖/𝑀𝑖)

This talkUsing Chan’s Lemmas

as blackboxes

෩𝑢(𝒏 + πœΊβˆ’πŸ.πŸ‘πŸ‘πŸ‘) algo

Preliminaries (based

on [Chan, 2018])

Page 13: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

Preliminaries

β€’Assume 𝑛 ≀ poly πœ€βˆ’1 .

β€’Too cheap items (𝑝𝑖 < 𝑛max𝑗

𝑝𝑗) are

discarded at the beginning (loss ≀ πœ€ β‹… OPT)

So max 𝑝𝑗

min 𝑝𝑗≀ poly πœ€βˆ’1

𝑛 items, capacity = π‘Šweight 0 < 𝑀𝑖 ≀ π‘Š and profit 𝑝𝑖 > 0

Page 14: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

Preliminaries

𝑛 ≀ poly πœ€βˆ’1 items

profit max 𝑝𝑗/min 𝑝𝑗 ≀ poly πœ€βˆ’1

weight 0 < 𝑀𝑖 ≀ π‘Š

β€’ β€œProfit function” (defined over real π‘₯ β‰₯ 0)𝑓𝐼 π‘₯ = max 𝑝 𝐽 : 𝐽 βŠ† 𝐼, 𝑀 𝐽 ≀ π‘₯

Page 15: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

Preliminaries

𝑛 ≀ poly πœ€βˆ’1 items

profit max 𝑝𝑗/min 𝑝𝑗 ≀ poly πœ€βˆ’1

weight 0 < 𝑀𝑖 ≀ π‘Š

β€’ β€œProfit function” (defined over real π‘₯ β‰₯ 0)𝑓𝐼 π‘₯ = max 𝑝 𝐽 : 𝐽 βŠ† 𝐼, 𝑀 𝐽 ≀ π‘₯

β€’Task: compute a 1 + πœ€ -approximation of profit function 𝑓𝐼,

෩𝑓𝐼 π‘₯ ≀ 𝑓𝐼 π‘₯ ≀ 1 + πœ€ ෩𝑓𝐼 π‘₯ , βˆ€π‘₯ β‰₯ 0

Page 16: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

Preliminaries

𝑛 ≀ poly πœ€βˆ’1 items

profit max 𝑝𝑗/min 𝑝𝑗 ≀ poly πœ€βˆ’1

weight 0 < 𝑀𝑖 ≀ π‘Š

β€’ β€œProfit function” (defined over real π‘₯ β‰₯ 0)𝑓𝐼 π‘₯ = max 𝑝 𝐽 : 𝐽 βŠ† 𝐼, 𝑀 𝐽 ≀ π‘₯

β€’Task: compute a 1 + πœ€ -approximation of profit function 𝑓𝐼,

෩𝑓𝐼 π‘₯ ≀ 𝑓𝐼 π‘₯ ≀ 1 + πœ€ ෩𝑓𝐼 π‘₯ , βˆ€π‘₯ β‰₯ 0

β€’For disjoint sets 𝐼, 𝐽 of items,

𝑓𝐼βˆͺ𝐽 π‘₯ = 𝑓𝐼 βŠ•π‘“π½ π‘₯ ≔ max0≀𝑦≀π‘₯

𝑓𝐼 𝑦 + 𝑓𝐽 π‘₯ βˆ’ 𝑦

Page 17: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

Preliminaries

𝑛 ≀ poly πœ€βˆ’1 items

profit max 𝑝𝑗/min 𝑝𝑗 ≀ poly πœ€βˆ’1

weight 0 < 𝑀𝑖 ≀ π‘Š

β€’ β€œProfit function” (defined over real π‘₯ β‰₯ 0)𝑓𝐼 π‘₯ = max 𝑝 𝐽 : 𝐽 βŠ† 𝐼, 𝑀 𝐽 ≀ π‘₯

β€’Task: compute a 1 + πœ€ -approximation of profit function 𝑓𝐼,

෩𝑓𝐼 π‘₯ ≀ 𝑓𝐼 π‘₯ ≀ 1 + πœ€ ෩𝑓𝐼 π‘₯ , βˆ€π‘₯ β‰₯ 0

β€’For disjoint sets 𝐼, 𝐽 of items,

𝑓𝐼βˆͺ𝐽 π‘₯ = 𝑓𝐼 βŠ•π‘“π½ π‘₯ ≔ max0≀𝑦≀π‘₯

𝑓𝐼 𝑦 + 𝑓𝐽 π‘₯ βˆ’ 𝑦

β€’ ෩𝑓𝐼 βŠ• ෩𝑓𝐽 is a 1 + πœ€ -approximation of 𝑓𝐼βˆͺ𝐽

Page 18: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

Preliminaries

𝑛 ≀ poly πœ€βˆ’1 items

profit max 𝑝𝑗/min 𝑝𝑗 ≀ poly πœ€βˆ’1

β€’A nondecreasing step function 𝑓 has a (1 + πœ€)-approx. with only ෨𝑂 1/πœ€ steps (by rounding down to powers of (1 + πœ€))

Page 19: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

Preliminaries

β€’A nondecreasing step function 𝑓 has a (1 + πœ€)-approx. with only ෨𝑂 1/πœ€ steps (by rounding down to powers of (1 + πœ€))

β€’β€œMerging Lemma”: Computing (a 1 + πœ€ -approx. of) 𝑓1 βŠ•β‹―βŠ•π‘“π‘š takes ෨𝑂 π‘š/πœ€2

time.

(logπ‘š depth binary tree. πœ€β€² ≔ πœ€/ logπ‘š)

𝑓 βŠ• 𝑔 ≔ max0≀𝑦≀π‘₯

𝑓 𝑦 + 𝑔 π‘₯ βˆ’ 𝑦

Page 20: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

β€’Divide items into 𝑂 log 1/πœ€ groups

(group π‘˜: 𝑝𝑖 ∈ [2π‘˜ , 2π‘˜+1])

Preliminaries

𝑛 ≀ poly πœ€βˆ’1 items

profit max 𝑝𝑗/min 𝑝𝑗 ≀ poly πœ€βˆ’1

weight 0 < 𝑀𝑖 ≀ π‘ŠMerging 𝑓1 βŠ•β‹―βŠ•π‘“π‘š: ෨𝑂 π‘š/πœ€2 time.

Page 21: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

β€’Divide items into 𝑂 log 1/πœ€ groups

(group π‘˜: 𝑝𝑖 ∈ [2π‘˜ , 2π‘˜+1])

β€’Compute all π‘“π‘˜ and merge them in ෨𝑂(1/πœ€2) time

Preliminaries

𝑛 ≀ poly πœ€βˆ’1 items

profit max 𝑝𝑗/min 𝑝𝑗 ≀ poly πœ€βˆ’1

weight 0 < 𝑀𝑖 ≀ π‘ŠMerging 𝑓1 βŠ•β‹―βŠ•π‘“π‘š: ෨𝑂 π‘š/πœ€2 time.

Page 22: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

β€’Divide items into 𝑂 log 1/πœ€ groups

(group π‘˜: 𝑝𝑖 ∈ [2π‘˜ , 2π‘˜+1])

β€’Compute all π‘“π‘˜ and merge them in ෨𝑂(1/πœ€2) time

β€’Now assume 𝑝𝑖 ∈ [1,2]

Preliminaries

𝑛 ≀ poly πœ€βˆ’1 items

profit max 𝑝𝑗/min 𝑝𝑗 ≀ poly πœ€βˆ’1

weight 0 < 𝑀𝑖 ≀ π‘ŠMerging 𝑓1 βŠ•β‹―βŠ•π‘“π‘š: ෨𝑂 π‘š/πœ€2 time.

Page 23: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

β€’Simple greedy (sort by unit profit 𝑝1

𝑀1β‰₯

𝑝2

𝑀2β‰₯ β‹―)

approximates with additive error 𝑑 ≀ max 𝑝𝑖 =𝑂(1)

profit 𝑝𝑖 ∈ 1,2weight 0 < 𝑀𝑖 ≀ π‘Š

Preliminaries

Page 24: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

β€’Simple greedy (sort by unit profit 𝑝1

𝑀1β‰₯

𝑝2

𝑀2β‰₯ β‹―)

approximates with additive error 𝑑 ≀ max 𝑝𝑖 =𝑂(1)

β€’For 𝑓 𝑀 β‰₯ Ξ©(πœ€βˆ’1), this is 1 + 𝑂(πœ€)multiplicative approx.

profit 𝑝𝑖 ∈ 1,2weight 0 < 𝑀𝑖 ≀ π‘Š

Preliminaries

Page 25: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

β€’Simple greedy (sort by unit profit 𝑝1

𝑀1β‰₯

𝑝2

𝑀2β‰₯ β‹―)

approximates with additive error 𝑑 ≀ max 𝑝𝑖 =𝑂(1)

β€’For 𝑓 𝑀 β‰₯ Ξ©(πœ€βˆ’1), this is 1 + 𝑂(πœ€)multiplicative approx.

β€’Only need to 1 + 𝑂(πœ€) approximate 𝐦𝐒𝐧 𝑩, 𝒇𝑰 for 𝑩 = 𝑢 πœΊβˆ’πŸ !

profit 𝑝𝑖 ∈ 1,2weight 0 < 𝑀𝑖 ≀ π‘Š

Preliminaries

Page 26: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

β€’Round 𝑝𝑖 down to 1,1 + πœ€, 1 + 2πœ€, … , 2 βˆ’ πœ€

1 + πœ€ multiplicative error

β€’Only π‘š = 𝑂(1/πœ€) different 𝑝𝑖 ’s!

Preliminaries

𝑝𝑖 ∈ 1,2

Page 27: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

β€’Round 𝑝𝑖 down to 1,1 + πœ€, 1 + 2πœ€, … , 2 βˆ’ πœ€

1 + πœ€ multiplicative error

β€’Only π‘š = 𝑂(1/πœ€) different 𝑝𝑖 ’s!

β€’Collect all items with the same profit 𝒑. Then 𝑓𝑝 can be computed by simple greedy (sort 𝑀1 ≀ 𝑀2 ≀ β‹―)

Preliminaries

𝑝𝑖 ∈ 1,2

Page 28: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

Recap

𝑝𝑖 ∈ 1,2

Profit functions 𝑓1, … , π‘“π‘š obtained by simple

greedy (one for every 𝑝𝑖) (π‘š = 𝑂(1/πœ€) )

Task: 1 + 𝑂 πœ€ approximate

min 𝐡, 𝑓1 βŠ•β‹―βŠ•π‘“π‘š (𝐡 = 𝑂(πœ€βˆ’1))

Lemma: Merging 𝑓1 βŠ•β‹―βŠ•π‘“π‘š in ෨𝑂 π‘š/πœ€2 time.

(Immediately gives ෨𝑂(𝑛 + πœ€βˆ’3) algo)

Page 29: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

𝑛 items with π‘š = 𝑂(πœ€βˆ’1) distinct profit values 𝑝𝑖 ∈ 1,2Task: 1 + 𝑂 πœ€ approximate

min 𝐡, 𝑓1 βŠ•β‹―βŠ•π‘“π‘š(𝐡 = 𝑂(πœ€βˆ’1))

෨𝑂 πœ€βˆ’1 π΅π‘š algo(faster when 𝑩 small)

෨𝑂(πœ€βˆ’4/3𝑛 + πœ€βˆ’2) algo(faster when 𝒏 small)

Chan’s results

Page 30: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

A Greedy Lemma

β€’ the items can be divided into two groups 𝐻, 𝐿 with a large enough gap between their unit profits,

maxβ„“βˆˆπΏ

𝑝ℓ/𝑀ℓ ≀ 1 βˆ’ 𝛼 β‹…minβ„Žβˆˆπ»

π‘β„Ž/π‘€β„Ž

β€’ and group 𝐻 is large enough,

Οƒβ„Žβˆˆπ»π‘€β„Ž > π‘Š

𝑝𝑖 ∈ 1,2capacity = π‘Š

If

Then

β€’ In an optimal solution, 𝐿-items contribute total profit ≀ 2/𝛼

Page 31: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

𝑝𝑖 ∈ 1,2capacity = π‘Šmaxβ„“βˆˆπΏ

𝑝ℓ/𝑀ℓ ≀ 1 βˆ’ 𝛼 β‹…minβ„Žβˆˆπ»

π‘β„Ž/π‘€β„Ž

Οƒβ„Žβˆˆπ»π‘€β„Ž > π‘Š

β€’ Suppose the optimal solution is𝑓𝐻βˆͺ𝐿 π‘Š = 𝑓𝐻 π‘Š βˆ’π‘ŠπΏ + 𝑓𝐿 π‘ŠπΏ

π‘Š βˆ’π‘ŠπΏπ‘ŠπΏ

𝐻 𝐿

Page 32: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

𝑝𝑖 ∈ 1,2capacity = π‘Šmaxβ„“βˆˆπΏ

𝑝ℓ/𝑀ℓ ≀ 1 βˆ’ 𝛼 β‹…minβ„Žβˆˆπ»

π‘β„Ž/π‘€β„Ž

Οƒβ„Žβˆˆπ»π‘€β„Ž > π‘Š

β€’Remove all 𝐿-items, and insert more 𝐻-items (denoted by 𝐾) to fill in the π‘ŠπΏ space

π‘Š βˆ’π‘ŠπΏπ‘ŠπΏ

𝐻 𝐿

Page 33: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

π‘Š βˆ’π‘ŠπΏπ‘ŠπΏ

π‘ŠπΎ

𝑝𝑖 ∈ 1,2capacity = π‘Šmaxβ„“βˆˆπΏ

𝑝ℓ/𝑀ℓ ≀ 1 βˆ’ 𝛼 β‹…minβ„Žβˆˆπ»

π‘β„Ž/π‘€β„Ž

Οƒπ’‰βˆˆπ‘―π’˜π’‰ > 𝑾

β€’Remove all 𝐿-items, and insert more 𝐻-items (denoted by 𝐾) to fill in the π‘ŠπΏ space

β€’Until π‘ŠπΏ βˆ’π‘ŠπΎ < maxβ„Žβˆˆπ» π‘€β„Ž

𝐻 𝐿

Page 34: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

π‘Š βˆ’π‘ŠπΏπ‘ŠπΏ

π‘ŠπΎ

π’‘π’Š ∈ 𝟏, 𝟐capacity = π‘Šmaxβ„“βˆˆπΏ

𝑝ℓ/𝑀ℓ ≀ 1 βˆ’ 𝛼 β‹…π¦π’π§π’‰βˆˆπ‘―

𝒑𝒉/π’˜π’‰ = 1 βˆ’ 𝛼 β‹… 𝒒

Οƒβ„Žβˆˆπ»π‘€β„Ž > π‘Š

β€’Remove all 𝐿-items, and insert more 𝐻-items (denoted by 𝐾) to fill in the π‘ŠπΏ space

β€’Until π‘ŠπΏ βˆ’π‘ŠπΎ < maxβ„Žβˆˆπ» π‘€β„Ž ≀ 𝟐/𝒒

𝐻 𝐿

Page 35: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

π‘Š βˆ’π‘ŠπΏ π‘ŠπΏ

π‘ŠπΎ

𝑝𝑖 ∈ 1,2capacity = π‘Šmaxβ„“βˆˆπΏ

𝑝ℓ/𝑀ℓ ≀ 1 βˆ’ 𝛼 β‹…π¦π’π§π’‰βˆˆπ‘―

𝒑𝒉/π’˜π’‰ = 1 βˆ’ 𝛼 β‹… 𝒒

Οƒβ„Žβˆˆπ»π‘€β„Ž > π‘Šπ‘ŠπΏ βˆ’π‘ŠπΎ < 2/π‘ž

π‘Š βˆ’π‘ŠπΏ π‘ŠπΏ

optimal sol:

𝑓𝐻βˆͺ𝐿 π‘Š = 𝑓𝐻 π‘Š βˆ’π‘ŠπΏ + 𝑓𝐿 π‘ŠπΏ

tot profit β‰₯ 𝑓𝐻 π‘Š βˆ’π‘ŠπΏ + π‘žπ‘ŠπΎ

Page 36: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

π‘Š βˆ’π‘ŠπΏ π‘ŠπΏ

π‘ŠπΎ

𝑝𝑖 ∈ 1,2capacity = π‘Šmaxβ„“βˆˆπΏ

𝑝ℓ/𝑀ℓ ≀ 1 βˆ’ 𝛼 β‹…π¦π’π§π’‰βˆˆπ‘―

𝒑𝒉/π’˜π’‰ = 1 βˆ’ 𝛼 β‹… 𝒒

Οƒβ„Žβˆˆπ»π‘€β„Ž > π‘Šπ‘ŠπΏ βˆ’π‘ŠπΎ < 2/π‘ž

π‘Š βˆ’π‘ŠπΏ π‘ŠπΏ

optimal sol:

𝑓𝐻βˆͺ𝐿 π‘Š = 𝑓𝐻 π‘Š βˆ’π‘ŠπΏ + 𝑓𝐿 π‘ŠπΏ

tot profit β‰₯ 𝑓𝐻 π‘Š βˆ’π‘ŠπΏ + π‘žπ‘ŠπΎ

𝒒𝑾𝑲 ≀ 𝒇𝑳 𝑾𝑳

Page 37: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

π‘Š βˆ’π‘ŠπΏ π‘ŠπΏ

π‘ŠπΎ

𝑝𝑖 ∈ 1,2capacity = π‘Šmaxβ„“βˆˆπΏ

𝑝ℓ/𝑀ℓ ≀ 1 βˆ’ 𝛼 β‹…π¦π’π§π’‰βˆˆπ‘―

𝒑𝒉/π’˜π’‰ = 1 βˆ’ 𝛼 β‹… 𝒒

Οƒβ„Žβˆˆπ»π‘€β„Ž > π‘Šπ‘Ύπ‘³ βˆ’π‘Ύπ‘² < 𝟐/𝒒

π‘Š βˆ’π‘ŠπΏ π‘ŠπΏ

optimal sol:

𝑓𝐻βˆͺ𝐿 π‘Š = 𝑓𝐻 π‘Š βˆ’π‘ŠπΏ + 𝑓𝐿 π‘ŠπΏ

tot profit β‰₯ 𝑓𝐻 π‘Š βˆ’π‘ŠπΏ + π‘žπ‘ŠπΎ

𝒒𝑾𝑲 ≀ 𝒇𝑳 𝑾𝑳

1 βˆ’ 𝛼 β‹… π‘ž β‹… π‘ŠπΏ β‰₯ 𝑓𝐿 π‘ŠπΏ

𝑓𝐿 π‘ŠπΏ β‰₯ π‘žπ‘ŠπΎ

π‘žπ‘ŠπΎ > π‘žπ‘ŠπΏ βˆ’ 2↓

1 βˆ’ 𝛼 β‹… π‘žπ‘ŠπΏ > π‘žπ‘ŠπΏ βˆ’ 2

π›Όπ‘žπ‘ŠπΏ < 2

𝑓𝐿 π‘ŠπΏ < 2/𝛼

Page 38: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

π‘Š βˆ’π‘ŠπΏ π‘ŠπΏ

π‘ŠπΎ

𝑝𝑖 ∈ 1,2capacity = π‘Šmaxβ„“βˆˆπΏ

𝑝ℓ/𝑀ℓ ≀ 1 βˆ’ 𝛼 β‹…π¦π’π§π’‰βˆˆπ‘―

𝒑𝒉/π’˜π’‰ = 1 βˆ’ 𝛼 β‹… 𝒒

Οƒβ„Žβˆˆπ»π‘€β„Ž > π‘Šπ‘Ύπ‘³ βˆ’π‘Ύπ‘² < 𝟐/𝒒

π‘Š βˆ’π‘ŠπΏ π‘ŠπΏ

optimal sol:

𝑓𝐻βˆͺ𝐿 π‘Š = 𝑓𝐻 π‘Š βˆ’π‘ŠπΏ + 𝑓𝐿 π‘ŠπΏ

tot profit β‰₯ 𝑓𝐻 π‘Š βˆ’π‘ŠπΏ + π‘žπ‘ŠπΎ

𝒒𝑾𝑲 ≀ 𝒇𝑳 𝑾𝑳

1 βˆ’ 𝛼 β‹… π‘ž β‹… π‘ŠπΏ β‰₯ 𝑓𝐿 π‘ŠπΏ

𝑓𝐿 π‘ŠπΏ β‰₯ π‘žπ‘ŠπΎ

π‘žπ‘ŠπΎ > π‘žπ‘ŠπΏ βˆ’ 2↓

1 βˆ’ 𝛼 β‹… π‘žπ‘ŠπΏ > π‘žπ‘ŠπΏ βˆ’ 2↓

π›Όπ‘žπ‘ŠπΏ < 2

𝑓𝐿 π‘ŠπΏ < 2/𝛼

Page 39: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

π‘Š βˆ’π‘ŠπΏ π‘ŠπΏ

π‘ŠπΎ

𝑝𝑖 ∈ 1,2capacity = π‘Šmaxβ„“βˆˆπΏ

𝑝ℓ/𝑀ℓ ≀ 1 βˆ’ 𝛼 β‹…π¦π’π§π’‰βˆˆπ‘―

𝒑𝒉/π’˜π’‰ = 1 βˆ’ 𝛼 β‹… 𝒒

Οƒβ„Žβˆˆπ»π‘€β„Ž > π‘Šπ‘Ύπ‘³ βˆ’π‘Ύπ‘² < 𝟐/𝒒

π‘Š βˆ’π‘ŠπΏ π‘ŠπΏ

optimal sol:

𝑓𝐻βˆͺ𝐿 π‘Š = 𝑓𝐻 π‘Š βˆ’π‘ŠπΏ + 𝑓𝐿 π‘ŠπΏ

tot profit β‰₯ 𝑓𝐻 π‘Š βˆ’π‘ŠπΏ + π‘žπ‘ŠπΎ

𝒒𝑾𝑲 ≀ 𝒇𝑳 𝑾𝑳

𝟏 βˆ’ 𝜢 β‹… 𝒒 β‹… 𝑾𝑳 β‰₯ 𝒇𝑳 𝑾𝑳

𝑓𝐿 π‘ŠπΏ β‰₯ π‘žπ‘ŠπΎ

π‘žπ‘ŠπΎ > π‘žπ‘ŠπΏ βˆ’ 2↓

1 βˆ’ 𝛼 β‹… π‘žπ‘ŠπΏ > π‘žπ‘ŠπΏ βˆ’ 2↓

πœΆπ’’π‘Ύπ‘³ < πŸβ†“

𝒇𝑳 𝑾𝑳 < 𝟐/𝜢

Page 40: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

Recap

If: maxβ„“βˆˆπΏ

𝑝ℓ/𝑀ℓ ≀ 1 βˆ’ 𝛼 β‹…minβ„Žβˆˆπ»

π‘β„Ž/π‘€β„Ž

Οƒβ„Žβˆˆπ»π‘€β„Ž > π‘ŠThen: In optimal solution of 𝑓𝐻βˆͺ𝐿(π‘Š), 𝐿-items

contribute total profit ≀ 2/𝛼

Task: 1 + 𝑂 πœ€ approximate min 𝐡, 𝑓𝐼 , 𝐡 = 𝑂(πœ€βˆ’1)

π‘š = 𝑂(πœ€βˆ’1) distinct values

𝑝𝑖 ∈ 1,2

෨𝑂 πœ€βˆ’1 π΅π‘š algo (Chan)

(faster when 𝑩 small)

෨𝑂(πœ€βˆ’4/3𝑛 + πœ€βˆ’2) algo (Chan)(faster when 𝒏 small)

Page 41: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

Improved Algorithm

β€’Sort the items by 𝑝𝑖/𝑀𝑖, and divide into three groups

𝑝𝑖 ∈ 1,2

Page 42: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

Improved Algorithm

β€’Sort the items by 𝑝𝑖/𝑀𝑖, and divide into three groups

𝐻: top

Θ πœ€βˆ’1

items

𝑝𝑖 ∈ 1,2

Page 43: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

Improved Algorithm

β€’Sort the items by 𝑝𝑖/𝑀𝑖, and divide into three groups

𝐻: top

Θ πœ€βˆ’1

items

𝐿: (1 βˆ’ 𝛼)multiplicative

gap

𝒒 (𝟏 βˆ’ 𝜢)𝒒

𝑝𝑖 ∈ 1,2

Page 44: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

Improved Algorithm

β€’Sort the items by 𝑝𝑖/𝑀𝑖, and divide into three groups

𝐻: top

Θ πœ€βˆ’1

items

𝐿: (1 βˆ’ 𝛼)multiplicative

gap

π‘ž (1 βˆ’ 𝛼)π‘ž

𝑀: items in

between

𝑝𝑖 ∈ 1,2

Page 45: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

Improved Algorithm

π‘ž (1 βˆ’ 𝛼)π‘žπ» = Θ(πœ€βˆ’1)

𝐻 𝑀 𝐿

If: maxβ„“βˆˆπΏ

𝑝ℓ/𝑀ℓ ≀ 1 βˆ’ 𝛼 β‹…minβ„Žβˆˆπ»

π‘β„Ž/π‘€β„Ž

Οƒβ„Žβˆˆπ»π‘€β„Ž > π‘ŠThen: In optimal solution of 𝑓𝐻βˆͺ𝐿(π‘Š), 𝐿-items

contribute total profit ≀ 2/𝛼

Task: 1 + 𝑂 πœ€ approximate min 𝑂(πœ€βˆ’1), 𝑓𝐼

𝑝𝑖 ∈ 1,2

Page 46: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

If: maxβ„“βˆˆπΏ

𝑝ℓ/𝑀ℓ ≀ 1 βˆ’ 𝛼 β‹…minβ„Žβˆˆπ»

π‘β„Ž/π‘€β„Ž

Οƒβ„Žβˆˆπ»π‘€β„Ž > π‘ŠThen: In optimal solution of 𝑓𝐻βˆͺ𝐿(π‘Š), 𝐿-items

contribute total profit ≀ 2/𝛼

Improved Algorithm

π‘ž (1 βˆ’ 𝛼)π‘žπ» = Θ(πœ€βˆ’1)

𝐻 𝑀 𝐿

𝑝𝑖 ∈ 1,2

Task: 1 + 𝑂 πœ€ approximate min 𝑂(πœ€βˆ’1), 𝑓𝐼

Page 47: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

Improved Algorithm

π‘ž (1 βˆ’ 𝛼)π‘žπ‘― = 𝚯(πœΊβˆ’πŸ)

𝐻 𝑀 𝐿

(If 𝒇𝑰 𝑾 < 𝑢(πœΊβˆ’πŸ) then 𝑾 < π’˜(𝑯))

Task: 1 + 𝑂 πœ€ approximate 𝐦𝐒𝐧 𝑢(πœΊβˆ’πŸ), 𝒇𝑰

If: maxβ„“βˆˆπΏ

𝑝ℓ/𝑀ℓ ≀ 1 βˆ’ 𝛼 β‹…minβ„Žβˆˆπ»

π‘β„Ž/π‘€β„Ž

Οƒβ„Žβˆˆπ»π‘€β„Ž > π‘ŠThen: In optimal solution of 𝑓𝐻βˆͺ𝐿(π‘Š), 𝐿-items

contribute total profit ≀ 2/π›Όπ’‘π’Š ∈ 𝟏, 𝟐

Page 48: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

Improved Algorithm

π‘ž (1 βˆ’ 𝛼)π‘žπ» = Θ(πœ€βˆ’1)

𝐻 𝑀 𝐿

Task: 1 + 𝑂 πœ€ approximate min 𝑂(πœ€βˆ’1), 𝑓𝐼

If: maxβ„“βˆˆπΏ

𝑝ℓ/𝑀ℓ ≀ 1 βˆ’ 𝛼 β‹…minβ„Žβˆˆπ»

π‘β„Ž/π‘€β„Ž

Οƒβ„Žβˆˆπ»π‘€β„Ž > π‘ŠThen: In optimal solution of 𝑓𝐻βˆͺ𝐿(π‘Š), 𝐿-items

contribute total profit ≀ 2/𝛼𝑝𝑖 ∈ 1,2

𝐦𝐒𝐧{𝒇𝑳 , 𝟐/𝜢}

Page 49: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

Improved Algorithm

π‘ž (1 βˆ’ 𝛼)π‘žπ» = Θ(πœ€βˆ’1)

𝐻 𝑀 𝑳

min{𝑓𝐿 , 2/𝛼}

෨𝑂 πœ€βˆ’1 π΅π‘š algo (Chan)

(faster when 𝑩 small)෨𝑂(πœ€βˆ’4/3𝑛 + πœ€βˆ’2) algo (Chan)

(faster when 𝒏 small)

Let 𝜢 = 𝜺𝟐/πŸ‘ΰ·©π‘Ά(πœΊβˆ’πŸ•/πŸ‘)

෩𝑢(πœΊβˆ’πŸ•/πŸ‘)

𝒏 ≔ 𝑯 β‰ˆ 𝟏/𝜺 𝑩 ≔ 𝟐/𝜢

π‘š ≔ 𝑂 πœ€βˆ’1

Page 50: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

Improved Algorithm

π‘ž (1 βˆ’ 𝛼)π‘ž

𝐻 𝑀 𝑳

Let 𝜢 = 𝜺𝟐/πŸ‘

෨𝑂 πœ€βˆ’7/3 -time ෨𝑂(πœ€βˆ’7/3)-time

Group 𝑀: Round 𝑝𝑖/𝑀𝑖

down to powers of (1 + πœ€)

Page 51: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

Improved Algorithm

π‘ž (1 βˆ’ 𝛼)π‘ž

𝐻 𝑀 𝑳

Let 𝜢 = 𝜺𝟐/πŸ‘

෨𝑂 πœ€βˆ’7/3 -time ෨𝑂(πœ€βˆ’7/3)-time

Group 𝑀: Round 𝑝𝑖/𝑀𝑖

down to powers of (1 + πœ€)

Only log1+1

1βˆ’π›Όβ‰ˆ 𝛼/πœ€ = πœΊβˆ’πŸ/πŸ‘

distinct values of 𝑝𝑖/𝑀𝑖

Page 52: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

Improved Algorithm

π‘ž (1 βˆ’ 𝛼)π‘ž

𝐻 𝑀 𝑳

Let 𝜢 = 𝜺𝟐/πŸ‘

෨𝑂 πœ€βˆ’7/3 -time ෨𝑂(πœ€βˆ’7/3)-time

Group 𝑀: Round 𝑝𝑖/𝑀𝑖

down to powers of (1 + πœ€)

Only log1+1

1βˆ’π›Όβ‰ˆ 𝛼/πœ€ = πœΊβˆ’πŸ/πŸ‘

distinct values of 𝑝𝑖/𝑀𝑖

Items with the same 𝑝𝑖/𝑀𝑖

(profit ∝ weight ): a Subset

Sum instance

෨𝑂(𝑛 + πœ€βˆ’2) time [KMPS03]

Page 53: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

Improved Algorithm

π‘ž (1 βˆ’ 𝛼)π‘ž

𝐻 𝑀 𝑳

Let 𝜢 = 𝜺𝟐/πŸ‘

෨𝑂 πœ€βˆ’7/3 -time ෨𝑂(πœ€βˆ’7/3)-time

Group 𝑀: Round 𝑝𝑖/𝑀𝑖

down to powers of (1 + πœ€)

Only log1+1

1βˆ’π›Όβ‰ˆ 𝛼/πœ€ = πœΊβˆ’πŸ/πŸ‘

distinct values of 𝑝𝑖/𝑀𝑖

Items with the same 𝑝𝑖/𝑀𝑖

(profit ∝ weight ): a Subset

Sum instance

෨𝑂(𝑛 + πœ€βˆ’2) time [KMPS03]

Merge πœΊβˆ’πŸ/πŸ‘ groups

Page 54: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

Improved Algorithm

π‘ž (1 βˆ’ 𝛼)π‘ž

𝐻 𝑀 𝑳

Let 𝜢 = 𝜺𝟐/πŸ‘

෨𝑂 πœ€βˆ’7/3 -time ෨𝑂(πœ€βˆ’7/3)-time

Group 𝑀: Round 𝑝𝑖/𝑀𝑖

down to powers of (1 + πœ€)

Only log1+1

1βˆ’π›Όβ‰ˆ 𝛼/πœ€ = πœΊβˆ’πŸ/πŸ‘

distinct values of 𝑝𝑖/𝑀𝑖

Items with the same 𝑝𝑖/𝑀𝑖

(profit ∝ weight ): a Subset

Sum instance

෨𝑂(𝑛 + πœ€βˆ’2) time [KMPS03]

𝑛 + πœΊβˆ’πŸ/πŸ‘ β‹… πœ€βˆ’2

Merge πœΊβˆ’πŸ/πŸ‘ groups

Page 55: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

Improved Algorithm

π‘ž (1 βˆ’ 𝛼)π‘ž

𝐻 𝑀 𝑳

Let 𝜢 = 𝜺𝟐/πŸ‘

෨𝑂 πœ€βˆ’7/3 -time ෨𝑂(πœ€βˆ’7/3)-time

Group 𝑀: Round 𝑝𝑖/𝑀𝑖

down to powers of (1 + πœ€)

Only log1+1

1βˆ’π›Όβ‰ˆ 𝛼/πœ€ = πœΊβˆ’πŸ/πŸ‘

distinct values of 𝑝𝑖/𝑀𝑖

Items with the same 𝑝𝑖/𝑀𝑖

(profit ∝ weight ): a Subset

Sum instance

෨𝑂(𝑛 + πœ€βˆ’2) time [KMPS03]

𝑛 + πœΊβˆ’πŸ/πŸ‘ β‹… πœ€βˆ’2

Merge πœΊβˆ’πŸ/πŸ‘ groups

Total time:෩𝑢 𝒏 + πœΊβˆ’πŸ•/πŸ‘

Page 56: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

Further improvement

෨𝑂 πœ€βˆ’1 π΅π‘š (Chan)

(faster when 𝑩 small)

෨𝑂(πœ€βˆ’4/3𝑛 + πœ€βˆ’2) (Chan)(faster when 𝒏 small)

෨𝑂(πœ€βˆ’3/2𝑛3/4 + 𝑛 + πœ€βˆ’2)(faster when 𝒏 small)

෨𝑂 πœ€βˆ’4/3𝐡1/3π‘š2/3(π‘š2 ≫ πœ€βˆ’2/𝐡)

(faster when 𝑩 small)

෨𝑂(𝑛 + πœ€βˆ’9/4)

Greedy argument (this talk)

extending Chan’s

techniques from two levels

to multiple levels

Page 57: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

Open problem

Unbounded Knapsack (each item has infinitely

many copies) which easily reduces to 0-1

Knapsack:

෨𝑂(𝑛 + πœ€βˆ’2) [Jansen and Kraft, 2015]

Improve 0-1 Knapsack to ෨𝑂(𝑛 + πœ€βˆ’2) time?

෨𝑂 min 𝒏 + πœΊβˆ’πŸ, π‘›πœ€βˆ’1

[Kellerer, Mansini, Pferschy, and Speranza, 2003]

Subset Sum:

Page 58: An Improved FPTAS for 0-1 KnapsackΒ Β· FPTAS for 0-1 Knapsack OPT = optimal total profit ( ) For πœ€>0, find a subset βŠ† such that: β€’ Qπ‘Š β€’ RT 1+ Solvable in poly ,1 time

Thank you!