First-fit decreasing packs objects into bins by sorting them from largest to smallest, then placing each object in the first bin where it fits. Sorting improves utilization compared with preserving the original order. section 2.3
Packing six objects
With bin capacity 7 and object sizes 2, 4, 3, 6, 5, and 1, the total size is 21, so at least three bins are required. First-fit decreasing orders the objects as 6, 5, 4, 3, 2, 1 and packs them into three fully utilized bins, matching that lower bound. section 2.3
Figure 2.17 Handling the bin packing problem using first-fit and first-fit decreasing heuristics
Compare ordinary first-fit placement with first-fit decreasing placement in the bin-packing diagram. section 2.3
Use the heuristic with these practical cautions:
- Treat the result as a heuristic: ordering choices do not guarantee an optimal solution, and generalized layouts can remain infeasible or suboptimal. section 2.3
- Adapt the ordering rule when objects have width and height; smallest-first can place all five illustrated objects, while largest-first leaves one out. section 2.3
