Bin Paking via Disrepany of Permutations F. Eisenbrand, D. Palv olgyi & T. Rothvo Cargese Workshop 2010 Bin Paking Input: I Items with sizes s ; : : : ; sn 2 [0; 1℄ Pak items into minimum number of bins of size 1. 1 1 Goal: 0 1 si bin 1 bin 2 input Bin Paking Input: I Items with sizes s ; : : : ; sn 2 [0; 1℄ Pak items into minimum number of bins of size 1. 1 1 Goal: 0 1 si bin 1 bin 2 input Bin Paking Input: I Items with sizes s ; : : : ; sn 2 [0; 1℄ Pak items into minimum number of bins of size 1. 1 1 Goal: 0 1 si bin 1 bin 2 input Bin Paking Input: I Items with sizes s ; : : : ; sn 2 [0; 1℄ Pak items into minimum number of bins of size 1. 1 1 Goal: 0 1 si bin 1 bin 2 input Bin Paking Input: I Items with sizes s ; : : : ; sn 2 [0; 1℄ Pak items into minimum number of bins of size 1. 1 1 Goal: 0 1 si bin 1 bin 2 input Bin Paking Input: I Items with sizes s ; : : : ; sn 2 [0; 1℄ Pak items into minimum number of bins of size 1. 1 1 Goal: 0 1 I si bin 1 bin 2 First Fit Dereasing [Johnson '73℄: AP X input 11 9 OP T +4 Bin Paking Input: I Items with sizes s ; : : : ; sn 2 [0; 1℄ Pak items into minimum number of bins of size 1. 1 1 Goal: 0 1 I I si bin 1 bin 2 input First Fit Dereasing [Johnson '73℄: AP X OP T + 4 Asymptoti PTAS [de la Vega & Luker '81℄ : AP X (1 + ")OP T + O(1=" ) in time O(n) f (") 11 9 2 Bin Paking Input: I Items with sizes s ; : : : ; sn 2 [0; 1℄ Pak items into minimum number of bins of size 1. 1 1 Goal: 0 1 si bin 1 bin 2 input First Fit Dereasing [Johnson '73℄: AP X OP T + 4 Asymptoti PTAS [de la Vega & Luker '81℄ : AP X (1 + ")OP T + O(1=" ) in time O(n) f (") I Asymptoti FPTAS [Karmarkar & Karp '82℄: AP X OP T + O(log n) in poly-time I I 11 9 2 2 Bin Paking Input: I Items with sizes s ; : : : ; sn 2 [0; 1℄ Pak items into minimum number of bins of size 1. 1 1 Goal: 0 1 si bin 1 bin 2 input First Fit Dereasing [Johnson '73℄: AP X OP T + 4 Asymptoti PTAS [de la Vega & Luker '81℄ : AP X (1 + ")OP T + O(1=" ) in time O(n) f (") I Asymptoti FPTAS [Karmarkar & Karp '82℄: AP X OP T + O(log n) in poly-time I Strongly NP-hard even if < si < ! 3-Partition I I 11 9 2 2 1 4 1 2 The Gilmore Gomory LP relaxation I Feasible patterns: P = fp 2 f0; 1gn j sT p 1g I Gilmore Gomory LP relaxation: X min xp Xp2P p xp p2P xp 1 0 8p 2 P The Gilmore Gomory LP relaxation - Example 1 si 0:44 0:4 0:3 0:26 input The Gilmore Gomory LP relaxation - Example 1 si input 0:44 0:4 0:3 0:26 X min xp p2P 01 0 1 0 0 0 1 1 1 0 0 0 1 01 1 C B B 0 1 0 0 1 0 0 1 1 0 0 1C x B1C B 1C 0 0 1 0 0 1 0 1 0 1 1 1A A 0 0 0 1 0 0 1 0 1 1 1 1 x 1 0 The Gilmore Gomory LP relaxation - Example 1 si input 0:44 0:4 0:3 0:26 X min xp p2P 01 0 1 0 0 0 1 1 1 0 0 0 1 01 1 C B B 0 1 0 0 1 0 0 1 1 0 0 1C x B1C B 1C 0 0 1 0 0 1 0 1 0 1 1 1A A 0 0 0 1 0 0 1 0 1 1 1 1 1=2 1=2 x 0 1=2 1 The Gilmore Gomory LP relaxation I Gilmore Gomory LP relaxation: P min x P p2P p p2P p xp xp 1 0 8p 2 P Modied Integer Roundup Conjeture OP T dOP Tf e + 1 I I True, if # of dierent item sizes 7 [Seb}o, Shmonin '09℄ Best known general bound: OP T OP Tf + O(log n) 2 The Gilmore Gomory LP relaxation I Gilmore Gomory LP relaxation: P min x P p2P p p2P p xp xp 1 0 8p 2 P Modied Integer Roundup Conjeture OP T dOP Tf e + 1 I I I True, if # of dierent item sizes 7 [Seb}o, Shmonin '09℄ Best known general bound: OP T OP Tf + O(log n) Additive integrality gap := OP T OP Tf 2 The Gilmore Gomory LP relaxation I Gilmore Gomory LP relaxation: P min x P p2P p p2P p xp xp 1 0 8p 2 P Modied Integer Roundup Conjeture OP T dOP Tf e + 1 I I I True, if # of dierent item sizes 7 [Seb}o, Shmonin '09℄ Best known general bound: OP T OP Tf + O(log n) Additive integrality gap := OP T OP Tf 2 Question Is additive gap onstant (if 1 4 < si < 1 2 )? Bek's Conjeture 3-Permutations Conjeture [Bek℄ Given any 3 permutations on n symbols, one an olor the symbols with red and blue, suh that in any interval of any of those permutations, the number of red and blue symbols diers by O(1). permutation 1: 4 6 1 5 7 2 8 3 permutation 2: 7 8 2 5 3 4 1 6 permutation 3: 2 1 6 4 8 5 3 7 Bek's Conjeture 3-Permutations Conjeture [Bek℄ Given any 3 permutations on n symbols, one an olor the symbols with red and blue, suh that in any interval of any of those permutations, the number of red and blue symbols diers by O(1). permutation 1: 4 6 1 b 5 7 2 8 3 permutation 2: 7 8 2 5 3 4 1 b 6 permutation 3: 2 1 6 4 8 5 3 7 b Bek's Conjeture 3-Permutations Conjeture [Bek℄ Given any 3 permutations on n symbols, one an olor the symbols with red and blue, suh that in any interval of any of those permutations, the number of red and blue symbols diers by O(1). permutation 1: 4 6 1 b 5 7 2 b 8 3 permutation 2: 7 8 2 b 5 3 4 1 b 6 permutation 3: 2 1 6 4 8 5 3 7 b b Bek's Conjeture 3-Permutations Conjeture [Bek℄ Given any 3 permutations on n symbols, one an olor the symbols with red and blue, suh that in any interval of any of those permutations, the number of red and blue symbols diers by O(1). permutation 1: 4 6 1 b 5 7 2 b 8 3 permutation 2: 7 8 2 b 5 3 b 4 1 6 permutation 3: 2 1 6 4 8 5 3 7 b b b b b Bek's Conjeture 3-Permutations Conjeture [Bek℄ Given any 3 permutations on n symbols, one an olor the symbols with red and blue, suh that in any interval of any of those permutations, the number of red and blue symbols diers by O(1). permutation 1: 4 b 6 1 b 5 7 2 b 8 3 permutation 2: 7 8 2 b 5 3 b 4 b 1 6 permutation 3: 2 1 6 4 8 5 3 7 b b b b b b Bek's Conjeture 3-Permutations Conjeture [Bek℄ Given any 3 permutations on n symbols, one an olor the symbols with red and blue, suh that in any interval of any of those permutations, the number of red and blue symbols diers by O(1). permutation 1: 4 b 6 1 b 5 b 7 2 b 8 3 permutation 2: 7 8 2 b 5 b 3 b 4 b 1 6 permutation 3: 2 1 6 4 8 5 3 7 b b b b b b b Bek's Conjeture 3-Permutations Conjeture [Bek℄ Given any 3 permutations on n symbols, one an olor the symbols with red and blue, suh that in any interval of any of those permutations, the number of red and blue symbols diers by O(1). permutation 1: 4 b 6 b 1 b 5 b 7 2 b 8 3 permutation 2: 7 8 2 b 5 b 3 b 4 b 1 6 permutation 3: 2 1 6 4 8 5 3 7 b b b b b b b b b Bek's Conjeture 3-Permutations Conjeture [Bek℄ Given any 3 permutations on n symbols, one an olor the symbols with red and blue, suh that in any interval of any of those permutations, the number of red and blue symbols diers by O(1). permutation 1: 4 6 b 1 b 5 b 7 b 2 b 8 3 permutation 2: 7 b 8 2 b 5 b 3 b 4 b 1 6 permutation 3: 2 1 6 4 8 5 3 7 b b b b b b b b b b b Bek's Conjeture 3-Permutations Conjeture [Bek℄ Given any 3 permutations on n symbols, one an olor the symbols with red and blue, suh that in any interval of any of those permutations, the number of red and blue symbols diers by O(1). permutation 1: 4 6 b 1 b 5 b 7 b 2 b 8 b 3 permutation 2: 7 b 8 b 2 b 5 b 3 b 4 b 1 6 permutation 3: 2 1 6 4 8 5 3 7 b b b b b b b b b b b b Bek's Conjeture 3-Permutations Conjeture [Bek℄ Given any 3 permutations on n symbols, one an olor the symbols with red and blue, suh that in any interval of any of those permutations, the number of red and blue symbols diers by O(1). permutation 1: 4 6 b 1 b 5 b 7 b 2 b 8 b 3 permutation 2: 7 b 8 b 2 5 3 4 1 6 permutation 3: 2 1 6 4 8 5 3 di red/blue O(1) 7 b b b b b b b b b b b b b b b b Bek's Conjeture 3-Permutations Conjeture [Bek℄ Given any 3 permutations on n symbols, one an olor the symbols with red and blue, suh that in any interval of any of those permutations, the number of red and blue symbols diers by O(1). permutation 1: 4 6 b 1 b 5 b 7 b 2 b 8 b 3 permutation 2: 7 b 8 b 2 5 3 4 1 6 permutation 3: 2 1 6 4 8 5 3 di red/blue O(1) 7 I b b b b b b b b b b b b b W.l.o.g. onsider intervals that start at beginning b b b Disrepany theory I Set system S = fS ; : : : ; Sm g; Si [n℄ 1 Disrepany theory I I Set system S = fS ; : : : ; Sm g; Si [n℄ Coloring : [n℄ ! f 1; +1g 1 Disrepany theory I I I Set system S = fS ; : : : ; Sm g; Si [n℄ Coloring : [n℄ ! f 1; +1g 1 Disrepany dis(S ) = nmin max j(S )j: !f g S 2S where (S ) = Pi2S (i). :[ ℄ 1 Disrepany theory I I I Set system S = fS ; : : : ; Sm g; Si [n℄ Coloring : [n℄ ! f 1; +1g 1 Disrepany dis(S ) = nmin max j(S )j: !f g S 2S :[ ℄ 1 where (S ) = Pi2S (i). Known results: p I n sets, n elements: dis(S ) = O( n) [Spener '85℄ Disrepany theory I I I Set system S = fS ; : : : ; Sm g; Si [n℄ Coloring : [n℄ ! f 1; +1g 1 Disrepany dis(S ) = nmin max j(S )j: !f g S 2S :[ ℄ 1 where (S ) = Pi2S (i). Known results: p I n sets, n elements: dis(S ) = O( n) [Spener '85℄ I Every element in t sets:pdis(S ) < 2t [Bek & Fiala '81℄ Conjeture: dis(S ) O( t) Matrix disrepany I Matrix A dis(A) := x2fmin; gn kAx 01 1 2 A ( ;:::; 1 2 )k1 Matrix disrepany I Matrix A dis(A) := x2fmin; gn kAx 01 1 2 A ( ;:::; 1 2 )k1 0 1 1 01 A = 0 1 1A i 1 0 1 S dis(S ) = 2 dis(A) i set S Matrix disrepany I Matrix A dis(A) := x2fmin; gn kAx 01 1 2 A ( ;:::; 1 2 )k1 0 1 1 01 A = 0 1 1A i 1 0 1 S dis(S ) = 2 dis(A) I i Linear disrepany: lindis(A) := y2max; n x2fmin; gn kAx [0 1℄ 01 Ayk1 set S Overview O(1) O(1) 3-Partition gap Linear dis. of 3-monotone matries Disrepany of 3 permutations O(1) Overview O(1) O(1) 3-Partition gap Linear dis. of 3-monotone matries Disrepany of 3 permutations O(1) I A is 3-monotone, if I olumns are monotone inreasing I entries are 2 f0; : : : ; 3g 00 1 01 B0 2 1C A=B 2 2 1C A 3 2 2 Overview O(1) O(1) 3-Partition gap Linear dis. of 3-monotone matries Disrepany of 3 permutations O(1) I A is 3-monotone, if I olumns are monotone inreasing I entries are 2 f0; : : : ; 3g Theorem 00 1 01 B0 2 1C A=B 2 2 1C A Bek's Conjeture ) 3-Partition gap is O(1) 3 2 2 Overview O(1) 3-Partition gap O(1) Linear dis. of 3-monotone matries Disrepany of 3 permutations O(1) I A is 3-monotone, if I olumns are monotone inreasing I entries are 2 f0; : : : ; 3g Theorem 00 1 01 B0 2 1C A=B 2 2 1C A Bek's Conjeture ) 3-Partition gap is O(1) 3 2 2 Redution: Gap ! LinDis Lemma (A) O(1) 3 O(1) I Sort items: s s : : : sn Suppose lindis Then the for any 3-monotone matrix -Partition gap is 1 2 . A. Redution: Gap ! LinDis Lemma (A) O(1) A 3 O(1) I Sort items: s s : : : sn I y be opt. frational 3-Partition sol., B pattern matrix Suppose lindis Then the for any 3-monotone matrix -Partition gap is 1 2 01 0 11 B1 1 0 C B=B 0 1 1C A 0 1 1 . . Redution: Gap ! LinDis Lemma (A) O(1) A 3 O(1) I Sort items: s s : : : sn I y be opt. frational 3-Partition sol., B pattern matrix I Add up rows 1; : : : ; i to obtain row i for new matrix A. Append row (3; : : : ; 3) Suppose lindis Then the for any 3-monotone matrix -Partition gap is 1 . 2 01 0 11 01 0 11 B 2 1 1C C B C B 1 1 0 B C B B= ! A = B2 2 2C A 0 1 1 A 2 3 3C 0 1 1 3 3 3 . Redution: Gap ! LinDis Lemma (A) O(1) A 3 O(1) I Sort items: s s : : : sn I y be opt. frational 3-Partition sol., B pattern matrix I Add up rows 1; : : : ; i to obtain row i for new matrix A. Append row (3; : : : ; 3) I A is 3-monotone ) x 2 f0; 1gm : kAx Ayk1 = O(1) Suppose lindis Then the for any 3-monotone matrix -Partition gap is 1 . 2 01 0 11 01 0 11 B 2 1 1C C B C B 1 1 0 B C B B= ! A = B2 2 2C A 0 1 1 A 2 3 3C 0 1 1 3 3 3 . Redution: Gap ! LinDis Lemma (A) O(1) A 3 O(1) I Sort items: s s : : : sn I y be opt. frational 3-Partition sol., B pattern matrix I Add up rows 1; : : : ; i to obtain row i for new matrix A. Append row (3; : : : ; 3) I A is 3-monotone ) x 2 f0; 1gm : kAx Ayk1 = O(1) I Due to last row: 1T x = 1T y O(1) Suppose lindis Then the for any 3-monotone matrix -Partition gap is 1 . 2 01 0 11 01 0 11 B 2 1 1C B C C B 1 1 0 B C B B= ! A = B2 2 2C A 0 1 1 A 2 3 3C 0 1 1 3 3 3 . Redution: Gap ! LinDis Lemma (A) O(1) A 3 O(1) I Sort items: s s : : : sn I y be opt. frational 3-Partition sol., B pattern matrix I Add up rows 1; : : : ; i to obtain row i for new matrix A. Append row (3; : : : ; 3) I A is 3-monotone ) x 2 f0; 1gm : kAx Ayk1 = O(1) I Due to last row: 1T x = 1T y O(1) I Bi y = 1 ) Ai y = i ) Ai x = i O(1) I Due to ith row: x reserves i O(1) slots for items 1; : : : ; i 01 0 11 01 0 11 B 2 1 1C C B C B 1 1 0 B C B B= ! A = B2 2 2C A 0 1 1 A 2 3 3C 0 1 1 3 3 3 Suppose lindis Then the for any 3-monotone matrix -Partition gap is 1 2 . . Redution: Gap ! LinDis (2) input items V slots provided by x 1 1 2 2 i n ... ... ... ... 2 1 i 0 n 1 i O(1) slots Redution: Gap ! LinDis (2) input items V slots provided by x 1 1 2 2 i n ... ... ... ... 2 1 i 0 n 1 i O(1) slots Redution: Gap ! LinDis (2) input items V slots provided by x 1 1 Bx 1 2 i n I ... ... ... ... 2 B2 x i Bi x n Bn x Bipartite graph G = (V [_ U; E ) with (i; j ) :, si sj Redution: Gap ! LinDis (2) input items V slots provided by x 1 1 Bx 1 V0 2 i n I I ... ... ... ... 2 B2 x N (V 0 ) i Bi x n Bn x i O(1) Bipartite graph G = (V [_ U; E ) with (i; j ) :, si sj Halls Marriage Theorem: There is a V -perfet mathing i for any V 0 V , Pv2N V deg(v) jV 0j ( 0 ) slots Redution: Gap ! LinDis (2) input items V slots provided by x 1 1 B x + O(1) 1 V0 2 i n ... ... ... ... 2 B2 x N (V 0 ) i Bi x n Bn x i slots Bipartite graph G = (V [_ U; E ) with (i; j ) :, si sj Halls Marriage Theorem: There is a V -perfet mathing i for any V 0 V , Pv2N V deg(v) jV 0j I x + O(1) extra bins is feasible (osts OP Tf + O(1)) I I ( 0 ) Overview O(1) O(1) 3-Partition gap Linear dis. of 3-monotone matries Disrepany of 3 permutations O(1) Overview O(1) O(1) 3-Partition gap Linear dis. of 3-monotone matries Disrepany of 3 permutations O(1) Redution: LinDis Lemma Let A be 3-monotone. I I ! Perm.Dis. Bek's Conjeture ) Let x 2 [0; 1℄n be given. Goal: Find y 2 f0; 1gn with Ax Ay lindis (A) = O(1) . Redution: LinDis Lemma Let A be 3-monotone. I I ! Perm.Dis. Bek's Conjeture ) lindis (A) = O(1) Let x 2 [0; 1℄n be given. Goal: Find y 2 f0; 1gn with Ax Ay Theorem (Lovasz, Spener & Vesztergombi '86) There is always a submatrix B of A with lindis(A) 2 dis(B ): I I Intuitively: Worst ase is x 2 f0; gn It suÆes to show: dis(A) = O(1) 1 2 . Redution: LinDis 0 A=B 0 1 2 2 3 3 3 0 0 1 1 1 1 2 1 1 1 2 2 3 3 0 0 0 0 0 2 2 1 C A ! Perm.Dis. (2) Redution: LinDis I ! Perm.Dis. (2) Write A = B + B + B with B i 1-monotone 1 0 A=B 0 1 2 2 3 3 3 0 0 1 1 1 1 2 1 1 1 2 2 3 3 0 0 0 0 0 2 2 2 1 0 C A =B 3 0 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 1 1 1 0 C A+B 0 0 1 1 1 0 0 0 0 0 10 1 1 0 0 0 1 1 0 0 0 0 0 11 1 0 C A+B 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 C A | {z } | {z } | {z } B1 = 1 1 B2 = B3 = Redution: LinDis I I ! Perm.Dis. (2) Write A = B + B + B with B i 1-monotone Column order of B i indues permutation i 1 0 A=B 0 1 2 2 3 3 3 0 0 1 1 1 1 2 1 1 1 2 2 3 3 0 0 0 0 0 2 2 2 1 0 C A =B 3 0 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 1 1 1 0 C A+B 0 0 1 1 1 0 0 0 0 0 10 1 1 0 0 0 1 1 0 0 0 0 0 11 1 0 C A+B 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 C A | {z } | {z } | {z } B1 = 1 = (3; 1; 2; 4) 1 1 B2 = 2 = (1; 3; 4; 2) B3 = 3 = (1; 3; 2; 4) ! Perm.Dis. (2) Redution: LinDis I I I Write A = B + B + B with B i 1-monotone Column order of B i indues permutation i Let : [n℄ ! f1g be oloring that's good for ; : : : ; . 1 2 3 1 dis(A) kAk1 0 A=B 0 1 2 2 3 3 3 0 0 1 1 1 1 2 1 1 1 2 2 3 3 0 0 0 0 0 2 2 1 0 C A =B triangle ineq 0 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 1 1 X 3 i |kB {zk1} = O(1) i=1 1 0 C A+B 3 O(1) 0 0 1 1 1 = 0 0 0 0 0 10 1 1 0 0 0 1 1 0 0 0 0 0 11 1 0 C A+B 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 C A | {z } | {z } | {z } B1 = 1 = (3; 1; 2; 4) 1 1 B2 = 2 = (1; 3; 4; 2) B3 = 3 = (1; 3; 2; 4) Open problem (1) O(1) O(1) 3-Partition gap Linear dis. of 3-monotone matries Disrepany of 3 permutations O(1) Open problem (1) O(1) O(1) Linear dis. of 3-monotone matries 3-Partition gap ? Disrepany of 3 permutations O(1) Open problem (2) I I Dene (n) := max dis(A) j Example: A 2 [0; 1℄nn ; A has monotone olumns 0 0:1 0:0 0:51 A = 0:4 0:7 0:9A 0:5 0:9 1:0 Open problem (2) I I Dene (n) := max dis(A) j A 2 [0; 1℄nn ; A has monotone olumns 0 0:1 0:0 0:51 A = 0:4 0:7 0:9A Example: 0:5 0:9 1:0 Lemma For any Bin Paking instane OP T I OP Tf + O(log n) (n): We an prove (n) O(log n). Open problem (2) I I Dene (n) := max dis(A) j A 2 [0; 1℄nn ; A has monotone olumns 0 0:1 0:0 0:51 A = 0:4 0:7 0:9A Example: 0:5 0:9 1:0 Lemma For any Bin Paking instane OP T I OP Tf + O(log n) (n): We an prove (n) O(log n). Question Is (n) = O(1)? The end Thanks for your attention I Bin Paking via Disrepany of Permutations (F. Eisenbrand, D. Palvolgyi, T. Rothvo - to appear in SODA'11; ) http://arxiv.org/abs/1007.2170