Image for FFD (First-Fit Decreasing)

FFD (First-Fit Decreasing)

First-Fit Decreasing (FFD) is an algorithm used to efficiently pack items into fixed-sized containers or bins, such as fitting objects into boxes or memory blocks. It starts by sorting items from largest to smallest, then places each item into the first bin where it fits without exceeding capacity. If the item doesn’t fit in any existing bin, a new bin is opened. This method balances simplicity with effectiveness, often producing near-optimal solutions for packing problems, and is commonly used in logistics, computer memory allocation, and resource management.