An Asymptotic Lower Bound for Online Vector Bin Packing
aa r X i v : . [ c s . D S ] A ug An Asymptotic Lower Bound for Online Vector Bin Packing
Nikhil Bansal ∗ Ilan Reuven Cohen † Abstract
We consider the online vector bin packing problem where n items specified by d -dimensional vectorsmust be packed in the fewest number of identical d -dimensional bins. Azar et al. [1] showed that forany online algorithm A , there exist instances I , such that A ( I ) , the number of bins used by A to pack I , is Ω( d/ log d ) times O PT ( I ) , the minimal number of bins to pack I . However in those instances,O PT ( I ) was only O (log d ) , which left open the possibility of improved algorithms with better asymptoticcompetitive ratio when O PT ( I ) ≫ d . We rule this out by showing that for any arbitrary function q ( · ) andany randomized online algorithm A , there exist instances I such that E [ A ( I )] ≥ c · d/ log d · O PT ( I ) + q ( d ) , for some universal constant c . We consider the d -dimensional vector bin packing problem ( VBP ), a natural and well-studied multi-dimensionalgeneralization of the classic bin packing problem. Here, we are given a collection W = { w , w , ..., w n } of n items, where each item corresponds to a vector w i ∈ [0 , d . The goal is to pack these items feasiblyinto the fewest number of bins, where a subset S ⊆ W of items is said to be packed feasibly in a bin if P i ∈ S w i ( j ) ≤ , for each coordinate j = 1 , . . . , d .Note that the case of d = 1 corresponds to the extensively studied bin-packing problem, where each item(job) corresponds to a number in [0 , specifying its resource requirement, and the bins correspond tomachines. In many applications however, jobs require multiple resources and can be modeled as multi-dimensional vectors; with a dimension for each resource. Rescaling the units of measurement so that eachmachine has unit capacity for each resource, VBP thus corresponds to finding a feasible assignment of jobs tothe least number of machines without exceeding the available resources on any machine.
VBP has received alot of attention, both theoretically and practically, especially due to applications in virtual machine placementin cloud computing, e.g., [16, 18]. We do not attempt to survey the various results on the problem, and onlyfocus on the ones most relevant to our setting.In this paper we focus on the online version of
VBP . Here, the vectors arrive one by one, and upon ar-rival the incoming vector must be assigned immediately and irrevocably, to some (possibly new) bin whilemaintaining the feasibility of the bin. For a randomized online algorithm A , given an instance W , let A ( W ) denote the expected number of bins used by A , and let O PT ( W ) denote the optimal number of binsin the optimum offline solution for W . An online algorithm A is α -competitive if for any instance W , A ( W ) ≤ α · O PT ( W ) + c , where c is some universal constant, independent of the problems parameters n, d . Under this (strict) notion of competitive ratio, the problem is quite well-understood. Garey et al. [10] ∗ CWI Amsterdam and TU Eindhoven,
[email protected] . Supported by the ERC Consolidator Grant 617951 and the NWOVICI grant 639.023.812. † Jether Energy Ltd, Israel, [email protected] . This work was done when the author was a postdoc at CWI andsupported by the ERC Consolidator Grant 617951. ( d + 0 . -competitive [8]. On the other hand, using a well-knownconnection of VBP to graph coloring (that we shall see later), together with a classic result lower bound ofHalld´orsson and Szegedy [11] for online coloring, Azar et al. [1] showed that any randomized algorithmmust a have competitive ratio of at least Ω( d/ log d ) . They also show more refined and almost tight lowerbounds as a function of the ratio of the bin size to the maximum item size. Asymptotic guarantees.
In many bin-packing problems however, it is often more insightful to considerasymptotic guarantees, where the additive error in the approximation (resp. competitive) ratio for offline(resp. online) problems can depend on the input parameters. For example, for the classic bin-packing prob-lem, strictly speaking, it is NP-Hard to find an approximation factor better than / , as it is hard to distin-guish a solution value of versus , as seen by a simple reduction from the Partition problem. But there existmuch better asymptotic guarantees such as (1 + ǫ ) O PT + O (1 /ǫ ) , for all ǫ > , and O PT + O (log O PT ) [9, 13]. These are not only better when O PT is large, but also lead to very interesting algorithmic ideas andinsights. Asymptotic guarantees for online (1- d ) bin packing have also been studied extensively. While Ull-man [17] proved that for any instance W , FirstFit ( W ) ≤ . O PT ( W )+3 , several algorithms are known withimproved asymptotic guarantees. Currently, the best such result is a . · (1 + ǫ ) O PT ( W ) + O (1 /ǫ ) com-petitive algorithm for any ǫ > , due to Balog et al. [2], and the best asymptotic lower bound is . [3].Similarly, strictly speaking, VBP is hard to approximate within a factor of d − ǫ for any ǫ > , when d is partof the input. This follows from the connection of VBP to graph coloring mentioned above and the classichardness of approximation results for graph coloring [12, 14]. However, and perhaps somewhat surprisingly,much better approximation guarantees of the form O (log d ) O PT + O d (1) are known, when an additive errorand running time exponential in d is allowed [7, 4, 5]. Such bounds are quite useful since d is a smallconstant and O PT is large in typical practical applications.As running time is a not a consideration for online algorithms, these results also suggest the possibility of an asymptotic online guarantee of the form O (log d ) O PT + O d (1) , or even O (1) O PT + O d (1) . Moreover, thelower bound results of Azar et al. [1] do not rule out such improved asymptotic bounds either, as the valueof O PT in those instances is only a function of d (in fact O PT is only O (log d ) ). The dependence of O PT on d also seems inherent in these constructions as they were based on reductions from coloring (we discuss thismore later). For these reasons, it was believed that such improved asymptotic bounds might exist, and therehas been interest in finding such an algorithm. This was also our initial motivation for looking at online VBP . Our result.
We show that unfortunately, no online algorithms with substantially better bounds than ˜ O ( d ) ,where ˜ O ( · ) suppresses poly-logarithmic factors, exist even if asymptotic guarantees are allowed. Moreformally, we show the following. Theorem 1.
Any randomized online algorithm for
VBP must have an asymptotic competitive ratio of at least Ω( d/ log d ) . In particular, given any arbitrary function q ( · ) , there exists instances I , such that E [ A ( I )] ≥ c ( d/ log d ) · O PT ( I ) + q ( d ) for any randomized online algorithm A , for some universal constant c . The main idea behind Theorem 1 is an approach to amplify the instances used in [1]. The lower bound in [1]is based on a reduction from the online coloring problem to
VBP , where the number of items n is equal tothe number of dimensions d . However, note that any instance where d is some function of n , cannot be usedto show the asymptotic lower bounds in Theorem 1, as already the trivial packing using n bins is already -competitive asymptotically as n = q ( d ) for some q . In particular, to show such a lower bound one needsa family of instances where the value O PT has no dependence d . As we discuss in Section 2 below, such adependence seems inherent in direct reduction via online coloring.2o get around this problem, instead of reducing VBP to coloring, we consider a different copies-coloringproblem ( CCP ) that lies between the coloring problem and the fractional coloring problem. Even though thisproblem is almost as difficult as online coloring (due to the close relation between chromatic and fractionalchromatic numbers [15]), the flexibility in CCP instances will allow us to construct
VBP instances where O PT can be arbitrarily large for any fixed d . Our lower bound instances will be similar to those used in [11, 1], butmodified to work for the copies-coloring problem. We will not work with the notion of fractional chromaticnumbers directly as it is unclear how to do this in the online setting, but our analysis will implicitly use theideas of [15]. We now give the relevant notation and a more formal description of previous ideas. We first describe asimple offline reduction from graph coloring to
VBP , and then discuss the online variant of graph coloringthat arises from online
VBP .Recall that in the coloring problem, given an undirected graph G ( V, E ) , the goal is to color each vertex of G using the least number of colors, so that any two adjacent vertices have different color. Call a k -coloring g : V → [ k ] of G feasible if g ( u ) = g ( v ) for all ( v, u ) ∈ E . As the set of vertices assigned a particularcolor form an independent set, a k -coloring is also equivalently viewed as covering of the vertices V by k independent sets. In this case we say that the chromatic number χ ( G ) is at most k . Reduction.
Given a graph G on n = | V | vertices, consider the following VBP instance W with n items and d = n dimensions. For each vertex v i we create a vector w i with w i ( i ) = 1 and w i ( j ) = 1 /n , if ( v i , v j ) ∈ E and j < i , and w i ( j ) = 0 otherwise. Here w i ( k ) denotes the k -th coordinate of w i . The following is an easyobservation. Observation 1.
For any subset S ⊆ [ n ] , the set of items W S = { w i : i ∈ S } can be feasibly packed in abin iff the set of vertices V S = { v i : i ∈ S } is an independent set in G .Proof. Suppose, ( v i , v j ) ∈ E and i < j . As w i ( i ) = 1 and w j ( i ) > , the cannot lie in the same bin. Hencethe items that can be packed in a bin correspond to independent sets in G . Conversely, given any independentset V S ⊂ V in G , the corresponding items W S can be packed feasibly in a bin as for any coordinate i ∈ S ,there is exactly one item w i with w i ( i ) = 1 and no item w j with w j ( i ) = 1 /n . Moreover, as there are atmost n items, for any coordinate i / ∈ S , there can be at most | S | ≤ n items with value w j ( i ) = 1 /n . So theconstraints for every coordinate i ∈ [ n ] are satisfied.Given the n − ǫ hardness of approximation result [12] for coloring for any ǫ > , this directly implies a d − ǫ hardness for VBP when d is part of the input. Let us also note that in this reduction the number ofdimensions d in the resulting VBP instance, must necessarily be some function of n . In particular, even forbounded degree graphs of degree d ′ , graph coloring is known to be d ′ / polylog ( d ′ ) hard to approximate [6].While if the number of dimensions d in VBP is constant, then it has a polynomial time algorithm that usesonly O (log d ) O PT + O d (1) bins, giving essentially an O (log d ) approximation. Online coloring and HS instances.
Consider the following online graph coloring problem. The input isa sequence of vertices, and upon the arrival of a vertex all its neighbors to the previously arrived verticesare revealed, and the algorithm must immediately and irrevocably assign this vertex a feasible color. Thisproblem was studied by Halld´orsson and Szegedy [11], who showed that for any n there exists a adversarialstrategy that produces distribution over graphs with n vertices and chromatic number O (log n ) , but for whichany randomized online algorithm requires at least Ω( n/ log n ) colors. We will call these HS instances . Notethat the reduction from online coloring described above, produces an online
VBP instance and works for any3 (albeit with n = d ). In particular, this implies a distribution over instances where O PT = O (log d ) but anyonline algorithm uses Ω( d/ log d ) bins.As we will be interested in asymptotic guarantees, we say that for any function q , a randomized onlinealgorithm A for VBP is ( α, q ( d )) competitive, if for any instance W of VBP , it holds that E [ A ( W )] ≤ α O PT ( W ) + q ( d ) . Fractional coloring.
We recall the notion of fractional coloring originally introduced by Lov´asz [15]. Givena graph G , let S denote the collection of all its independent sets. Then the fractional chromatic number,denoted χ f ( G ) , is the smallest number of colors needed to fractionally cover each vertex by independentsets to an extent of at least . That is, it is the optimum value of the following exponential size linearprogram. min X S ∈S x S s.t. X S ∋ v x S ≥ ∀ v ∈ V, x S ∈ [0 , ∀ S ∈ S It is well-known that for any graph G , the fractional chromatic number is not too far from that chromaticnumber. In particular, χ f ( G ) ≤ χ ( G ) ≤ (1 + ln n ) χ f ( G ) [15]. In this section we prove Theorem 1. We begin by defining the copies-coloring problem and list some ofits basic properties. In § § VBP by givinga reduction from copies-coloring.
In an (offline) instance of the copies coloring problem, denoted by G t ( V, E ) , the input is an underlyinggraph G ( V, E ) and for each vertex v , there are t copies ( v, , . . . , ( v, t ) . The goal is to find a coloring ofthe copies, using the least number of colors, so that (i) each copy of a vertex is assigned a different color,and (ii) any two copies ( u, i ) and ( v, j ) are assigned a different color if ( u, v ) ∈ E . In other words, G t canbe viewed as being obtained from G , by replacing each vertex v of G by the complete graph K t , and anedge ( u, v ) in G , by the complete bipartite graph K t,t .Given a feasible coloring g of G t ( V, E ) , for each color r , let H g ( r ) = { v ∈ V : ∃ i ∈ [ t ] such that g ( v, i ) = r } denote the set of vertices of V for which some (unique) copy is assigned the color r . Note that H g ( r ) isdefined as subset of the vertices of G (and not of vertex-copies in G t ). This distinction will be crucial later.Moreover, H g ( r ) is an independent set in G .Let χ ( G t ) denote the chromatic number of G t . We have the following simple lemma. Lemma 2.
For any graph G , and G t obtained from G as described above, χ f ( G ) ≤ χ ( G t ) /t ≤ χ ( G ) . Proof.
We first show that χ ( G t ) ≤ tχ ( G ) . This follows directly as any coloring g of G with k = χ ( G ) colors can be extended to a feasible coloring f of G t using kt colors, by using a fresh set of colors for eachof the t copies of G , i.e. consider the coloring f ( v, i ) = ( g ( v ) , i ) .4e now show that χ f ( G ) ≤ χ ( G t ) /t . Let k = | χ ( G t ) | and let f be some coloring of G t using k colors. For i ∈ [ k ] , consider the independent set H f ( i ) of G as defined above. Consider the fractional coloring x for G with value k/t obtained by setting x S = 1 /t for each of the k sets S = H f ( i ) for i ∈ [ k ] . This fractionalcoloring is valid as for each v ∈ V , its t copies use different colors, and hence v lies in t independent sets H f ( i ) .The online version of copies coloring problem is defined as follows. There are n time steps, at each stepa vertex v ∈ G arrives, and reveals all its edges to previously arrived vertices in G . At this step, t copies ( v, , . . . , ( v, t ) of v are created in G t and all the edges between these copies and the previously createdcopies are added depending on the neighbors of v in G . Each one of these t copies of v must be immediatelyand irrevocably assigned a feasible color. Let G be a graph on n vertices, and G t be the corresponding graph with copies as defined above. Let n = | V ( G ) | . We say that an online algorithm for G t is ( α, q ( n )) -competitive, for some function q , if thenumber of colors used by it most α · χ ( G t ) + q ( n ) .Note that even though G t has n · t vertices, the additive term q ( n ) in the definition above only dependson n . This distinction between t and n will be crucial in our reductions and allow us to translate the non-asymptotic lower bounds for coloring G to asymptotic lower bounds for coloring G t . In particular, we showthe following. Theorem 3.
For any function q , there exists a family of instances G t , such that there is there is no ran-domized ( o ( n/ log n ) , q ( n )) -competitive algorithm for online copies coloring, where n is the number ofvertices in the underlying graph G . Consider the instance G obtained from the HS graphs on n vertices [11]. As stated in Section 2, theseare O (log n ) colorable, and there is an online realization of the graph, in for which any online algorithmuses Ω( n/ log n ) colors in expectation, and in particular implies an Ω( n/ log n ) lower bound for onlinecoloring.So to prove Theorem 3, it suffices to show the following. Lemma 4.
For any function q , if there exists an ( α, q ( n )) -competitive algorithm for the online copiescoloring problem on instances G t for some t = Ω( q ( n ) log n ) , then there exists a n · α -competitive forthe online coloring problem on the underlying instances G . In particular, note that our reduction loses a factor of O (log n ) in α .We now focus on proving Lemma 4. Fix some function q , and let A be some ( α, q ( n )) -competitive algorithmfor the online copies coloring problem. We will use A to obtain another randomized algorithm B foran online coloring of G . In particular, algorithm B on instance G = G ( V, E ) simulates A on G t with t = q ( n ) log n copies of each vertex, and tries to color V using some (random) subset of the colors usedby A .We describe the algorithm formally in the figure below, and use the following notation. Let v , . . . , v n denote the online sequence of the vertices of G . At step i ∈ [ n ] , let A ( v i , j ) be the color used by A for the j -th copy of v i , and let R i ( A ) denote the set of all the colors used by A so far until the end of step i . Let B ( v i ) denote the color used by B for v i . We also have special set of n colors { , . . . , n } , that are not usedby A , and are reserved for use by B , in the occasional event that it fails.5pon the arrival of a vertex v i , B gives t copies of v i to algorithm A . Then, for each new color r used by A , B adds r to its pool of colors with probability p = 2 · log( n ) /t . If A colors some copy of v i using somecolor r , where r is in the pool of B , then B colors v i with r . Otherwise, B fails at step i and uses a brandnew color for v i . Algorithm 1:
Online coloring algorithm
Input:
An online graph G ( V, E ) , an algorithm A for copies coloring, and parameters p, t . Output:
A feasible coloring of G ( V, E ) Init B for step i ← to n do color t copies of v i using A for r ∈ R i ( A ) \ R i − ( A ) do with probability p add r to R i ( B ) P i ← { r ∈ R i ( B ) : ∃ j ∈ [ t ] , A ( v i , j ) = r } if P i = ∅ then set B ( v i ) = r ′ , for some r ′ ∈ P i else declare fail and set B ( v i ) = i The following simple observations show the correctness of B and the bound the number of colors used. Observation 2. B produces a feasible coloring of G .Proof. For a color r , let H A ( r ) denote the set of vertices in G for which some copy is colored r by A , andnote that H A ( r ) is an independent set in G . Similarly, let H B ( r ) be the vertices in G colored r by B . For r ∈ R ( B ) , if r ∈ R ( A ) then we have that H B ( r ) ⊆ H A ( r ) therefore H B ( r ) is an independent set. Onthe other hand, if r / ∈ R ( A ) , then r must be one of the special colors and hence | H B ( r ) | = 1 and is anindependent set.Let us say that B fails , if it uses a special color at any time step. As B can use at most n colors, and since R ( B ) is formed by choosing each vertex in R ( A ) independently with probability p , we have that: Observation 3.
The expected number of colors used by B is at most E [ | R ( A ) | ] · p + n · Pr [ B ’fails’ ] . Observation 4.
The probability that B fails is at most /n .Proof. Let I ( v i ) be the set of colors used by A to color the copies of v i . As | I ( v i ) | = t , Pr [ ∃ j ∈ P i ] = 1 − Pr [ ∀ r ∈ I ( v i ) : r / ∈ R i ( B )] = 1 − (cid:16) − nt (cid:17) t ≥ − /n . By a union bound for all v ∈ V , the probability that B fails is at most /n .Together these imply Lemma 4 as follows. Proof of Lemma 4.
By the observations above, B produces a valid coloring of G , and the expected numberof colors used is at most E ( | R ( A ) | ) p + 1 . Using that p = 2(log n ) /t and that E [ R ( A )] ≤ α · χ ( G t ) + q ( n ) by our assumption on A , the expected number of colors used by B is at most ( α · χ ( G t ) + q ( n )) · (2 log n ) /t + 1 ≤ (2 log n )( α · t · χ ( G ) + q ( n )) /t + 1 ≤ n · α · χ ( G ) + 3 , where the first inequality uses that χ ( G t ) ≤ t · χ ( G ) and the second inequality uses that t ≥ q ( n ) log n .6 .3 The reduction to VBP
To complete the proof of Theorem 1, we will show that if there exists a ( α, q ( d )) -competitive algorithm foronline VBP , then there exists an ( α, q ( n )) -competitive algorithm for online CCP .We give a reduction from
CCP to VBP similar to the one in Section 2, but instead of using d = nt dimensions(the number of vertices in G t ), we use d = n dimensions.Consider a CCP instance G t and let G = G ( V, E ) denote the underlying graph on n vertices. For each vertex v i ∈ V , consider the vector w i with coordinates w i ( i ) = 1 and w i ( j ) = 1 /n if ( v i , v j ) ∈ E and j < i , and otherwise. For each copy ( v i , k ) of vertex v i ∈ V and k ∈ [ t ] , we create a copy ( w i , k ) of w i . The goal inthe VBP instance is to pack the vectors-copies ( w i , k ) in the fewest bins.The following shows that the resulting VBP instance has a packing using r bins iff G t is r -colorable. Observation 5.
In any feasible solution to the
VBP instance, the copies of vectors packed in the same bin,correspond to independent sets in G t . In particular, (i) each bin contains at most one copy of any w i , and (ii)for any subset S ⊆ [ n ] , one copy of { w i : i ∈ S } can be packed in a bin iff { v i : i ∈ S } is an independentset in G .Proof. The first property holds as w i ( i ) = 1 . The second property now follows by Observation 1 as for asingle bin, copies of a vector do not affect the argument as there can be at most one copy of any vector.This observation, together with Theorem 3, and the fact that d = n in the reduction above, directly impliesTheorem 1. References [1] Yossi Azar, Ilan Reuven Cohen, Seny Kamara, and F. Bruce Shepherd. Tight bounds for online vectorbin packing. In
Symposium on Theory of Computing Conference, STOC , pages 961–970, 2013.[2] J´anos Balogh, J´ozsef B´ek´esi, Gy¨orgy D ´osa, Leah Epstein, and Asaf Levin. A new and improvedalgorithm for online bin packing. arXiv preprint arXiv:1707.01728 , 2017.[3] J´anos Balogh, J´ozsef B´ek´esi, and G´abor Galambos. New lower bounds for certain classes of binpacking algorithms.
Theoretical Computer Science , 440:1–13, 2012.[4] Nikhil Bansal, Alberto Caprara, and Maxim Sviridenko. A new approximation method for set coveringproblems, with applications to multidimensional bin packing.
SIAM J. Comput. , 39(4):1256–1278,2009.[5] Nikhil Bansal, Marek Eli´as, and Arindam Khan. Improved approximation for vector bin packing. In
Symposium on Discrete Algorithms, SODA , pages 1561–1579, 2016.[6] Siu On Chan. Approximation resistance from pairwise independent subgroups. In
Symposium onTheory of Computing, STOC , pages 447–456, 2013.[7] C. Chekuri and S. Khanna. On multi-dimensional packing problems.
SIAM journal on computing ,33(4):837–851, 2004.[8] E.G. Coffman Jr, M.R. Garey, and D.S. Johnson. Approximation algorithms for bin packing: A survey.In
Approximation algorithms for NP-hard problems , pages 46–93. PWS Publishing Co., 1996.79] W. F. de la Vega and G. S. Lueker. Bin packing can be solved within ǫ in linear time. Combinatorica ,1(4):349–355, 1981.[10] MR Garey, RL Graham, DS Johnson, and A.C.C. Yao. Resource constrained scheduling as generalizedbin packing.
Journal of Combinatorial Theory, Series A , 21(3):257–298, 1976.[11] M.M. Halld´orsson and M. Szegedy. Lower bounds for on-line graph coloring. In
Symposium onDiscrete algorithms, SODA , pages 211–216, 1992.[12] Johan H˚astad. Some optimal inapproximability results.
J. ACM , 48(4):798–859, 2001.[13] Rebecca Hoberg and Thomas Rothvoss. A logarithmic additive integrality gap for bin packing. In
Symposium on Discrete Algorithms, SODA , pages 2616–2625, 2017.[14] Subhash Khot. Improved inaproximability results for maxclique, chromatic number and approximategraph coloring. In
Foundations of Computer Science, FOCS , pages 600–609, 2001.[15] L. Lov´asz. On the ratio of optimal integral and fractional covers.
Discrete Mathematics , 13(4):383 –390, 1975.[16] Rina Panigrahy, Kunal Talwar, Lincoln Uyeda, and Udi Wieder. Heuristics for vector bin packing. research. microsoft. com , 2011.[17] J.D. Ullman.
The Performance of a Memory Allocation Algorithm . Technical report (Princeton Uni-versity. Dept. of Electrical Engineering. Computer Sciences Laboratory). Princeton University, 1971.[18] Q. Zhang, L. Cheng, and R. Boutaba. Cloud computing: state-of-the-art and research challenges.