Why is bin packing interesting?

Slides:



Advertisements
Similar presentations
Weighted Matching-Algorithms, Hamiltonian Cycles and TSP
Advertisements

Online Algorithm Huaping Wang Apr.21
Tight Bounds for Online Class- constrained Packing Hadas Shachnai Bell Labs and The Technion IIT Tami Tamir The Technion IIT.
Planar point location -- example
Counting the bits Analysis of Algorithms Will it run on a larger problem? When will it fail?
Dynamic Planar Convex Hull Operations in Near- Logarithmic Amortized Time TIMOTHY M. CHAN.
Theory of Computing Lecture 3 MAS 714 Hartmut Klauck.
Online Scheduling with Known Arrival Times Nicholas G Hall (Ohio State University) Marc E Posner (Ohio State University) Chris N Potts (University of Southampton)
Princeton University COS 423 Theory of Algorithms Spring 2001 Kevin Wayne Competitive Analysis.
Dynamic All Pairs Shortest Paths Based on the following resources: Camil Demetrescu and Giuseppe F. Italiano (2004) A New Approach to Dynamic All Pairs.
Lecture 12: Lower bounds By "lower bounds" here we mean a lower bound on the complexity of a problem, not an algorithm. Basically we need to prove that.
B+-Trees (PART 1) What is a B+ tree? Why B+ trees? Searching a B+ tree
CPSC 689: Discrete Algorithms for Mobile and Wireless Systems Spring 2009 Prof. Jennifer Welch.
PCPs and Inapproximability Introduction. My T. Thai 2 Why Approximation Algorithms  Problems that we cannot find an optimal solution.
PTAS for Bin-Packing. Special Cases of Bin Packing 1. All item sizes smaller than Claim 1: Proof: If then So assume Therefore:
Greedy vs Dynamic Programming Approach
Errol Lloyd Design and Analysis of Algorithms Approximation Algorithms for NP-complete Problems Bin Packing Computer Networks.
Multiversion Access Methods - Temporal Indexing. Basics A data structure is called : Ephemeral: updates create a new version and the old version cannot.
Temporal Indexing MVBT. Temporal Indexing Transaction time databases : update the last version, query all versions Queries: “Find all employees that worked.
Temporal Indexing MVBT. Temporal Indexing Transaction time databases : update the last version, query all versions Queries: “Find all employees that worked.
Tirgul 8 Universal Hashing Remarks on Programming Exercise 1 Solution to question 2 in theoretical homework 2.
Polynomial time approximation scheme Lecture 17: Mar 13.
1 Discrete Mathematics Summer 2004 By Dan Barrish-Flood originally for Fundamental Algorithms For use by Harper Langston in D.M.
Tirgul 4 Order Statistics Heaps minimum/maximum Selection Overview
Approximation Algorithms
Minimizing Flow Time on Multiple Machines Nikhil Bansal IBM Research, T.J. Watson.
Improved results for a memory allocation problem Rob van Stee University of Karlsruhe Germany Leah Epstein University of Haifa Israel WADS 2007 WAOA 2007.
© 2010 AT&T Intellectual Property. All rights reserved. AT&T and the AT&T logo are trademarks of AT&T Intellectual Property. Bin Packing: From Theory to.
Scott Perryman Jordan Williams.  NP-completeness is a class of unsolved decision problems in Computer Science.  A decision problem is a YES or NO answer.
1 Chapter 24 Developing Efficient Algorithms. 2 Executing Time Suppose two algorithms perform the same task such as search (linear search vs. binary search)
Approximation schemes Bin packing problem. Bin Packing problem Given n items with sizes a 1,…,a n  (0,1]. Find a packing in unit-sized bins that minimizes.
© 2009 IBM Corporation 1 Improving Consolidation of Virtual Machines with Risk-aware Bandwidth Oversubscription in Compute Clouds Amir Epstein Joint work.
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 19: Searching and Sorting Algorithms.
Analysis of Algorithms
Chapter 19: Searching and Sorting Algorithms
Approximation Algorithms for Knapsack Problems 1 Tsvi Kopelowitz Modified by Ariel Rosenfeld.
Scheduling policies for real- time embedded systems.
© 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.
Packing Rectangles into Bins Nikhil Bansal (CMU) Joint with Maxim Sviridenko (IBM)
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.
Simple Iterative Sorting Sorting as a means to study data structures and algorithms Historical notes Swapping records Swapping pointers to records Description,
Topic 25 Dynamic Programming "Thus, I thought dynamic programming was a good name. It was something not even a Congressman could object to. So I used it.
Chapter 18: Searching and Sorting Algorithms. Objectives In this chapter, you will: Learn the various search algorithms Implement sequential and binary.
Jennifer Campbell November 30,  Problem Statement and Motivation  Analysis of previous work  Simple - competitive strategy  Near optimal deterministic.
AVL Trees 1. 2 Outline Background Define balance Maintaining balance within a tree –AVL trees –Difference of heights –Rotations to maintain balance.
1 Chapter 5-1 Greedy Algorithms Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
© The McGraw-Hill Companies, Inc., Chapter 12 On-Line Algorithms.
Searching and Sorting Searching: Sequential, Binary Sorting: Selection, Insertion, Shell.
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 Windows Scheduling as a Restricted Version of Bin-packing. Amotz Bar-Noy Brooklyn College Richard Ladner Tami Tamir University of Washington.
1. Searching The basic characteristics of any searching algorithm is that searching should be efficient, it should have less number of computations involved.
1 Ch. 2: Getting Started. 2 About this lecture Study a few simple algorithms for sorting – Insertion Sort – Selection Sort (Exercise) – Merge Sort Show.
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.
Big O David Kauchak cs302 Spring Administrative Assignment 1: how’d it go? Assignment 2: out soon… Lab code.
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.
Chapter 15 Running Time Analysis. Topics Orders of Magnitude and Big-Oh Notation Running Time Analysis of Algorithms –Counting Statements –Evaluating.
Errol Lloyd Design and Analysis of Algorithms Approximation Algorithms for NP-complete Problems Bin Packing Networks.
CSC317 Selection problem q p r Randomized‐Select(A,p,r,i)
Approximation Algorithms for NP-complete Problems
Static Optimality and Dynamic Search Optimality in Lists and Trees
Algorithm design and Analysis
Dynamic and Online Algorithms for Set Cover
A new and improved algorithm for online bin packing
PTAS for Bin-Packing.
György Dósa, University of Pannonia, Veszprém, Hungary
Greedy Algorithms / Caching Problem Yin Tat Lee
Greedy Algorithms Alexandra Stefan.
György Dósa – M. Grazia Speranza – Zsolt Tuza:
The Selection Problem.
Bin Packing Michael T. Goodrich Some slides adapted from slides from
Presentation transcript:

