© 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.

Slides:



Advertisements
Similar presentations
NP-Completeness.
Advertisements

 Review: The Greedy Method
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.
Tournament Trees CSE, POSTECH.
The Theory of NP-Completeness
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
© The McGraw-Hill Companies, Inc., Chapter 8 The Theory of NP-Completeness.
Combinatorial Algorithms
CS774. Markov Random Field : Theory and Application Lecture 17 Kyomin Jung KAIST Nov
PTAS for Bin-Packing. Special Cases of Bin Packing 1. All item sizes smaller than Claim 1: Proof: If then So assume Therefore:
Complexity 16-1 Complexity Andrei Bulatov Non-Approximability.
Windows Scheduling Problems for Broadcast System 1 Amotz Bar-Noy, and Richard E. Ladner Presented by Qiaosheng Shi.
Introduction to Approximation Algorithms Lecture 12: Mar 1.
Approximation Algorithms: Combinatorial Approaches Lecture 13: March 2.
Tirgul 10 Rehearsal about Universal Hashing Solving two problems from theoretical exercises: –T2 q. 1 –T3 q. 2.
The Theory of NP-Completeness
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
Chapter 11: Limitations of Algorithmic Power
1 Combinatorial Dominance Analysis Keywords: Combinatorial Optimization (CO) Approximation Algorithms (AA) Approximation Ratio (a.r) Combinatorial Dominance.
9-1 Chapter 9 Approximation Algorithms. 9-2 Approximation algorithm Up to now, the best algorithm for solving an NP-complete problem requires exponential.
Chapter 11 Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Solution methods for Discrete Optimization Problems.
Approximation Algorithms Motivation and Definitions TSP Vertex Cover Scheduling.
Approximation 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.
© 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.
Programming & Data Structures
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
Chapter 11 Limitations of Algorithm Power. Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples:
CSCE350 Algorithms and Data Structure
Computational Complexity Polynomial time O(n k ) input size n, k constant Tractable problems solvable in polynomial time(Opposite Intractable) Ex: sorting,
Approximation Algorithms Department of Mathematics and Computer Science Drexel University.
Chapter 12 Coping with the Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
1 The Theory of NP-Completeness 2012/11/6 P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class of decision.
Why is bin packing interesting?
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.
Presented by Dajiang Zhu 09/20/2011.  Motivation  Introduction & Conclusion  Pre – Definition Approximation Algorithms  Two problems as examples SUBSET-SUM.
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
Great Theoretical Ideas in Computer Science.
Chapter 15 Approximation Algorithm Introduction Basic Definition Difference Bounds Relative Performance Bounds Polynomial approximation Schemes Fully Polynomial.
Packing Rectangles into Bins Nikhil Bansal (CMU) Joint with Maxim Sviridenko (IBM)
TECH Computer Science NP-Complete Problems Problems  Abstract Problems  Decision Problem, Optimal value, Optimal solution  Encodings  //Data Structure.
Approximation Algorithms
1 Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples: b number of comparisons needed to find the.
Princeton University COS 423 Theory of Algorithms Spring 2001 Kevin Wayne Approximation Algorithms These lecture slides are adapted from CLRS.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
Although this may seem a paradox, all exact science is dominated by the idea of approximation. Bertrand Russell Approximation Algorithm.
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
Chapter 18: Searching and Sorting Algorithms. Objectives In this chapter, you will: Learn the various search algorithms Implement sequential and binary.
Unit 9: Coping with NP-Completeness
LIMITATIONS OF ALGORITHM POWER
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.
Big O David Kauchak cs302 Spring Administrative Assignment 1: how’d it go? Assignment 2: out soon… Lab code.
1 The Theory of NP-Completeness 2 Review: Finding lower bound by problem transformation Problem X reduces to problem Y (X  Y ) iff X can be solved by.
Errol Lloyd Design and Analysis of Algorithms Approximation Algorithms for NP-complete Problems Bin Packing Networks.
TU/e Algorithms (2IL15) – Lecture 11 1 Approximation Algorithms.
Computability and Complexity
Analysis and design of algorithm
k-center Clustering under Perturbation Resilience
Richard Anderson Lecture 28 Coping with NP-Completeness
A new and improved algorithm for online bin packing
PTAS for Bin-Packing.
Chapter 11 Limitations of Algorithm Power
Integer Programming (정수계획법)
ICS 353: Design and Analysis of Algorithms
Clustering.
CSC 380: Design and Analysis of Algorithms
The Complexity of Approximation
Bin Packing Michael T. Goodrich Some slides adapted from slides from
Presentation transcript:

© 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 Traveling Salesman Problem David S. Johnson AT&T Labs – Research

Applications Packing commercials into station breaks Packing files onto floppy disks (CDs, DVDs, etc.) Packing MP3 songs onto CDs Packing IP packets into frames, SONET time slots, etc. Packing telemetry data into fixed size packets Standard Drawback: Bin Packing is NP-complete

NP-Hardness Means that optimal packings cannot be constructed in worst-case polynomial time unless P = NP. In which case, all other NP-hard problems can also be solved in polynomial time: – Satisfiability – Clique – Graph coloring – Etc. See M.R. Garey & D.S.Johnson, Computers and Intractability: A Guide to the Theory of NP- Completeness, W.H.Freeman, 1979.

