Polynomiality for Bin Packing with a Constant Number of Item Types Michel X. Goemans & Thomas Rothvoß MIP 2013, Madison Bin Packing / Cutting Stock Input: item 1 . . . item d Bin Packing / Cutting Stock Input: ◮ Item sizes s1 , . . . , sd ∈ [0, 1] Input: s1 item 1 . . . item d Bin Packing / Cutting Stock Input: ◮ Item sizes s1 , . . . , sd ∈ [0, 1] ◮ Multiplicities a1 , . . . , ad ∈ N Input: a1 many s1 item 1 . . . item d Bin Packing / Cutting Stock Input: ◮ Item sizes s1 , . . . , sd ∈ [0, 1] ◮ Multiplicities a1 , . . . , ad ∈ N Goal: Pack items into minimum number of bins of size 1. Input: a1 many s1 item 1 . . . item d 1 Solution: bin 1 . . . Bin Packing / Cutting Stock Input: ◮ Item sizes s1 , . . . , sd ∈ [0, 1] ◮ Multiplicities a1 , . . . , ad ∈ N Goal: Pack items into minimum number of bins of size 1. Input: a1 many s1 item 1 . . . item d 1 Solution: bin 1 . . . Bin Packing / Cutting Stock Input: ◮ Item sizes s1 , . . . , sd ∈ [0, 1] ◮ Multiplicities a1 , . . . , ad ∈ N Goal: Pack items into minimum number of bins of size 1. Input: a1 many s1 item 1 . . . item d 1 Solution: bin 1 . . . Bin Packing / Cutting Stock Input: ◮ Item sizes s1 , . . . , sd ∈ [0, 1] ◮ Multiplicities a1 , . . . , ad ∈ N Goal: Pack items into minimum number of bins of size 1. Input: a1 many s1 item 1 . . . item d 1 Solution: bin 1 . . . Polynomial time algorithms For general d: ◮ NP-hard to distinguish OP T ≤ 2 or OP T ≥ 3 [Garey & Johnson ’79] Polynomial time algorithms For general d: ◮ NP-hard to distinguish OP T ≤ 2 or OP T ≥ 3 [Garey & Johnson ’79] ◮ Asymptotic FPTAS OP T + O(log2 d) [Karmarkar & Karp ’82] OP T + O(log d · logP log d) [R. ’13] (running time poly( di=1 ai )) Polynomial time algorithms For general d: ◮ NP-hard to distinguish OP T ≤ 2 or OP T ≥ 3 [Garey & Johnson ’79] ◮ Asymptotic FPTAS OP T + O(log2 d) [Karmarkar & Karp ’82] OP T + O(log d · logP log d) [R. ’13] (running time poly( di=1 ai )) ◮ ∈ NP [Eisenbrand & Shmonin ’06] Polynomial time algorithms For general d: ◮ NP-hard to distinguish OP T ≤ 2 or OP T ≥ 3 [Garey & Johnson ’79] ◮ Asymptotic FPTAS OP T + O(log2 d) [Karmarkar & Karp ’82] OP T + O(log d · logP log d) [R. ’13] (running time poly( di=1 ai )) ◮ ∈ NP [Eisenbrand & Shmonin ’06] For constant d: Polynomial time algorithms For general d: ◮ NP-hard to distinguish OP T ≤ 2 or OP T ≥ 3 [Garey & Johnson ’79] ◮ Asymptotic FPTAS OP T + O(log2 d) [Karmarkar & Karp ’82] OP T + O(log d · logP log d) [R. ’13] (running time poly( di=1 ai )) ◮ ∈ NP [Eisenbrand & Shmonin ’06] For constant d: ◮ Polytime for d = 2 [McCormick, Smallwood, Spieksma ’97] Polynomial time algorithms For general d: ◮ NP-hard to distinguish OP T ≤ 2 or OP T ≥ 3 [Garey & Johnson ’79] ◮ Asymptotic FPTAS OP T + O(log2 d) [Karmarkar & Karp ’82] OP T + O(log d · logP log d) [R. ’13] (running time poly( di=1 ai )) ◮ ∈ NP [Eisenbrand & Shmonin ’06] For constant d: ◮ Polytime for d = 2 [McCormick, Smallwood, Spieksma ’97] O(d) ◮ OP T + 1 in time 22 · poly [Jansen & Solis-Oba ’10] Polynomial time algorithms For general d: ◮ NP-hard to distinguish OP T ≤ 2 or OP T ≥ 3 [Garey & Johnson ’79] ◮ Asymptotic FPTAS OP T + O(log2 d) [Karmarkar & Karp ’82] OP T + O(log d · logP log d) [R. ’13] (running time poly( di=1 ai )) ◮ ∈ NP [Eisenbrand & Shmonin ’06] For constant d: ◮ Polytime for d = 2 [McCormick, Smallwood, Spieksma ’97] O(d) ◮ OP T + 1 in time 22 · poly [Jansen & Solis-Oba ’10] Open problem [ES’06, MSS’97, F’07] Solvable in poly-time for d = 3? A geometric view ◮ Define P = {x ∈ Rd≥0 | sT x ≤ 1} a Rd b b b b b sT x ≤ 1 b b b b b b b b b b b b P b b b b b b b b A geometric view ◮ Define P = {x ∈ Rd≥0 | sT x ≤ 1} a Rd b b b b b b sT x ≤ 1 b b b b b b b b b b b 1 b 2 b b b P b b b b A geometric view ◮ Define P = {x ∈ Rd≥0 | sT x ≤ 1} a Rd b b b b b b sT x ≤ 1 b b b b b b b b b b b 1 b 2 b b b P b b b b A geometric view ◮ Define P = {x ∈ Rd≥0 | sT x ≤ 1} a Rd b b b b b b sT x ≤ 1 b b b b b b b b b b b 1 b 2 b b b P b b b b A geometric view ◮ Define P = {x ∈ Rd≥0 | sT x ≤ 1} a Rd b b b b b b sT x ≤ 1 b b b b b b b b b b b 1 b 2 b b b P b b b b Problems: ◮ Points in P exponentially many A geometric view ◮ Define P = {x ∈ Rd≥0 | sT x ≤ 1} a Rd b b b b b b sT x ≤ 1 b b b b b b b b b b b 1 b 2 b b b P b b b b Problems: ◮ Points in P exponentially many ◮ Weights can be exponential Main results Theorem (Goemans, R. ’13) Bin Packing with d = O(1) item sizes can be solved in poly-time. Solves question by ◮ [McCormick, Smallwood, Spieksma ’97]: “might be NP-hard for d = 3” ◮ [Eisenbrand & Shmonin ’06] ◮ [Filippi ’07]: “hard open problem for general d” Main results (2) ◮ P Def.: int.cone(X) := { x∈X λx · x | λx ∈ Z≥0 } Main results (2) ◮ P Def.: int.cone(X) := { x∈X λx · x | λx ∈ Z≥0 } Theorem (Goemans, R. ’13) For fixed-dim. polytopes P, Q ⊆ Rd , testing int.cone(P ∩ Zd ) ∩ Q 6= ∅ O(d) is doable in poly-time (actually inputlength2 ). b b b Q b b b P b 0 b b b b Main results (2) ◮ P Def.: int.cone(X) := { x∈X λx · x | λx ∈ Z≥0 } Theorem (Goemans, R. ’13) For fixed-dim. polytopes P, Q ⊆ Rd , testing int.cone(P ∩ Zd ) ∩ Q 6= ∅ O(d) is doable in poly-time (actually inputlength2 ). b b b Q b b b P b 0 b 2 b b 1 b Main results (2) ◮ P Def.: int.cone(X) := { x∈X λx · x | λx ∈ Z≥0 } Theorem (Goemans, R. ’13) For fixed-dim. polytopes P, Q ⊆ Rd , testing int.cone(P ∩ Zd ) ∩ Q 6= ∅ O(d) is doable in poly-time (actually inputlength2 ). b b b Q b b b P b 0 b 2 b b 1 b Main results (2) ◮ P Def.: int.cone(X) := { x∈X λx · x | λx ∈ Z≥0 } Theorem (Goemans, R. ’13) For fixed-dim. polytopes P, Q ⊆ Rd , testing int.cone(P ∩ Zd ) ∩ Q 6= ∅ O(d) is doable in poly-time (actually inputlength2 ). b b b Q b b b P b 0 b 2 b b 1 b Main results (2) ◮ P Def.: int.cone(X) := { x∈X λx · x | λx ∈ Z≥0 } Theorem (Goemans, R. ’13) For fixed-dim. polytopes P, Q ⊆ Rd , testing int.cone(P ∩ Zd ) ∩ Q 6= ∅ O(d) is doable in poly-time (actually inputlength2 ). b b b Q b b b P b 0 ◮ b 2 b b b 1 For Bin Packing: P := { x1 | sT x ≤ 1, x ≥ 0} and Q := { a OP T } Int. conic combinations Theorem (Eisenbrand & Shmonin ’06) If P ⊆ Rd convex, then any integer conic combination X a= λx · x x∈P ∩Zd d needs at most 2 points. P b b b b b b b b b b b b b b Int. conic combinations Theorem (Eisenbrand & Shmonin ’06) If P ⊆ Rd convex, then any integer conic combination X a= λx · x x∈P ∩Zd d needs at most 2 points. ◮ Suppose |supp(λ)| > 2d P b b b b b b b b b b b b b b Int. conic combinations Theorem (Eisenbrand & Shmonin ’06) If P ⊆ Rd convex, then any integer conic combination X a= λx · x x∈P ∩Zd d needs at most 2 points. ◮ ◮ Suppose |supp(λ)| > 2d Take points x, y ∈ supp(λ) of same parity P xb b b b b b b b b b y b b b b Int. conic combinations Theorem (Eisenbrand & Shmonin ’06) If P ⊆ Rd convex, then any integer conic combination X a= λx · x x∈P ∩Zd d needs at most 2 points. ◮ ◮ ◮ Suppose |supp(λ)| > 2d Take points x, y ∈ supp(λ) of same parity Midpoint z = 21 (x + y) ∈ P ∩ Zd P xb b b b b b zb b b b y b b b b Int. conic combinations Theorem (Eisenbrand & Shmonin ’06) If P ⊆ Rd convex, then any integer conic combination X a= λx · x x∈P ∩Zd d needs at most 2 points. ◮ ◮ ◮ ◮ Suppose |supp(λ)| > 2d Take points x, y ∈ supp(λ) of same parity Midpoint z = 21 (x + y) ∈ P ∩ Zd Move weight from x, y to z P xb b b b b zb b −1 b b b +2 b b y b −1 b Int. conic combinations Theorem (Eisenbrand & Shmonin ’06) If P ⊆ Rd convex, then any integer conic combination X a= λx · x x∈P ∩Zd d needs at most 2 points. ◮ ◮ ◮ ◮ ◮ Suppose |supp(λ)| > 2d Take points x, y ∈ supp(λ) of same parity Midpoint z = 21 (x + y) ∈ P ∩ Zd Move weight from x, y to z P Potential function x λx f (x) decreases (f strictly convex) P xb b b b b zb b −1 b b b +2 b b y b −1 b Int. conic combinations Theorem (Eisenbrand & Shmonin ’06) If P ⊆ Rd convex, then any integer conic combination X a= λx · x x∈P ∩Zd d needs at most 2 points. ◮ ◮ ◮ ◮ ◮ ◮ Suppose |supp(λ)| > 2d Take points x, y ∈ supp(λ) of same parity Midpoint z = 21 (x + y) ∈ P ∩ Zd Move weight from x, y to z P Potential function x λx f (x) decreases (f strictly convex) P xb b b b b zb b −1 b b b +2 b Problem: Still don’t know which points to take! b y b −1 b Redistributing weight P Redistributing weight x P Redistributing weight ◮ Consider parallelepiped Π ∋ x with integral vertices x P Π Redistributing weight ◮ ◮ Consider parallelepiped Π ∋ x with integral vertices Let y vertex of Π, in quadrant of x y x P Π Redistributing weight ◮ ◮ ◮ Consider parallelepiped Π ∋ x with integral vertices Let y vertex of Π, in quadrant of x Let z ∈ Π ∩ Zd be mirrored point y Π x z P Redistributing weight ◮ ◮ ◮ ◮ Consider parallelepiped Π ∋ x with integral vertices Let y vertex of Π, in quadrant of x Let z ∈ Π ∩ Zd be mirrored point If λx ≥ 2 ⇒ redistribute weight y +1 Π x −2 +1 P z Redistributing weight ◮ ◮ ◮ ◮ ◮ Consider parallelepiped Π ∋ x with integral vertices Let y vertex of Π, in quadrant of x Let z ∈ Π ∩ Zd be mirrored point If λx ≥ 2 ⇒ redistribute weight At most 2d points left inside Π Π 1 1 1 P Redistributing weight Lemma For x in parallelepiped Π and λx ∈ N, one can write X λx x = int.cone(vertices of Π) + of 2d points in Π ∩ Zd ◮ ◮ ◮ ◮ ◮ Consider parallelepiped Π ∋ x with integral vertices Let y vertex of Π, in quadrant of x Let z ∈ Π ∩ Zd be mirrored point If λx ≥ 2 ⇒ redistribute weight At most 2d points left inside Π Π 1 1 1 P Covering a polytope with parallelepipeds Lemma For fixed-dim P ⊆ Rd , we can cover P ∩ Zd with poly-many parallelepipeds (with int. vertices and ⊆ P ). b b b b b b b b b b b b b b b b b b b b b b b b P b Covering a polytope with parallelepipeds Lemma For fixed-dim P ⊆ Rd , we can cover P ∩ Zd with poly-many parallelepipeds (with int. vertices and ⊆ P ). b b b b b b b b b b b b b b b b b b b b b b b b P b Covering a polytope w. parallelep. (2) P Covering a polytope w. parallelep. (2) bi − Ai x = 0 Split P = {x | Ax ≤ b} into poly many cells C = {x | αj(i) ≤ Ai x ≤ αj(i)+1 } ◮ P bi − Ai x = (1 + d1 )Z Covering a polytope w. parallelep. (2) cell C Split P = {x | Ax ≤ b} into poly many cells C = {x | αj(i) ≤ Ai x ≤ αj(i)+1 } ◮ P Covering a polytope w. parallelep. (2) cell C Split P = {x | Ax ≤ b} into poly many cells C = {x | αj(i) ≤ Ai x ≤ αj(i)+1 } ◮ Consider int.hull CI (poly many vertices) CI ◮ b b b b P b b b Covering a polytope w. parallelep. (2) cell C Split P = {x | Ax ≤ b} into poly many cells C = {x | αj(i) ≤ Ai x ≤ αj(i)+1 } ◮ Consider int.hull CI (poly many vertices) ◮ Extend any d + 1 vertices of CI to parallelepiped CI ◮ x1 b b b b P b b b x2 x0 Covering a polytope w. parallelep. (2) cell C Split P = {x | Ax ≤ b} into poly many cells C = {x | αj(i) ≤ Ai x ≤ αj(i)+1 } ◮ Consider int.hull CI (poly many vertices) ◮ Extend any d + 1 vertices of CI to parallelepiped CI ◮ x1 b b b b P b b b x0 x2 parallelepiped Covering a polytope w. parallelep. (2) cell C Split P = {x | Ax ≤ b} into poly many cells C = {x | αj(i) ≤ Ai x ≤ αj(i)+1 } ◮ Consider int.hull CI (poly many vertices) ◮ Extend any d + 1 vertices of CI to parallelepiped CI ◮ x1 b b b x0 x2 parallelepiped 2 ◮ b b b P b 2 Each cell covered with dO(d ) mO(d ) (log ∆)O(d parallelepipeds 2) Covering a polytope w. parallelep. (2) CI Split P = {x | Ax ≤ b} into poly many cells C = {x | αj(i) ≤ Ai x ≤ αj(i)+1 } ◮ Consider int.hull CI (poly many vertices) ◮ Extend any d + 1 vertices of CI to parallelepiped ◮ 2 ◮ ◮ b b b b 2 P b b b 2 Each cell covered with dO(d ) mO(d ) (log ∆)O(d ) parallelepipeds Improvement: Approximate CI by polytope with d2 vertices using John’s ellipsoid Covering a polytope w. parallelep. (2) CI Split P = {x | Ax ≤ b} into poly many cells C = {x | αj(i) ≤ Ai x ≤ αj(i)+1 } ◮ Consider int.hull CI (poly many vertices) ◮ Extend any d + 1 vertices of CI to parallelepiped ◮ 2 ◮ ◮ b b b b 2 P b b b 2 Each cell covered with dO(d ) mO(d ) (log ∆)O(d ) parallelepipeds Improvement: Approximate CI by polytope with d2 vertices using John’s ellipsoid The algorithm ◮ ◮ Input: polytopes P, Q in ineq. description Output: Coefficients for int.cone(P ∩ Zd ) ∩ Q 6= ∅ The algorithm ◮ ◮ Input: polytopes P, Q in ineq. description Output: Coefficients for int.cone(P ∩ Zd ) ∩ Q 6= ∅ Algorithm: (1) Compute poly many parallelepipeds covering P b b b b b b b b b b b b b b b b b b b b b b b b P b The algorithm ◮ ◮ Input: polytopes P, Q in ineq. description Output: Coefficients for int.cone(P ∩ Zd ) ∩ Q 6= ∅ Algorithm: (1) Compute poly many parallelepipeds covering P b b b b b b b b b b b b b b b b b b b b b b b b P b The algorithm ◮ ◮ Input: polytopes P, Q in ineq. description Output: Coefficients for int.cone(P ∩ Zd ) ∩ Q 6= ∅ Algorithm: (1) Compute poly many parallelepipeds covering P (2) Guess the 2d parallelepipeds containing solution b b b b b b b b b b b b b b b b b b b b b b b b P b The algorithm ◮ ◮ Input: polytopes P, Q in ineq. description Output: Coefficients for int.cone(P ∩ Zd ) ∩ Q 6= ∅ Algorithm: (1) Compute poly many parallelepipeds covering P (2) Guess the 2d parallelepipeds containing solution b b b b b b b b b b b b b b b b b b b b b b b b P b The algorithm ◮ ◮ Input: polytopes P, Q in ineq. description Output: Coefficients for int.cone(P ∩ Zd ) ∩ Q 6= ∅ Algorithm: (1) Compute poly many parallelepipeds covering P (2) Guess the 2d parallelepipeds containing solution → X := vertices bb bb b b bb bb bb b b b b b b b b b bb b b b b b bb b P b The algorithm ◮ ◮ Input: polytopes P, Q in ineq. description Output: Coefficients for int.cone(P ∩ Zd ) ∩ Q 6= ∅ Algorithm: (1) Compute poly many parallelepipeds covering P (2) Guess the 2d parallelepipeds containing solution → X := vertices (3) Solve ILP with 2O(d) variables X X λx · x + 1· x ∈Q x∈X some x∈P ∩Zd bb bb b b bb bb bb b b b b b b b b b bb b b b b b bb b P b The algorithm ◮ ◮ Input: polytopes P, Q in ineq. description Output: Coefficients for int.cone(P ∩ Zd ) ∩ Q 6= ∅ Algorithm: (1) Compute poly many parallelepipeds covering P (2) Guess the 2d parallelepipeds containing solution → X := vertices (3) Solve ILP with 2O(d) variables X X λx · x + 1· x ∈Q x∈X some x∈P ∩Zd variables bb bb b b bb bb bb b b b b b b b b b bb b b b b b bb b P b A Structure Theorem Structure Theorem For polytope P b b b b b b b b b b b b b b b b b b b b b b b b P b A Structure Theorem Structure Theorem For polytope P b b b b b b b b b b b b b b b b b b b b b b b b P b A Structure Theorem Structure Theorem For polytope P , ∃ poly-time comp. set X ⊆ P ∩ Zd bb bb b b bb bb bb b b b bb b b b b b bb bb b b b b bb bb P bb A Structure Theorem Structure Theorem For polytope P , ∃ poly-time comp. set X ⊆ P ∩ Zd bb bb b b bb bb bb b b b bb b b b b b bb bb b b b b bb bb P bb A Structure Theorem Structure Theorem For polytope P , ∃ poly-time comp. set X ⊆ P ∩ Zd s.t. for all a ∈ int.cone(P ∩ Zd ) one can express X of 22d points in P ∩ Zd a = int.cone(22d points in X) + a bb bb b b bb bb bb b b b bb b b b b b bb bb b b b b bb bb P bb More applications (1) Theorem Cutting stock with d = O(1) item types and m = O(1) of bin types can be solved in polytime. Items: Bins: a1 many cost c1 s1 w1 item 1 . . . item d bin type 1 ... bin type m More applications (1) Theorem Cutting stock with d = O(1) item types and m = O(1) of bin types can be solved in polytime. Items: Bins: a1 many cost c1 s1 w1 item 1 . . . item d ◮ P = P1 × . . . × Pm with Pj := { bin type 1 x cj ... | sT x ≤ w j } bin type m More applications (2) High Multiplicity Scheduling: ◮ Input: d job types, each with release time, deadline, processing time, multiplicity ◮ Goal: Schedule jobs to minimize number of used machines More applications (2) High Multiplicity Scheduling: ◮ Input: d job types, each with release time, deadline, processing time, multiplicity ◮ Goal: Schedule jobs to minimize number of used machines Theorem High Multiplicity Scheduling can be solved in poly-time for fixed d. The end Thanks for your attention