Why is bin packing interesting? Simplest version of industrial packing problems Cutting stock allocation problem CD allocation problem (floppy disk allocation problem) Layouts on VLSI chips (2D version) Assigning commercials to station breaks (easier) Packing trucks within a given weight limit The problem we consider is topology control in ad hoc networks. So, what is an ad hoc network? An ad hoc network is a collection of nodes[click] that communicate with one other over [click] wireless medium. When the destination node can not be reached directly by the source, the nodes in the middle can act as routers to forward the transmission. Such networks require no fixed infrastructure, so can be quick deployed. it has application in battle field communication, disaster recovery, sensors networks, etc. Classic combinatorial optimization problem Research dates back to the 1940s In the mid 80’s labeled “The problem that wouldn’t go away” Subject of research on approximations before approximations were cool

First Fit Decreasing Sort the items in decreasing order by size Open one bin for each item Si if there is an open bin where Si will fit then place Si into the leftmost such bin else open a new bin place Si into that new bin .75 .67 .5 .4 .4 .33 .3 .25 .2 .2 .2 .25 .33 .4 .3 Absolute performance ratio of FFD is 3/2, and asymptotic performance ratio is 11/9 .75 .67 .5 .4 .2 FFD < 11/9 OPT + 4 (i.e. 1.2222…) Running Time: O(n log n) [Johnson, Demers, Ullman, Garey, Graham, 1974] Loooooooooong proof (originally 100+ pages)

More on First Fit Decreasing Why does FFD have such an improved performance ratio? Pack the trouble items first (big items) Pack the easier items later (small items) Can we do better than FFD? Modified First Fit Decreasing [Johnson & Garey, 1985] Like FFD, but with special handling for items in (1/6, 1/3] Competitive ratio: 71/60 = 1.18333… Running Time: O(n log n)

