请输入您要查询的百科知识:

 

词条 Bin packing problem
释义

  1. Formal statement

  2. First-fit algorithm

  3. Analysis of approximate algorithms

  4. Exact algorithm

  5. See also

  6. References

  7. External links

{{Covering/packing-problem pairs}}

In the bin packing problem, objects of different volumes must be packed into a finite number of bins or containers each of volume V in a way that minimizes the number of bins used. In computational complexity theory, it is a combinatorial NP-hard problem.[1] The decision problem (deciding if objects will fit into a specified number of bins) is NP-complete.[2]

There are many variations of this problem, such as 2D packing, linear packing, packing by weight, packing by cost, and so on. They have many applications, such as filling up containers, loading trucks with weight capacity constraints, creating file backups in media and technology mapping in field-programmable gate array semiconductor chip design.

The bin packing problem can also be seen as a special case of the cutting stock problem. When the number of bins is restricted to 1 and each item is characterised by both a volume and a value, the problem of maximising the value of items that can fit in the bin is known as the knapsack problem.

Despite the fact that the bin packing problem has an NP-hard computational complexity, optimal solutions to very large instances of the problem can be produced with sophisticated algorithms. In addition, many heuristics have been developed: for example, the first fit algorithm provides a fast but often non-optimal solution, involving placing each item into the first bin in which it will fit. It requires Θ(n log n) time, where n is the number of elements to be packed. The algorithm can be made much more effective by first sorting the list of elements into decreasing order (sometimes known as the first-fit decreasing algorithm), although this still does not guarantee an optimal solution, and for longer lists may increase the running time of the algorithm. It is known, however, that there always exists at least one ordering of items that allows first-fit to produce an optimal solution.[3]

A variant of bin packing that occurs in practice is when items can share space when packed into a bin. Specifically, a set of items could occupy less space when packed together than the sum of their individual sizes. This variant is known as VM packing[4] since when virtual machines (VMs) are packed in a server, their total memory requirement could decrease due to pages shared by the VMs that need only be stored once. If items can share space in arbitrary ways, the bin packing problem is hard to even approximate. However, if the space sharing fits into a hierarchy, as is the case with memory sharing in virtual machines, the bin packing problem can be efficiently approximated.

Another variant of bin packing of interest in practice is the so-called online bin packing. Here the objects of different volume are supposed to arrive sequentially and the decision maker has to decide whether to select and pack the currently observed item, or else to let it pass. Each decision is without recall.

Formal statement

Given a set of bins with the same size and a list of items with sizes to pack, find an integer number of bins and a -partition of the set such that for all A solution is optimal if it has minimal . The -value for an optimal solution is denoted OPT below. A possible Integer Linear Programming formulation of the problem is:

minimize
subject to

where if bin is used and if item is put into bin .[5]

First-fit algorithm

This is a straightforward greedy approximation algorithm. The algorithm processes the items in arbitrary order. For each item, it attempts to place the item in the first bin that can accommodate the item. If no bin is found, it opens a new bin and puts the item within the new bin.

This algorithm achieves an approximation factor of 2; the number of bins used by this algorithm is no more than twice the optimal number of bins. In other words, it is impossible for 2 bins to be at most half full because such a possibility implies that at some point, exactly one bin was at most half full and a new one was opened to accommodate an item of size at most V/2. But since the first one has at least a space of V / 2, the algorithm will not open a new bin for any item whose size is at most V / 2. Only after the bin fills with more than V / 2 or if an item with a size larger than V / 2 arrives, the algorithm may open a new bin.

Thus if we have B bins, at least B − 1 bins are more than half full. Therefore, . Because is a lower bound of the optimum value OPT, we get that B − 1 < 2OPT and therefore B ≤ 2OPT.[6] See the analysis below for better approximation results.

