In the Colored Bin Packing problem a set of items with varying weights and colors must be packed into bins of uniform weight limit such that no two items of the same color may be packed adjacently within a bin. We solve this problem for the case where there are two or more colors when the items have zero weight and when the items have unit weight. Our algorithms are optimal and run in linear time. Since our algorithms apply for two or more colors, they demonstrate that the problem does not get harder as the number of colors increases. We also provide closed-form expressions for the optimal number of bins.
It was proven in @cite_5 , that no competitive algorithm exists for online Colored Bin Packing when there are more than two colors even when the items have zero-weight. Therefore, in this paper we consider offline Colored Bin Packing when there are more than two colors. We present optimal linear time algorithms that solve this problem for two or more colors when the items have zero-weight and when the items have unit-weight. Since our algorithms are optimal for two or more colors, they demonstrate that the problem does not get harder as the number of colors increases.
@cite_5
166203068 2177689085 2963083784 1781979225
We study a variant of online bin packing, called colorful bin packing. In this problem, items that are presented one by one are to be packed into bins of size 1. Each item i has a size s i ∈ [0,1] and a color (c_i C ), where ( C ) is a set of colors (that is not necessarily known in advance). The total size of items packed into a bin cannot exceed its size, thus an item i can always be packed into a new bin, but an item cannot be packed into a non-empty bin if the previous item packed into that bin has the same color, or if the occupied space in it is larger than 1 − s i . This problem generalizes standard online bin packing and online black and white bin packing (where (| C |=2 )). We prove that colorful bin packing is harder than black and white bin packing in the sense that an online algorithm for zero size items that packs the input into the smallest possible number of bins cannot exist for (| C | 3 ), while it is known that such an algorithm exists for (| C |=2 ). We show that natural generalizations of classic algorithms for bin packing fail to work for the case (| C | 3 ), and moreover, algorithms that perform well for black and white bin packing do not perform well either, already for the case (| C |=3 ). Our main results are a new algorithm for colorful bin packing that we design and analyze, whose absolute competitive ratio is 4, and a new lower bound of 2 on the asymptotic competitive ratio of any algorithm, that is valid even for black and white bin packing. We introduce the following version of bin packing. The items are of two types (black and white), and in each bin the item types must alternate. We mostly investigate the online scenario. We study the competitiveness of some classical algorithms (First Best Worst Next Fit, Harmonic) — they do not perform very well — and for all online algorithms we also prove the universal lower bound (1+ 1 2 .7213 ) which significantly exceeds the known upper bound 1.58889 on classical online bin packing. We also design an online algorithm which is 3-competitive in the absolute sense. A 2.5-approximation algorithm and an APTAS is also given for the offline version. We revisit the classic online bin packing problem studied in the half-century. In this problem, items of positive sizes no larger than 1 are presented one by one to be packed into subsets called bins of total sizes no larger than 1, such that every item is assigned to a bin before the next item is presented. We use online partitioning of items into classes based on sizes, as in previous work, but we also apply a new method where items of one class can be packed into more than two types of bins, where a bin type is defined according to the number of such items grouped together. Additionally, we allow the smallest class of items to be packed in multiple kinds of bins, and not only into their own bins. We combine this with the approach of packing of sufficiently big items according to their exact sizes. Finally, we simplify the analysis of such algorithms, allowing the analysis to be based on the most standard weight functions. This simplified analysis allows us to study the algorithm which we defined based on all these ideas. This leads us to the design and analysis of the first algorithm of asymptotic competitive ratio strictly below 1.58, specifically, we break this barrier by providing an algorithm AH (Advanced Harmonic) whose asymptotic competitive ratio does not exceed 1.57829. Our main contribution is the introduction of the simple analysis based on weight function to analyze the state of the art online algorithms for the classic online bin packing problem. The previously used analytic tool named weight system was too complicated for the community in this area to adjust it for other problems and other algorithmic tools that are needed in order to improve the current best algorithms. We show that the weight system based analysis is not needed for the analysis of the current algorithms for the classic online bin packing problem. The importance of a simple analysis is demonstrated by analyzing several new features together with all existing techniques, and by proving a better competitive ratio than the previously best one. In the Colored Bin Packing problem a sequence of items of sizes up to (1 ) arrives to be packed into bins of unit capacity. Each item has one of (c 2 ) colors and an additional constraint is that we cannot pack two items of the same color next to each other in the same bin. The objective is to minimize the number of bins.