Summary Method Competitive Ratio Any Fit 2 Next Fit 2 Worst Fit 2 First Fit 1.7 Best Fit 1.7 FFD 1.2222… * Modified FFD 1.18333… * Fully polynomial time approximation scheme YES * * = asymptotic competitive ratios (vs absolute competitive ratios) For all L, A(L) <= Ratio(A)*OPT(L) + KA(L) where KA(L) = o(OPT(L)) The problem we consider is topology control in ad hoc networks. So, what is an ad hoc network? An ad hoc network is a collection of nodes[click] that communicate with one other over [click] wireless medium. When the destination node can not be reached directly by the source, the nodes in the middle can act as routers to forward the transmission. Such networks require no fixed infrastructure, so can be quick deployed. it has application in battle field communication, disaster recovery, sensors networks, etc.

Changing the Rules – Fully Dynamic Bin Packing NOT given the items all at once Instead: given items one at a time – INSERTs (DELETES) Upon an INSERT/DELETE, update the packing NO apriori limitations on this update – the contents of the bins may be changed at will .5 .67 .25 .33 Maintain a good packing at all times O(log n) time per INSERT/DELETE (to update) So, n INSERTs in O(n log n) time

Distinct from Off-line, On-Line, Dynamic BP Off-line bin packing – given all items at once, process & pack (FFD, MFFD, PTAS) On-line bin packing – given items one at a time (INSERTS), and must pack immediately, but cannot move already packed items On-line Algorithms Any Fit, Next Fit 2 First Fit, Best Fit 1.7 Harmonic++ 1.58889 [Seiden, 2001] Lower bound 1.54014 [van Vliet, 1992]

Distinct from Off-line, On-Line, Dynamic BP Variant of On-line bin packing [Gambosi, etal, 1990]– INSERTs only, each item may be moved a constant number of times Algorithm A: Competitive ratio: 3/2 Running time: O(n) Algorithm B: Competitive ratio: 4/3 Running time: O(n log n) Dynamic bin packing [Coffman, Garey & Johnson, 1983] – INSERT & DELETE items, but items cannot be moved once packed 2.770 < Dynamic First Fit < 2.898 Lower bound: 2.5

Return to Fully Dynamic Bin Packing NOT given the items all at once Instead: given items one at a time – INSERTS Upon an INSERT, update the packing NO apriori limitations on this update – the contents of the bins may be changed at will Maintain a good packing at all times O(log n) time per INSERT (to update) So, n INSERTs in O(n log n) time

A first attempt: Fully Dynamic FFD? Recall FFD Preprocess by sorting items First Fit pack the items Making FFD fully dynamic After each INSERT Update the sorting in O(log n) – OK! Update the packing May need to completely redo the packing  O(n log n) per INSERT – that’s bad!

Another off-line algo: First Fit Grouped Groups of items: BIG – contains items of size (1/2, 1] LARGE – contains items of size (1/3, 1/2] Small – contains items of size (1/4, 1/3] tiny – contains items of size (0, 1/4] First Fit Grouped (FFG) Algorithm: Place each item into its group Pack the items in BIG using first fit Pack the items in LARGE using first fit Pack the items in Small using first fit Pack the items in tiny using First Fit The problem we consider is topology control in ad hoc networks. So, what is an ad hoc network? An ad hoc network is a collection of nodes[click] that communicate with one other over [click] wireless medium. When the destination node can not be reached directly by the source, the nodes in the middle can act as routers to forward the transmission. Such networks require no fixed infrastructure, so can be quick deployed. it has application in battle field communication, disaster recovery, sensors networks, etc.

FFG – An example .5 .67 .25 .33 .4 .2 .2 .4 .75 .3 .67 .75 .5 .4 .4 .3 .33 .25 .2 .2 BIG LARGE Small tiny The problem we consider is topology control in ad hoc networks. So, what is an ad hoc network? An ad hoc network is a collection of nodes[click] that communicate with one other over [click] wireless medium. When the destination node can not be reached directly by the source, the nodes in the middle can act as routers to forward the transmission. Such networks require no fixed infrastructure, so can be quick deployed. it has application in battle field communication, disaster recovery, sensors networks, etc. [Johnson, 1974] Running Time: O(n log n) Competitive Ratio of FFG: 4/3 First Fit: 1.7 FFD: 11/9

