Sunday 7 August 2011

Bin Packing

It is used to put a set of items that you need to fit into the minimum amount of bins.

2, 4, 3, 3, 2, 5, 4 (kg) in 8 kg piles

  • First-Fit
Take the first item and put it into the first bin.

Put next item into the next bin it can fit into (either the first or another bin).

Try every item in the first, second, etc until all items are in the bins.


  • First-Fit Decreasing
Arrange items into descending order.

Take the first item and put it into the first bin.

Put next item into the next bin it can fit into (either the first or another bin).

Try every item in the first, second, etc until all items are in the bins.



©2011 Grant Dwyer

No comments:

Post a Comment