An Improved FPTAS for 0-1 Knapsack Ce Jin Tsinghua University
0-1 Knapsack Problem Given: Knapsack capacity π > 0 π items Each item π has weight 0 < π₯ π β€ π and profit π π > 0 Find a subset of items π½ β π such that: β’ π₯ π½ β Ο πβπ½ π₯ π β€ π β’ π π½ β Ο πβπ½ π π is maximized
0-1 Knapsack Problem Given: Knapsack capacity π > 0 π items Each item π has weight 0 < π₯ π β€ π and profit π π > 0 Find a subset of items π½ β π such that: β’ π₯ π½ β Ο πβπ½ π₯ π β€ π β’ π π½ β Ο πβπ½ π π is maximized A well-known NP-hard problem
FPTAS for 0-1 Knapsack OPT = optimal total profit π(π½) For π > 0 , find a subset π½ β π such that: β’ π₯ π½ β€ π OPT β’ π π½ β₯ 1+π 1 Solvable in poly π, π time
Prior Work FPTAS for 0-1 Knapsack: β’ ΰ·¨ π(π 3 /π) (textbook algorithm) β’ ΰ·¨ π(π + π β4 ) [Ibarra and Kim, 1975] β’ ΰ·¨ π(π + π β3 ) [Kellerer and Pferschy, 2004] β’ ΰ·¨ π(π + π β2.5 ) [Rhee, 2015] β’ ΰ·© π·(π + π» βπ.π ) [Chan, 2018]
Prior Work FPTAS for 0-1 Knapsack: β’ ΰ·¨ π(π 3 /π) (textbook algorithm) β’ ΰ·¨ π(π + π β4 ) [Ibarra and Kim, 1975] β’ ΰ·¨ π(π + π β3 ) [Kellerer and Pferschy, 2004] β’ ΰ·¨ π(π + π β2.5 ) [Rhee, 2015] β’ ΰ·© π·(π + π» βπ.π ) [Chan, 2018] β’ ΰ·© π·(π + π» βπ.ππ ) (this work) Conditional Lower Bound: π + π β1 2βπ No π time algorithm, unless π§π£π¨, + convolution has truly subquadratic algo [Cygan, Mucha, W Δ grzycki, and W Ε odarczyk, 2017]
A Special Case FPTAS for Subset Sum ( π π = π₯ π ): β’ ΰ·¨ π min π + π» βπ , ππ β1 [Kellerer, Mansini, Pferschy, and Speranza, 2003]
A Special Case FPTAS for Subset Sum ( π π = π₯ π ): β’ ΰ·¨ π min π + π» βπ , ππ β1 [Kellerer, Mansini, Pferschy, and Speranza, 2003] Our 0-1 Knapsack algorithm utilizes this result
β’ Our ΰ·© π·(π + π» βπ.ππ ) algorithm builds on Chanβs ΰ·© π·(π + π» βπ.π ) algorithm β’ Two new ideas 1. Extending Chanβs number-theoretic technique from two levels to multiple levels.
β’ 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 computation spent on cheap items (small unit profit π π /π₯ π )
β’ 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 computation spent on cheap items (small unit profit π π /π₯ π ) This talk
β’ 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 computation spent on cheap items (small unit profit π π /π₯ π ) Preliminaries (based on [Chan, 2018]) This talk Using Chanβs Lemmas as blackboxes ΰ·© π·(π + π» βπ.πππ ) algo
Preliminaries β’ Assume π β€ poly π β1 . π β’ Too cheap items (π π < π max π π ) are π discarded at the beginning (loss β€ π β OPT ) max π π min π π β€ poly π β1 So π items, capacity = π weight 0 < π₯ π β€ π and profit π π > 0
Preliminaries β’βProfit functionβ (defined over real π¦ β₯ 0 ) π π½ π¦ = max π πΎ : πΎ β π½, π₯ πΎ β€ π¦ π β€ poly π β1 items profit max π π /min π π β€ poly π β1 weight 0 < π₯ π β€ π
Preliminaries β’βProfit functionβ (defined over real π¦ β₯ 0 ) π π½ π¦ = max π πΎ : πΎ β π½, π₯ πΎ β€ π¦ β’ Task: compute a 1 + π -approximation of profit function π π½ , ΰ·© π½ π¦ β€ 1 + π ΰ·© π π½ π¦ β€ π π π½ π¦ , βπ¦ β₯ 0 π β€ poly π β1 items profit max π π /min π π β€ poly π β1 weight 0 < π₯ π β€ π
Preliminaries β’βProfit functionβ (defined over real π¦ β₯ 0 ) π π½ π¦ = max π πΎ : πΎ β π½, π₯ πΎ β€ π¦ β’ Task: compute a 1 + π -approximation of profit function π π½ , ΰ·© π½ π¦ β€ 1 + π ΰ·© π π½ π¦ β€ π π π½ π¦ , βπ¦ β₯ 0 β’ For disjoint sets π½, πΎ of items, π π½βͺπΎ π¦ = π π½ β π π¦ β max 0β€π§β€π¦ π π½ π§ + π πΎ π¦ β π§ πΎ π β€ poly π β1 items profit max π π /min π π β€ poly π β1 weight 0 < π₯ π β€ π
Preliminaries β’βProfit functionβ (defined over real π¦ β₯ 0 ) π π½ π¦ = max π πΎ : πΎ β π½, π₯ πΎ β€ π¦ β’ Task: compute a 1 + π -approximation of profit function π π½ , ΰ·© π½ π¦ β€ 1 + π ΰ·© π π½ π¦ β€ π π π½ π¦ , βπ¦ β₯ 0 β’ For disjoint sets π½, πΎ of items, π π½βͺπΎ π¦ = π π½ β π π¦ β max 0β€π§β€π¦ π π½ π§ + π πΎ π¦ β π§ πΎ β’ ΰ·© π½ β ΰ·© π π πΎ is a 1 + π -approximation of π π½βͺπΎ π β€ poly π β1 items profit max π π /min π π β€ poly π β1 weight 0 < π₯ π β€ π
Preliminaries β’ A nondecreasing step function π has a (1 + π) -approx. with only ΰ·¨ π 1/π steps (by rounding down to powers of (1 + π) ) π β€ poly π β1 items profit max π π /min π π β€ poly π β1
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 + π - π takes ΰ·¨ π π/π 2 approx. of) π 1 β β― β π time. ( log π depth binary tree. π β² β π/ log π ) π β π β max 0β€π§β€π¦ π π§ + π π¦ β π§
Preliminaries β’ Divide items into π log 1/π groups (group π : π π β [2 π , 2 π+1 ] ) π β€ poly π β1 items profit max π π /min π π β€ poly π β1 weight 0 < π₯ π β€ π π π/π 2 time. π : ΰ·¨ Merging π 1 β β― β π
Preliminaries β’ Divide items into π log 1/π groups (group π : π π β [2 π , 2 π+1 ] ) β’ Compute all π π and merge them in ΰ·¨ π(1/π 2 ) time π β€ poly π β1 items profit max π π /min π π β€ poly π β1 weight 0 < π₯ π β€ π π π/π 2 time. π : ΰ·¨ Merging π 1 β β― β π
Preliminaries β’ Divide items into π log 1/π groups (group π : π π β [2 π , 2 π+1 ] ) β’ Compute all π π and merge them in ΰ·¨ π(1/π 2 ) time β’ Now assume π π β [1,2] π β€ poly π β1 items profit max π π /min π π β€ poly π β1 weight 0 < π₯ π β€ π π π/π 2 time. π : ΰ·¨ Merging π 1 β β― β π
Preliminaries π 1 π 2 β’ Simple greedy (sort by unit profit π₯ 1 β₯ π₯ 2 β₯ β― ) approximates with additive error π β€ max π π = π(1) profit π π β 1,2 weight 0 < π₯ π β€ π
Preliminaries π 1 π 2 β’ Simple greedy (sort by unit profit π₯ 1 β₯ π₯ 2 β₯ β― ) approximates with additive error π β€ max π π = π(1) β’ For π π₯ β₯ Ξ©(π β1 ) , this is 1 + π(π) multiplicative approx. profit π π β 1,2 weight 0 < π₯ π β€ π
Preliminaries π 1 π 2 β’ Simple greedy (sort by unit profit π₯ 1 β₯ π₯ 2 β₯ β― ) approximates with additive error π β€ max π π = π(1) β’ For π π₯ β₯ Ξ©(π β1 ) , this is 1 + π(π) multiplicative approx. β’ Only need to 1 + π(π) approximate for πͺ = π· π» βπ ! π§π£π¨ πͺ, π π± profit π π β 1,2 weight 0 < π₯ π β€ π
Preliminaries β’ Round π π down to 1,1 + π, 1 + 2π, β¦ , 2 β π 1 + π multiplicative error β’ Only π = π(1/π) different π π βs ! π π β 1,2
Preliminaries β’ 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 β€ β― ) π π β 1,2
Recap π π β 1,2 Profit functions π 1 , β¦ , π π obtained by simple greedy (one for every π π ) ( π = π(1/π) ) Task: 1 + π π approximate ( πΆ = π(π β1 ) ) min πΆ, π 1 β β― β π π π π/π 2 time. π in ΰ·¨ Lemma: Merging π 1 β β― β π (Immediately gives ΰ·¨ π(π + π β3 ) algo)
Recommend
More recommend