Fully Dynamic First Fit Grouped Item I puts on glasses & what does it see? if I is tiny , then I sees everything if I is Small, then I sees only the BIG, LARGE and Small items if I is LARGE , then I sees only the BIG and LARGE items if I is BIG , then I sees only the BIG items The problem we consider is topology control in ad hoc networks. So, what is an ad hoc network? An ad hoc network is a collection of nodes[click] that communicate with one other over [click] wireless medium. When the destination node can not be reached directly by the source, the nodes in the middle can act as routers to forward the transmission. Such networks require no fixed infrastructure, so can be quick deployed. it has application in battle field communication, disaster recovery, sensors networks, etc. These are “myopic” glasses!

What items “see” Tiny items see: The problem we consider is topology control in ad hoc networks. So, what is an ad hoc network? An ad hoc network is a collection of nodes[click] that communicate with one other over [click] wireless medium. When the destination node can not be reached directly by the source, the nodes in the middle can act as routers to forward the transmission. Such networks require no fixed infrastructure, so can be quick deployed. it has application in battle field communication, disaster recovery, sensors networks, etc.

Fully Dynamic First Fit Grouped To process INSERT of item I (assume partial packing exists) I puts on (myopic) glasses Item I packs itself in the packing it sees (smaller items are evicted from the bin I goes into) Refill the bin that I goes into using: Smaller evicted items Smaller items in “inferior” bins (ie largest bin item is in a smaller group than I) If an inferior bin is disturbed, evict all remaining items Repack evicted items using recursion The problem we consider is topology control in ad hoc networks. So, what is an ad hoc network? An ad hoc network is a collection of nodes[click] that communicate with one other over [click] wireless medium. When the destination node can not be reached directly by the source, the nodes in the middle can act as routers to forward the transmission. Such networks require no fixed infrastructure, so can be quick deployed. it has application in battle field communication, disaster recovery, sensors networks, etc.

An example of FDFFG Existing packing: That item First Fit packs itself into the second bin: Unpacked items: .35, .35, .30 The problem we consider is topology control in ad hoc networks. So, what is an ad hoc network? An ad hoc network is a collection of nodes[click] that communicate with one other over [click] wireless medium. When the destination node can not be reached directly by the source, the nodes in the middle can act as routers to forward the transmission. Such networks require no fixed infrastructure, so can be quick deployed. it has application in battle field communication, disaster recovery, sensors networks, etc. Refill the second bin with the .30 item: Unpacked items: .35, .35

FDFFG Example - continued It packs into 3rd bin, as does other .35 and then .30 item: Unpacked items: .30, .25 The problem we consider is topology control in ad hoc networks. So, what is an ad hoc network? An ad hoc network is a collection of nodes[click] that communicate with one other over [click] wireless medium. When the destination node can not be reached directly by the source, the nodes in the middle can act as routers to forward the transmission. Such networks require no fixed infrastructure, so can be quick deployed. it has application in battle field communication, disaster recovery, sensors networks, etc.

FDFFG Example – still continued … The .30 item sees this packing: That .30 item packs into 4th bin & two .25 items refill that bin: The problem we consider is topology control in ad hoc networks. So, what is an ad hoc network? An ad hoc network is a collection of nodes[click] that communicate with one other over [click] wireless medium. When the destination node can not be reached directly by the source, the nodes in the middle can act as routers to forward the transmission. Such networks require no fixed infrastructure, so can be quick deployed. it has application in battle field communication, disaster recovery, sensors networks, etc. The remaining two .25 items pack themselves into a 5th bin

Performance of FDFFG Key elements of FDFFG Competitive Ratio: 4/3 (same as FFG) Running Time: O(log n) per INSERT Key elements of FDFFG Evicted items are smaller than the inserted item “bundle” tiny items and move as a unit* Thus: Relatively few items/bundles will be evicted (hence, repacked) * Is this cheating? (no – will say why later) The problem we consider is topology control in ad hoc networks. So, what is an ad hoc network? An ad hoc network is a collection of nodes[click] that communicate with one other over [click] wireless medium. When the destination node can not be reached directly by the source, the nodes in the middle can act as routers to forward the transmission. Such networks require no fixed infrastructure, so can be quick deployed. it has application in battle field communication, disaster recovery, sensors networks, etc.