Modified first fit decreasing (MFFD)[7] improves on FFD for items larger than half a bin by classifying items by size into four size classes large, medium, small, and tiny, corresponding to items with size > 1/2 bin, > 1/3 bin, > 1/6 bin, and smaller items respectively. Then it proceeds through five phases:

  1. Allot a bin for each large item, ordered largest to smallest.
  2. Proceed forward through the bins. On each: If the smallest remaining medium item does not fit, skip this bin. Otherwise, place the largest remaining medium item that fits.
  3. Proceed backward through those bins that do not contain a medium item. On each: If the two smallest remaining small items do not fit, skip this bin. Otherwise, place the smallest remaining small item and the largest remaining small item that fits.
  4. Proceed forward through all bins. If the smallest remaining item of any size class does not fit, skip this bin. Otherwise, place the largest item that fits and stay on this bin.
  5. Use FFD to pack the remaining items into new bins.

Analysis of approximate algorithms

The best fit decreasing and first fit decreasing strategies are among the simplest heuristic algorithms for solving the bin packing problem. They have been shown to use no more than 11/9 OPT + 1 bins (where OPT is the number of bins given by the optimal solution).[8] The simpler of these, the First Fit Decreasing (FFD) strategy, operates by first sorting the items to be inserted in decreasing order by their sizes, and then inserting each item into the first bin in the list with sufficient remaining space. Sometimes, however, one does not have the option to sort the input, for example, when faced with an online bin packing problem. In 2007, it was proven that the bound 11/9 OPT + 6/9 for FFD is tight.[9] MFFD uses no more than 71/60 OPT + 1 bins[10] (i.e. bounded by about 1.18 OPT, compared to about 1.22 OPT for FFD). In 2013, Dósa and Sgall gave a tight upper bound for the first-fit (FF) strategy, showing that it never needs more than 17/10 OPT bins for any input.{{sfn|Dósa|Sgall|2013}}

Exact algorithm

Martello and Toth[11] developed an exact algorithm for the 1-D bin-packing problem, called MTP. A faster alternative is the Bin Completion algorithm proposed by Korf in 2002[12] and later improved;[13] this second paper reports the average time to solve one million instances with 80 items on a 440 MHz Sun Ultra 10 workstation was 31 ms.

A further improvement was presented by Schreiber and Korf in 2013.[14] The new Improved Bin Completion algorithm is shown to be up to five orders of magnitude faster than Bin Completion on non-trivial problems with 100 items, and outperforms the BCP (branch-and-cut-and-price) algorithm by Belov and Scheithauer on problems that have fewer than 20 bins as the optimal solution. Which algorithm performs best depends on problem properties like number of items, optimal number of bins, unused space in the optimal solution and value precision.

See also

  • If the number of bins is to be fixed or constrained, and the size of the bins is to be minimised, that is a different problem which is equivalent to the Multiprocessor scheduling problem
  • Guillotine problem
  • Packing problems
  • Partition problem
  • Subset sum problem

References