Standard Approach to Coping with NP-Hardness: Approximation Algorithms – Run quickly (polynomial-time for theory, low-order polynomial time for practice) – Obtain solutions that are guaranteed to be close to optimal

First Fit (FF): Put each item in the first bin with enough space Best Fit (BF): Put each item in the bin that will hold it with the least space left over First Fit Decreasing, Best Fit Decreasing (FFD,BFD): Start by reordering the items by non-increasing size. 

Worst-Case Bounds Theorem [Ullman, 1971][Johnson et al.,1974]. For all lists L, BF(L), FF(L) ≤ (17/10)OPT(L) + 3. Theorem [Johnson, 1973]. For all lists L, BFD(L), FFD(L) ≤ (11/9)OPT(L) + 4. (Note 1: 11/9 = …) (Note 2: These bounds are asymptotically tight.)

Lower Bounds: FF and BF ½ +  ½ -  OPT: N bins ½ -  ½ +  FF, BF: N/2 bins + N bins = 1.5 OPT

Lower Bounds: FF and BF 1/2 +  1/3 +  OPT: N bins ½ +  FF, BF: N/6 bins + N/2 bins + N bins = 5/3 OPT 1/6 - 2  1/3 + 

Lower Bounds: FF and BF 1/2 +  1/3 +  OPT: N bins 1/7 +  1/ , etc. 1/43 + , FF, BF = N(1 + 1/2 + 1/6 + 1/42 + 1/ … )  ( ) OPT

Jeff Ullman’s Idea 1/2 +  1/3 +  OPT: N bins 1/6 +  FF, BF = N (1 + 1/2 + 1/5) = (17/10) OPT Key modification: Replace some 1/3 +  ’s & 1/6+  ’s with 1/3-  i & 1/6+  i, and some with 1/3+  i & 1/6-  i, with  i increasing from bin to bin. (Actually yields FF, BF ≥ (17/10)OPT - 2 See References for details.)

Lower Bounds: FFD and BFD ½ +  1/4-2  1/4+  ½ +  1/4+  1/4-2  1/4+2  6n bins 3n bins 6n bins 2n bins 3n bins OPT = 9n FFD, BFD = 11n

Asymptotic Worst-Case Ratios R N (A) = max{A(I)/OPT(I): OPT(I) = N} R(A) = max{R N (A): N > 0} – absolute worst-case ratio R ∞ (A) = limsup N  ∞ R N (A) – asymptotic worst-case ratio Theorem: R ∞ (FF) = R ∞ (BF) = 17/10. Theorem: R ∞ (FFD) = R ∞ (BFD) = 11/9.

Why Asymptotics? Partition Problem: Given a set X of numbers x i, can they be partitioned into two subsets with the sums (  x  X x)/2? This problem is NP-hard, and is equivalent to the special case of bin packing in which we ask if OPT = 2. Hence, assuming P  NP, no polynomial- time bin packing algorithm can have R(A) < 3/2.

Online Algorithms We have no control over the order in which items arrive. Each time an item arrives, we must assign it to a bin before knowing anything about what comes later. Examples: FF and BF Simplest example: Next Fit (NF) – Start with an empty bin – If the next item to be packed does not fit in the current bin, put it in a new bin, which now becomes the “current” bin. Problem 1: Prove R ∞ (NF) = 2.

Best Possible Online Algorithms Theorem [van Vliet, 1996]. For any online bin packing algorithm A, R ∞ (A) ≥ Theorem [Richey, 1991]. There exist polynomial-time online algorithms A with R ∞ (A) ≤ Drawback: Improving the worst-case behavior of online algorithms tends to guarantee that their average-case behavior will not be much better. FF and BF are much better on average than they are in the worst case.

Best Possible Offline Algorithm? Theorem [Karmarkar & Karp, 1982]. There is a polynomial-time (offline) bin packing algorithm KK that guarantees KK(L) ≤ OPT(L) + log 2 (OPT(L)). Corollary. R ∞ (KK) = 1. Drawback: Whereas FFD and BFD can be implemented to run in time O(NlogN), the best bound we have on the running time of KK is O(N 8 log 3 N). Still open: Is there a polynomial-time bin packing algorithm A that guarantees A(L) ≤ OPT(L) + c for any fixed constant c?

The Traveling Salesman Problem Given: Set of cities {c 1,c 2,…,c N }. For each pair of cities {c i,c j }, a distance d(c i,c j ). Find: Permutation that minimizes

Put the unfilled bins in a binary search tree, ordered by the size of their unused space (choosing a data structure that implements inserts and deletes in time O(logN)). Implementing Best Fit Bin Index Gap Size Bin with smaller gap Bin with larger gap

Implementing Best Fit When an item x arrives, the initial “current node” is the root of the tree. While the item x is not yet packed, – If x fits in the current node’s gap If x fits in the gap of the node’s left child, let that node become the current node. Otherwise, pack x in the current node’s bin, and reinsert that bin into the tree with its new gap. – Otherwise, If the current node has a right child, let that become the current node. Otherwise, pack x in a new bin, and add that to the tree.

Implementing First Fit New tree data structure: – The bins of the packing are the leaves, in their original order. – Each node contains the maximum gap in bins under it ●●●

To Be Continued… Next time: Average-Case Behavior For now: On to the TSP!