Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Bin packing problem
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Mathematical and computational problem}} {{Distinguish|bin picking}} {{Covering/packing-problem pairs}} The '''bin packing problem<ref>{{citation|last1=Martello|first1=Silvano|title=Knapsack Problems: Algorithms and Computer Implementations|url=https://archive.org/details/knapsackproblems0000mart|year=1990|chapter=Bin-packing problem|chapter-url=http://www.or.deis.unibo.it/kp/Chapter8.pdf|location=Chichester, UK|publisher=John Wiley and Sons|isbn=0471924202|last2=Toth|first2=Paolo|url-access=registration}}</ref><ref>{{cite book|last1=Korte|first1=Bernhard|title=Combinatorial Optimization: Theory and Algorithms|last2=Vygen|first2=Jens|publisher=Springer|year=2006|isbn=978-3-540-25684-7|series=Algorithms and Combinatorics 21|pages=426–441|chapter=Bin-Packing|doi=10.1007/3-540-29297-7_18|chapter-url=https://books.google.com/books?id=UnYwgPltSjwC&q=Bin-Packing&pg=PA449}}</ref><ref>{{cite web|last=Barrington|first=David Mix|year=2006|title=Bin Packing|url=https://people.cs.umass.edu/~barring/cs311/disc/11.html|url-status=dead|archive-url=https://web.archive.org/web/20190216134619/https://people.cs.umass.edu/~barring/cs311/disc/11.html|archive-date=2019-02-16|access-date=2016-02-27}}</ref><ref name=":0">{{Citation|last1=Coffman Jr.|first1=Edward G.|title=Bin Packing Approximation Algorithms: Survey and Classification|date=2013|url=https://doi.org/10.1007/978-1-4419-7997-1_35|work=Handbook of Combinatorial Optimization|pages=455–531|editor-last=Pardalos|editor-first=Panos M.|place=New York, NY|publisher=Springer|language=en|doi=10.1007/978-1-4419-7997-1_35|isbn=978-1-4419-7997-1|access-date=2021-08-08|last2=Csirik|first2=János|last3=Galambos|first3=Gábor|last4=Martello|first4=Silvano|last5=Vigo|first5=Daniele|editor2-last=Du|editor2-first=Ding-Zhu|editor3-last=Graham|editor3-first=Ronald L.}}</ref>''' is an [[optimization problem]], in which items of different sizes must be packed into a finite number of bins or containers, each of a fixed given capacity, in a way that minimizes the number of bins used. The problem has many applications, such as filling up containers, loading trucks with weight capacity constraints, creating file [[backup]]s in media, splitting a network prefix into multiple subnets,<ref>{{cite web |title=DHCPv6-PD - First steps |url=https://sha256.net/dhcpv6-pd-first-steps.html#orge8b6244 |access-date=12 June 2024}}</ref> and technology mapping in [[Field-programmable gate array|FPGA]] [[semiconductor chip]] design. Computationally, the problem is [[NP-hard]], and the corresponding [[decision problem]], deciding if items can fit into a specified number of bins, is [[NP-complete]]. Despite its worst-case hardness, optimal solutions to very large instances of the problem can be produced with sophisticated algorithms. In addition, many [[approximation algorithms]] exist. For example, the [[First-fit bin packing|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 ''[[Big O notation|Θ]]''(''n'' log ''n'') time, where ''n'' is the number of items to be packed. The algorithm can be made much more effective by first [[sorting]] the list of items 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.<ref>{{citation|last=Lewis|first=R.|title=A General-Purpose Hill-Climbing Method for Order Independent Minimum Grouping Problems: A Case Study in Graph Colouring and Bin Packing|url=http://orca.cf.ac.uk/11334/1/Lewis%2C_R_General_Purpose_Hill_Climbing.pdf|journal=Computers and Operations Research|volume=36|issue=7|pages=2295–2310|year=2009|doi=10.1016/j.cor.2008.09.004|s2cid=1577334 }}</ref> There are many [[Packing problem|variations]] of this problem, such as 2D packing, linear packing, packing by weight, packing by cost, and so on. 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 characterized by both a volume and a value, the problem of maximizing the value of items that can fit in the bin is known as the [[knapsack problem]]. 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<ref>{{cite book | doi=10.1145/1989493.1989554 | chapter=Sharing-aware algorithms for virtual machine colocation | title=Proceedings of the twenty-third annual ACM symposium on Parallelism in algorithms and architectures | date=2011 | last1=Sindelar | first1=Michael | last2=Sitaraman | first2=Ramesh K. | last3=Shenoy | first3=Prashant | pages=367–378 | isbn=978-1-4503-0743-7 | chapter-url=https://works.bepress.com/ramesh_sitaraman/22 }}</ref> since when [[virtual machines]] (VMs) are packed in a server, their total [[Memory management|memory requirement]] could decrease due to [[Page (computer memory)|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 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 algorithm|online]] bin packing. Here the items 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. In contrast, offline bin packing allows rearranging the items in the hope of achieving a better packing once additional items arrive. This of course requires additional storage for holding the items to be rearranged.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)