1. ^{{cite book|last1=Korte|first1=Bernhard|last2=Vygen|first2=Jens|chapter=Bin-Packing|title=Combinatorial Optimization: Theory and Algorithms|isbn=978-3-540-25684-7|series=Algorithms and Combinatorics 21|year=2006|pages=426–441|doi=10.1007/3-540-29297-7_18|publisher=Springer}}
2. ^{{cite web|title=Bin Packing|first=David Mix|last=Barrington|url=https://people.cs.umass.edu/~barring/cs311/disc/11.html|year=2006}}
3. ^{{harvnb|Lewis|2009}}
4. ^{{harvnb|Sindelar|Sitaraman|Shenoy|2011|pp=367–378}}
5. ^{{harvnb|Martello|Toth|1990|p=221}}
6. ^{{harvnb|Vazirani|2003|p=74}}.
7. ^{{harvnb|Garey|Johnson|1985|pp=65–106}}.
8. ^{{harvnb|Yue|1991|pp=321–331}}.
9. ^{{harvnb|Dósa|2007|pp=1–11}}.
10. ^{{harvnb|Yue|Zhang|1995|pp=318–330}}.
11. ^{{harvnb|Martello|Toth|1990|pp=237–240}}.
12. ^{{harvnb|Korf|2002}}
13. ^R. E. Korf (2003), An improved algorithm for optimal bin packing. Proceedings of the International Joint Conference on Artificial Intelligence, (pp. 1252–1258)
14. ^{{harvnb|Schreiber|Korf|2013}}
Bibliography
  1. {{citation

| last = Korf
| first = Richard E.
| title = A new algorithm for optimal bin packing.
| conference = AAAI-02
| year = 2002
| url = http://www.aaai.org/Papers/AAAI/2002/AAAI02-110.pdf }}
  1. {{citation

| last = Vazirani
| first = Vijay V.
| authorlink = Vijay Vazirani
| title = Approximation Algorithms
| publisher = Springer
| year = 2003
| location = Berlin
| isbn = 3-540-65367-8 }}
  1. {{citation

| last = Yue
| first = Minyi
| journal = Acta Mathematicae Applicatae Sinica
| volume = 7
|date=October 1991
| pages = 321–331
| doi = 10.1007/BF02009683
| issn = 0168-9673
| issue = 4
| title = A simple proof of the inequality FFD (L) ≤ 11/9 OPT (L) + 1, ∀L for the FFD bin-packing algorithm }}
  1. {{citation

| last = Dósa
| first = György
| chapter = The Tight Bound of First Fit Decreasing Bin-Packing Algorithm Is FFD(I)≤(11/9)OPT(I)+6/9
| title = Combinatorics, Algorithms, Probabilistic and Experimental Methodologies
| publisher = Springer Berlin / Heidelberg
| volume = 4614/2007
| year = 2007
| pages = 1–11
| isbn = 978-3-540-74449-8
| doi = 10.1007/978-3-540-74450-4
| issn = 0302-9743
| editor1-last = Chen
| editor1-first = Bo
| editor2-last = Paterson
| editor2-first = Mike
| editor3-last = Zhang
| editor3-first = Guochuan }}
  1. {{citation

| last1 = Xia
| first1 = Binzhou
| last2 = Tan
| first2 = Zhiyi
| journal = Discrete Applied Mathematics
| volume = 158
| year = 2010
| pages = 1668–1675
| doi = 10.1016/j.dam.2010.05.026
| issn = 0166-218X
| issue = 15
| title = Tighter bounds of the First Fit algorithm for the bin-packing problem}}
  1. {{citation

| last1 = Garey
| first1 = Michael R.
| authorlink1 = Michael R. Garey
| last2 = Johnson
| first2 = David S.
| authorlink2 = David S. Johnson
| journal = Journal of Complexity
| volume = 1
| year = 1985
| pages = 65–106
| doi = 10.1016/0885-064X(85)90022-6
| title = A 71/60 theorem for bin packing*1 }}
  1. {{citation

| last1 = Yue
| first1 = Minyi
| last2 = Zhang
| first2 = Lei
| journal = Acta Mathematicae Applicatae Sinica
| volume = 11
|date=July 1995
| pages = 318–330
| doi = 10.1007/BF02011198
| issn = 0168-9673
| issue = 3
| title = A simple proof of the inequality MFFD(L)≤71/60 OPT(L) + 1,L for the MFFD bin-packing algorithm }}
  1. {{citation

| last1 = Fernandez de la Vega
| first1 = W.
| last2 = Lueker
| first2 = G. S.
| journal = Combinatorica
| publisher = Springer Berlin / Heidelberg
| volume = 1
|date=December 1981
| pages = 349–355
| doi = 10.1007/BF02579456
| issn = 0209-9683
| issue = 4
| title = Bin packing can be solved within 1 + ε in linear time }}
  1. {{citation

| last = Lewis
| first = R.
| journal = Computers and Operations Research
| volume = 36
| year = 2009
| pages = 2295–2310
| doi = 10.1016/j.cor.2008.09.004
| issue = 7
| title = A General-Purpose Hill-Climbing Method for Order Independent Minimum Grouping Problems: A Case Study in Graph Colouring and Bin Packing }}
  1. {{citation

| first1=Silvano
| last1=Martello
| first2=Paolo
| last2=Toth
| chapter = Bin-packing problem
| title=Knapsack Problems: Algorithms and Computer Implementations
| year=1990
| publisher=John Wiley and Sons
| location=Chichester, UK
| isbn=0471924202
| chapter-url=http://www.or.deis.unibo.it/kp/Chapter8.pdf }}
  1. Michael R. Garey and David S. Johnson (1979), Computers and Intractability: A Guide to the Theory of NP-Completeness. W.H. Freeman. {{ISBN|0-7167-1045-5}}. A4.1: SR1, p. 226.
  2. David S. Johnson, Alan J. Demers, Jeffrey D. Ullman, M. R. Garey, Ronald L. Graham. Worst-Case Performance Bounds for Simple One-Dimensional Packing Algorithms. SICOMP, Volume 3, Issue 4. 1974.
  3. Lodi A., Martello S., Monaci, M., Vigo, D. (2010) "Two-Dimensional Bin Packing Problems". In V.Th. Paschos (Ed.), Paradigms of Combinatorial Optimization, Wiley/ISTE, pp. 107–129
  4. {{cite conference

| last1 = Dósa
| first1 = György
| last2 = Sgall
| first2 = Jiří
| year = 2013
| title = First Fit bin packing: A tight analysis
| book-title = 30th International Symposium on Theoretical Aspects of Computer Science (STACS 2013)
| location = Dagstuhl, Germany
| url = http://drops.dagstuhl.de/opus/volltexte/2013/3963
| isbn = 978-3-939897-50-7
| pages = 538–549}}
  1. Benkő A., Dósa G., Tuza Z. (2010) "Bin Packing/Covering with Delivery, Solved with the Evolution of Algorithms," Proceedings 2010 IEEE 5th International Conference on Bio-Inspired Computing: Theories and Applications, BIC-TA 2010, art. no. 5645312, pp. 298–302.
  2. {{citation

| last1 = Sindelar
| first1 = Michael
| last2 = Sitaraman
| first2 = Ramesh
| authorlink2 = Ramesh Sitaraman
| last3 = Shenoy
| first3 = Prashant
| journal = Proceedings of 23rd ACM Symposium on Parallelism in Algorithms and Architectures (SPAA), San Jose, CA, June 2011
|pages = 367–378
| year = 2011
| title = Sharing-Aware Algorithms for Virtual Machine Colocation}}
  1. {{citation

| last1 = Schreiber
| first1 = Ethan L.
| last2 = Korf
| first2 = Richard E.
| title = Improved Bin Completion for Optimal Bin Packing and Number Partitioning
| booktitle = Proceedings of the Twenty-Third International Joint Conference on Artificial Intelligence
| series = IJCAI '13
| year = 2013
| isbn = 978-1-57735-633-2
| location = Beijing, China
| pages = 651–658
| url = https://www.aaai.org/ocs/index.php/IJCAI/IJCAI13/paper/view/6851
| publisher = AAAI Press}}

External links

  • [https://pdfs.semanticscholar.org/bb99/86af2f26f7726fcef1bc684eac8239c9b853.pdf?_ga=1.50320358.1394974689.1485463187 Optimizing Three-Dimensional Bin Packing]
  • Implementation of 7 classic approximate bin packing algorithms in C with results and images
  • PHP Class to pack files without exceeding a given size limit
  • An implementation of several bin packing heuristics in Haskell, including FFD and MFFD.
  • Visualization of heuristics for 1D and 2D bin packing
  • [https://code.google.com/p/caparf/ Cutting And Packing Algorithms Research Framework], including a number of bin packing algorithms and test data.
  • A simple on-line bin-packing algorithm
  • Fpart : open-source command-line tool to pack files (C, BSD-licensed)
  • Bin Packing and Cutting Stock Solver Algorithm
{{Packing problem}}{{DEFAULTSORT:Bin Packing Problem}}

3 : Optimization algorithms and methods|Packing problems|Strongly NP-complete problems

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/11/10 17:16:00