0.1

0.4

0.2 0.3

0.6 1.5 1.6 0.9

bin: A B C D

Using the first fit packing algorithm to pack items (numbers) into bins of size 2.

For Each number that arrives to be packed, check the first bin for available empty space based on the size of number. If it fits, put it in that bin. Otherwise, open a new bin and put it it that bin. Update & note the remaining empty space in that bin.

when we say number fits in a bin,

number size <= empty space in the bin.

empty space in the bin = bin size - sum of the numbers already in bin

At First there are no bins.

1. In arrives first number (item) 0.6. We have no existing bin that can hold this.

So open a new bin A. Put 0.6 in bin A.

2. In comes number 1.5. It cannot fit in bin A as empty space in that is only 1.4,

so open bin B and put 1.5 in it.

3. Now 1.6 comes in, it can not fit in Bin A, cannot fit in B, so open new bin C

and put it in C.

4. Now comes 0.2, it fits in bin A. put it in A.

5. Now for 0.4, it fits in bin A. put it in A

6. Comes in 0.5, fits in bin A. put it in bin A

7. comes in 0.7, fits in A. put it in bin A

8. comes in 0.1 , fits in A. put it in bin A

9. comes in 0.9, does not fit in A, or B or C. So open bin D. put 0.9 in bin D

10. comes in 0.3, does not fit in A. but fits in B. put it in bin B.

0.1

0.4

0.2 0.3

0.6 1.5 1.6 0.9

A B C D