A new and improved algorithm for online bin packing

Slides:



Advertisements
Similar presentations
Tight Bounds for Online Class- constrained Packing Hadas Shachnai Bell Labs and The Technion IIT Tami Tamir The Technion IIT.
Advertisements

NP-Completeness.
Minimum Clique Partition Problem with Constrained Weight for Interval Graphs Jianping Li Department of Mathematics Yunnan University Jointed by M.X. Chen.
 Review: The Greedy Method
Seminar in Auctions and Mechanism Design Based on J. Hartline’s book: Approximation in Economic Design Presented by: Miki Dimenshtein & Noga Levy.
Lecture 24 Coping with NPC and Unsolvable problems. When a problem is unsolvable, that's generally very bad news: it means there is no general algorithm.
Combinatorial Algorithms
Online Scheduling with Known Arrival Times Nicholas G Hall (Ohio State University) Marc E Posner (Ohio State University) Chris N Potts (University of Southampton)
Complexity ©D Moshkovitz 1 Approximation Algorithms Is Close Enough Good Enough?
1 Finite-State Online Algorithms and Their Automated Competitive Analysis Takashi Horiyama Kazuo Iwama Jun Kawahara Graduate School of Informatics, Kyoto.
The number of edge-disjoint transitive triples in a tournament.
Bin Packing With Fragile Objects Nikhil Bansal (CMU) Joint with Zhen Liu (IBM) & Arvind Sankar(MIT)
CS 345 Data Mining Online algorithms Search advertising.
1 Ecole Polytechnque, Nov 7, 2007 Scheduling Unit Jobs to Maximize Throughput Jobs:  all have processing time (length) = 1  release time r j  deadline.
Approximation Algorithms
Online Algorithms Motivation and Definitions Paging Problem Competitive Analysis Online Load Balancing.
Increasing graph connectivity from 1 to 2 Guy Kortsarz Joint work with Even and Nutov.
Job Scheduling Lecture 19: March 19. Job Scheduling: Unrelated Multiple Machines There are n jobs, each job has: a processing time p(i,j) (the time to.
Distributed Combinatorial Optimization
Online Packet Switching Techniques and algorithms Yossi Azar Tel Aviv University.
10/31/02CSE Greedy Algorithms CSE Algorithms Greedy Algorithms.
Approximation Algorithms
10/31/02CSE Greedy Algorithms CSE Algorithms Greedy Algorithms.
Improved results for a memory allocation problem Rob van Stee University of Karlsruhe Germany Leah Epstein University of Haifa Israel WADS 2007 WAOA 2007.
Active Learning for Probabilistic Models Lee Wee Sun Department of Computer Science National University of Singapore LARC-IMS Workshop.
Called as the Interval Scheduling Problem. A simpler version of a class of scheduling problems. – Can add weights. – Can add multiple resources – Can ask.
Why is bin packing interesting?
Design Techniques for Approximation Algorithms and Approximation Classes.
© 2009 IBM Corporation 1 Improving Consolidation of Virtual Machines with Risk-aware Bandwidth Oversubscription in Compute Clouds Amir Epstein Joint work.
Edge-disjoint induced subgraphs with given minimum degree Raphael Yuster 2012.
© 2010 AT&T Intellectual Property. All rights reserved. AT&T and the AT&T logo are trademarks of AT&T Intellectual Property. Case Studies: Bin Packing.
The Selection Problem. 2 Median and Order Statistics In this section, we will study algorithms for finding the i th smallest element in a set of n elements.
Notes 5IE 3121 Knapsack Model Intuitive idea: what is the most valuable collection of items that can be fit into a backpack?
First lecture in Mathematics
Competitive Queue Policies for Differentiated Services Seminar in Packet Networks1 Competitive Queue Policies for Differentiated Services William.
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
Chapter 8 Maximum Flows: Additional Topics All-Pairs Minimum Value Cut Problem  Given an undirected network G, find minimum value cut for all.
© The McGraw-Hill Companies, Inc., Chapter 12 On-Line Algorithms.
The bin packing problem. For n objects with sizes s 1, …, s n where 0 < s i ≤1, find the smallest number of bins with capacity one, such that n objects.
1 Approximation algorithms Algorithms and Networks 2015/2016 Hans L. Bodlaender Johan M. M. van Rooij TexPoint fonts used in EMF. Read the TexPoint manual.
11 -1 Chapter 12 On-Line Algorithms On-Line Algorithms On-line algorithms are used to solve on-line problems. The disk scheduling problem The requests.
Non-LP-Based Approximation Algorithms Fabrizio Grandoni IDSIA
Approximation algorithms
May 17th – Comparison Sorts
Greedy Technique.
Approximation Algorithms
Algorithm Design Methods
Approximation algorithms
Maximum Matching in the Online Batch-Arrival Model
Haim Kaplan and Uri Zwick
Algorithm design and Analysis
Framework for the Secretary Problem on the Intersection of Matroids
Chapter 6. Large Scale Optimization
The Subset Sum Game Revisited
Integer Programming (정수계획법)
Online algorithms Search advertising
Where did we stop? The Bayes decision rule guarantees an optimal classification… … But it requires the knowledge of P(ci|x) (or p(x|ci) and P(ci)) We.
Coverage Approximation Algorithms
PTAS for Bin-Packing.
György Dósa, University of Pannonia, Veszprém, Hungary
Chapter 11 Limitations of Algorithm Power
The Byzantine Secretary Problem
Support Vector Machines
Integer Programming (정수계획법)
Algorithm Design Methods
György Dósa – M. Grazia Speranza – Zsolt Tuza:
The Theory of NP-Completeness
The Selection Problem.
Bin Packing Michael T. Goodrich Some slides adapted from slides from
Presentation transcript:

A new and improved algorithm for online bin packing János Balogh József Békési University of Szeged, Szeged, Hungary György Dósa University of Pannonia, Veszprem, Hungary Leah Epstein University of Haifa, Haifa, Israel Asaf Levin The Technion, Haifa, Israel

Problem definition : Online bin packing Items Arriving one by one Item i has a size si(0,1] Assign (pack) items to bins such that The number of bins is minimized Every item is packed (irrevocably) before the next item arrives The total size of items of one bin is at most 1

Measure: Asymptotic analysis Standard for bin packing problems The cost of an algorithm is compared to the cost of an optimal solution on instances where the latter grows to infinity The algorithms here are online (Asymptotic) competitive ratio for online problems (Asymptotic) approximation ratio for offline problems Bin packing was studied in the past with respect to theses measures

Asymptotic competitive ratio - definition The (asymptotic) competitive ratio is the infimum R which satisfies for every sequence σ: ALG(σ)≤R*OPT(σ)+c. c is a non-negative constant, which does not depend on the sequence.

Online bin packing – lower bounds Yao ‘80 – 1.5. Brown ‘79 and Liang ’80 - 1.53635. van Vliet ‘92– 1.5401. Balogh, Bekesi, and Galambos ‘12– 1.5403. 1.54278 ([BBDEL] arxiv 1807.05554).

Our result A new algorithm for online bin packing with an asymptotic competitive ratio of 1.57829 The current best algorithm  A new and simplified weight function analysis.

The HARMONIC Algorithm (Lee&Lee,1985) Classify items according to size Each bin contains items from only one class: i items of type i Items of last type are packed using NEXT FIT. size type n+1 1 1/2 1/4 1/3 .... 6 5 4 3 2 1

The HARMONIC Algorithm Weighting function Assign weights to items based on their type. i items of type i per bin => weight of item in class i is 1/i type n +1: size x => weight Then for any set of items: number of bins used by HARMONIC = total weight + O(1) = maximum weight that can be packed (offline) in a single bin ≈ 1.691

The HARMONIC Algorithm - improvements Motivation: A bad sequence for HARMONIC is N items of size 1/7+ε, N items of size 1/3+ ε, and N items of size 1/2+ ε. Here, OPT has a cost of N, while HARMONIC has cost of N(1+1/2+1/6). One drawback is that bins used for items slightly larger than 1/2 are not reused for additional items.

The HARMONIC Algorithm – improvements (cont.) A better strategy for this instance would be: We partition the class of items with size in (1/2,1] to two classes (1/2,0.6] and (0.6,1]. We partition the class of items with size in (1/3,1/2] to two classes (1/3,0.4] and (0.4,1/2].

The HARMONIC Algorithm – improvements (cont.) The class of items with size in (1/3,0.4] is associated with a proportion α such that α fraction of its items are packed in pairs and (1- α ) fraction of its items are packed alone or with an item of size in (1/2,0.6] (if it exists). When an item of size (1/2,0.6] arrives we try to pack it into a bin already containing an item of size in (1/3,0.4] that is supposed to be packed alone. Other classes of items are packed as in HARMONIC.

On the analysis of such improvements There are two scenarios (cases): Either all items of sizes in (1/2,0.6] are packed together with smaller items, or all items of sizes in (1/3,0.4] are packed in pairs (with either another item of this class or a larger item). There is a weight function for each scenario. The resulting algorithms (with some small changes and finer partition of (1/2,1]) give the following improvements: Refined Harmonic (Lee & Lee, 85) comp. ratio 1.636. Modified Harmonic (Ramanan, Brown, Lee, & Lee, 89) comp. ratio 1.61562. Modified Harmonic 2 ([RBLL]) comp. ratio 1.612.

Super Harmonic – Seiden’02 Idea: we can try to match items of pairs of classes even if these classes are not larger than ½. There is a partition of (0,1] into (finitely many) classes. We pack items into containers and match containers into bins. For each class j there is a parameter α(j). An α(j) fraction of its items are packed in containers each of which with the maximum possible number of items of the class that fit into one bin, and (1- α(j)) fraction of its items are packed alone into containers. When a new container is created we know its (planned upper bound on the) total size, and we try to match two containers in every bin – a container with total size > ½ together with a container with total size ≤ ½.

super Harmonic – Seiden analysis a = the minimum total size of the smallest container of total size > ½ that is unmatched. a defines the scenario. For each scenario, there is a weight system Comp. ratio 1.58889. A weight system is not a weight function !!!

Weight system - disadvantages Too complicated … This tool is more difficult to adjust for the analysis of new tricks.

Previous trick: combining items by exact sizes An algorithm of Babel, Chen, Kellerer, Kotov, 2004 for cardinality constraint bin packing with k=2. This problem is equivalent to the special case of bin packing when all items are of sizes in (1/3,2/3). ratio of 1.5 is easy (greedy matching) and it is improved to 1.44721 [BCKK04]. Observation: when we need to test if we can match a container with one item in (1/3,1/2] together with a container with one item in (1/2,2/3) we can check if the two items fit into one bin and this check cannot be implemented by partitioning into classes. Obviously, when we pack a second item into an existing bin it is better to break ties in favor of a (previous) item of maximum size.

Using this new trick Heydrich and van Stee ‘16 claimed that using this trick and combining it with the super Harmonic framework gives a better algorithm for online bin packing. Their analysis is based on modifying the weight system analysis of Seiden and it is supposed to give a comp. ratio of 1.5813 (arxiv version v7 from June 18).

Our algorithm (AH) Goal – finding a better algorithm. Methods: Use weight function analysis – simpler and provide at least as good results as the weight system approaches. Implementing the following algorithmic improvements (over super Harmonic): Use the matching by exact sizes method when trying to match two containers each of which with only one item. Allow different cardinalities of containers for every class (e.g. items slightly larger than 1/7 can be packed in containers each of which with 6 items (of this class), with two items (of this class) and with only one item (of this class). Allow the set of tiny items which are smaller than ε to be packed into containers and in bins containing a container with larger items. Our result: 1.57289 comp. algorithm for online bin packing.

AH Partition items into classes based on their size. Huge item – size in (1/2,1] Large item – size in (1/3,1/2] Small item – size in (ε,1/3] Tiny items – size at most ε. There are many classes of large items and of small items.

Packing items of a class into containers A huge item is packed alone into its container. For a class of small items we have some predetermined cardinalities (called types) for containers of the class: Each such cardinality has a fixed proportion. We try to pack the next item into existing container (if there is one with room for more items). If all existing containers are full, we open a new container and decide its type (based on the proportions) and pack the new item there. For the class of tiny items, we apply similar methods but here the types of containers are defined based on the total size of items.

Packing large items into containers For a class of large items we have four types: A regular type 2 container that already contains two items of the class. A declared type 2 container that currently contains one item but AH has decided to have two items there. We have only a constant number of such containers. A regular type 1 container that has one item and cannot get more items later. A temporary type 1 container that has one item and perhaps will get another one later. We fix the proportion of the total number of regular type 1 and temporary type 1 containers but not of a single type among these types. If we need to increase the number of type 2 containers by changing one of the temporary type 1 containers into type 2, we pack the new item into a container with the largest item that was in a temporary type 1 container. If a new type 1 container for the item is needed and we will open a new bin for it, then this container is a temporary type 1.

Matching containers into bins A volume of a container is: The size of a unique item in the container if it has only one item. The upper bound on the total size of items that can fit into this type of containers if it may have more than one item. Special rules for large items: A temporary type 1 has volume equal to the size of the item, a declared type 2 has volume like regular type 2. Two containers fit into a bin if their total volume is at most 1. We try to fit one container of volume larger than ½ with one container of volume at most ½ (but not several containers with volume smaller than ½). We break ties in favor of matching a new container with the largest container that fits. We define a finer tie-breaking rule to ease the formal analysis.

Analysis – scenario set Let a be the smallest volume of unmatched container that is > ½. The scenario index is the class containing the value 1-a. Required weight of a container (for a given scenario): 1 for a container with volume ≥ a. w (decision variable) for a container with volume in (1/2,a]. 1 for a container with volume in (1-a,1/2]. 1-w for a container with volume at most 1-a.

Assigning weights to items Huge item: weight = required weight of its container. The general rule: The weight of a small or large item is the ratio between the average required weights of the containers (of its class) and the average cardinality of these containers. A similar rule for tiny items. A special case for large items of a class containing 1-a. For such an item its weight is u if its size is at most 1-a and v otherwise (u and v are decision variables).

The analysis (cont.) Based on the numerical values of u,v,w, the weight function is well defined. We prove that if we impose a (small number of) linear inequalities on u,v,w, then this weight function is valid. Analytic proof showing that these linear inequalities ensure that (after ignoring a constant number of bins) the average total weight of items in a bin of AH is at least 1. We still prefer to use values of u,v,w for which the resulting provable comp. ratio is as small as possible.

The analysis – final steps We select the values of u,v,w for each scenario using a linear programming solver (but this is not needed for the proof). We use an optimal (exact) algorithm for the knapsack problem to bound the total weight of items that fit into a bin. This part of the proof is computer-assisted. The resulting overall (over all scenarios) upper bound on the total weight that fit into a bin is 1.57829.

Questions