In computational complexity theory, the bin packing problem is a combinatorial NP-hard problem. In it, objects of different volumes must be packed into a finite number of bins of capacity V in a way that minimizes the number of bins used.
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, creating file backup in removable 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 it is NP-hard, optimal solutions to very large instances 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.
Read more about Bin Packing Problem: Formal Statement, First-fit Algorithm, Analysis of Approximate Algorithms, Exact Algorithm
Famous quotes containing the words packing and/or problem:
“He had a wonderful talent for packing thought close, and rendering it portable.”
—Thomas Babington Macaulay (18001859)
“It is very comforting to believe that leaders who do terrible things are, in fact, mad. That way, all we have to do is make sure we dont put psychotics in high places and weve got the problem solved.”
—Tom Wolfe (b. 1931)