O(n log n) for sequence of n INSERT/DELETEs Can we do better than 4/3? Yes: Mostly Myopic Packing (MMP) Key: Avoid bad cases of FDFFG via special handling MMP Competitive Ratio: 5/4 = 1.25 Looong proof MMP running time: O(log n) per INSERT or DELETE O(n log n) for sequence of n INSERT/DELETEs The problem we consider is topology control in ad hoc networks. So, what is an ad hoc network? An ad hoc network is a collection of nodes[click] that communicate with one other over [click] wireless medium. When the destination node can not be reached directly by the source, the nodes in the middle can act as routers to forward the transmission. Such networks require no fixed infrastructure, so can be quick deployed. it has application in battle field communication, disaster recovery, sensors networks, etc.

Mostly Myopic Packing Same general approach as FDFFG Much more complicated than FDFFG Introduce: miniscule items: (0, 1/5] tiny items: (1/5, 1/4] Carry over: myopic glasses bundle miniscule (not tiny) - size (1/10,1/5] Introduce: coalitions! Prior to putting on glasses, L & S items try to form LLS-coalitions Constant number of items/bundles “touched” per INSERT Each “touch” costs O(log n) Thus, O(log n) per INSERT (DELETE) The problem we consider is topology control in ad hoc networks. So, what is an ad hoc network? An ad hoc network is a collection of nodes[click] that communicate with one other over [click] wireless medium. When the destination node can not be reached directly by the source, the nodes in the middle can act as routers to forward the transmission. Such networks require no fixed infrastructure, so can be quick deployed. it has application in battle field communication, disaster recovery, sensors networks, etc.

The 5/4 Competitive Ratio (the 2% sketch) Analyze the structure of the MMP and OPT packings Focus on 8 types of “front” bins: B-bins, LLS, LSTT Lower bound the LLS-bins in MMP relative to OPT MMPLLS ≥ 1/4(OPTLLS – (L7+S7)) + OPTLSTT – max(L8,S8) - 1 Lower bound the L, S and T-items in B-bins in MMP Allows upper bound on number of items in “back” bins in MMP relative to the number in OPT The packings In OPT: B OPTLLS + OPTLSTT OPTBACK In MMP: B MMPLLS MMPBACK put bounds together to yield the 5/4 bound The problem we consider is topology control in ad hoc networks. So, what is an ad hoc network? An ad hoc network is a collection of nodes[click] that communicate with one other over [click] wireless medium. When the destination node can not be reached directly by the source, the nodes in the middle can act as routers to forward the transmission. Such networks require no fixed infrastructure, so can be quick deployed. it has application in battle field communication, disaster recovery, sensors networks, etc.

What about that possible “cheating”? Theorem: If A is a fully dynamic bin packing algorithm moving at most a fixed (i.e. constant) number of items per INSERT/DELETE Then the competitive ratio of A is at least 4/3 Implication: “bundling” (or similar), is necessary to do better than 4/3 The problem we consider is topology control in ad hoc networks. So, what is an ad hoc network? An ad hoc network is a collection of nodes[click] that communicate with one other over [click] wireless medium. When the destination node can not be reached directly by the source, the nodes in the middle can act as routers to forward the transmission. Such networks require no fixed infrastructure, so can be quick deployed. it has application in battle field communication, disaster recovery, sensors networks, etc.

Partially dynamic bin packing INSERTs only, packing can be rearranged For any  > 0 there are algorithms with: Competitive ratio 1 +  Running time O(log n) amortized per INSERT (PTAS) Running time O(log2 n) amortized per INSERT (FPTAS) What about uniform running times for INSERT only? MMP is the best we know: competitive ratio 5/4 running time O(log n) per INSERT The problem we consider is topology control in ad hoc networks. So, what is an ad hoc network? An ad hoc network is a collection of nodes[click] that communicate with one other over [click] wireless medium. When the destination node can not be reached directly by the source, the nodes in the middle can act as routers to forward the transmission. Such networks require no fixed infrastructure, so can be quick deployed. it has application in battle field communication, disaster recovery, sensors networks, etc.

Related papers Z. Ivkovich and E.L. Lloyd, "Fully dynamic algorithms for bin packing: Being mostly myopic helps," SIAM Journal on Computing, 28(1998), 574-611. Z. Ivkovich and E.L. Lloyd, "Partially dynamic bin packing can be solved within 1+e in (amortized) polylogarithmic time", Information Processing Letters 63(1997), 45-50. Z. Ivkovich and E.L. Lloyd, "A fundamental restriction on fully dynamic maintenance of bin packing," Information Processing Letters, 59(1996), 229-232.