0% found this document useful (0 votes)
394 views

Bin Packing - First Fit Algorithm

The document describes the first fit bin packing algorithm. Blocks are fitted into the first bin that has enough room, with each new block going into the earliest bin that can accommodate it. This results in 6 blocks (A-F) being packed into 6 bins in the given example. The total number of bins used is minimized under the first fit algorithm.

Uploaded by

nur_anis_8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
394 views

Bin Packing - First Fit Algorithm

The document describes the first fit bin packing algorithm. Blocks are fitted into the first bin that has enough room, with each new block going into the earliest bin that can accommodate it. This results in 6 blocks (A-F) being packed into 6 bins in the given example. The total number of bins used is minimized under the first fit algorithm.

Uploaded by

nur_anis_8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 10

Bin Packing

First fit algorithm

Each
Eachblock
blockwill
willbe
befitted
fittedinto
intothe
thefirst
firstbin
binthat
thathas
hasroom
roomfor
forit.
it.

4
1

6
3

Bin Packing
First fit algorithm

4
A

The
Thefirst
firstblock
blockfits
fitsinto
intothe
thefirst
firstbin
bin

5
1

6
3

Bin Packing
First fit algorithm
1
4
A

The
Thesecond
secondblock
blockfits
fitsin
inthe
thefirst
firstbin
bin

5
2

6
3

Bin Packing
First fit algorithm
2
1
4
A

2
B

The
But
third
there
block
isisroom
will
in
fit
second
the
bin
bin
The
But
third
there
block
room
willnot
not
inthe
the
fitin
in
second
thefirst
first
bin
bin

6
3

5
1
4
A

Bin Packing
First fit algorithm
5
5
2
B

The
Thethird
thirdbin
binisisthe
thefirst
firstone
onethe
the55will
willfit
fitin
in

6
3

3
1
4
A

Bin Packing
First fit algorithm
3

2
B

The
Thesecond
secondbin
binhas
hasroom
roomfor
forthe
the33

6
2

Bin Packing
First fit algorithm
2
1
4
A

2
3

2
5

2
B

2
C

The
Thefourth
fourthbin
binisisthe
thefirst
firstone
onewith
withroom
roomfor
for
the
thenext
nextone
one

6
3

3
1
4
A

Bin Packing
First fit algorithm
3
3

2
B

3
2

The
Thenext
nextone
onealso
alsofits
fitsin
inthe
thefourth
fourthbin
bin

6
3

6
1
4
A

Bin Packing
6
6 algorithm
6
First
fit
3

2
B

2
C

No
Noroom
roomuntil
untilthe
thefifth
fifthbin
binfor
forthe
the66

3
1
4
A

Bin Packing
First fit algorithm
3
3
3

2
B

3
3

6
3

2
C

The
Total
33has
usage
to
isis6a6abins.
new
The
Total
has
usage
tostart
start
bins.
newbin
bin

You might also like