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

Upload: others

Post on 28-Sep-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

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!