Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the...
-
Upload
marsha-price -
Category
Documents
-
view
251 -
download
4
Transcript of Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the...
![Page 1: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/1.jpg)
Bin packingFirst-fit algorithm
![Page 2: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/2.jpg)
1 23
6
2 35
3
A B C D E F
4
Each block will be fitted into the first bin that has room for it.Each block will be fitted into the first bin that has room for it.
Bin packingFirst-fit algorithm
![Page 3: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/3.jpg)
A B C D E F
4
The first block fits into the first bin.The first block fits into the first bin.
1 23
6
2 35
3
Bin packingFirst-fit algorithm
![Page 4: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/4.jpg)
A B C D E F
4
The second block fits into the first bin.The second block fits into the first bin.
1
23
6
2 35
3
Bin packingFirst-fit algorithm
![Page 5: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/5.jpg)
A B C D E F
4
The third block will not fit in the first binThe third block will not fit in the first bin
1
23
6
2
35
3
2
But there is room in the second bin.But there is room in the second bin.
Bin packingFirst-fit algorithm
![Page 6: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/6.jpg)
The third bin is the first one the 5 will fit into.The third bin is the first one the 5 will fit into.
A B C D E F
4
1
2
6
3
5
3
2
3
5
5
Bin packingFirst-fit algorithm
![Page 7: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/7.jpg)
The second bin has room for the 3.The second bin has room for the 3.
Bin packingFirst-fit algorithm
A B C D E F
4
1
2
6
33
2
35
3
![Page 8: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/8.jpg)
The fourth bin is the first one with room for the 2.
The fourth bin is the first one with room for the 2.
Bin packingFirst-fit algorithm
A B C D E F
4
1
2
6
33
2
35
2 2
2
![Page 9: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/9.jpg)
The 3 also fits into the fourth bin.The 3 also fits into the fourth bin.
Bin packingFirst-fit algorithm
A B C D E F
4
1
6
3
2
35
2
3 3 3
3
![Page 10: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/10.jpg)
No room until the fifth bin for the 6.No room until the fifth bin for the 6.
Bin packingFirst-fit algorithm
A B C D E F
4
1
6
3
2
35
2
3
6 6 6
6
![Page 11: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/11.jpg)
The 3 has to start a new binThe 3 has to start a new bin
Bin packingFirst-fit algorithm
A B C D E F
4
1
2
35
2
3 6
3 3 3 33
3
Total usage is 6 bins.Total usage is 6 bins.
![Page 12: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/12.jpg)
Bin Packing
Examples
of first-fit algorithm
![Page 13: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/13.jpg)
Example 1Pack the following items
into bins of size 20:11, 7, 3, 4, 3, 5, 1, 8, 9
How many bins are required?
![Page 14: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/14.jpg)
11, 7, 3, 4, 3, 5, 1, 8, 9 Bin size 20
7 538
39
4 1
Bins
11
![Page 15: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/15.jpg)
11, 7, 3, 4, 3, 5, 1, 8, 9 Bin size 20
7 538
39
4 1
Bins
11
![Page 16: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/16.jpg)
11, 7, 3, 4, 3, 5, 1, 8, 9 Bin size 20
7
538
39
4 1
Bins
11
![Page 17: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/17.jpg)
11, 7, 3, 4, 3, 5, 1, 8, 9 Bin size 20
7
538
3
94 1
Bins
11
![Page 18: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/18.jpg)
11, 7, 3, 4, 3, 5, 1, 8, 9 Bin size 20
7
538
3
94 1
Bins
11
![Page 19: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/19.jpg)
11, 7, 3, 4, 3, 5, 1, 8, 9 Bin size 20
7
538
3
9
4
1
Bins
11
![Page 20: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/20.jpg)
11, 7, 3, 4, 3, 5, 1, 8, 9 Bin size 20
7
5
3
8
3
9
4
1
Bins
11
![Page 21: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/21.jpg)
11, 7, 3, 4, 3, 5, 1, 8, 9 Bin size 20
7 5
3
8
3
9
4
1
Bins
11
![Page 22: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/22.jpg)
11, 7, 3, 4, 3, 5, 1, 8, 9 Bin size 20
7 5
3
8
3
9
4
1
Bins
11
![Page 23: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/23.jpg)
11, 7, 3, 4, 3, 5, 1, 8, 9 Bin size 20
7 5
3
8
3
9
4
1
Bins
11
![Page 24: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/24.jpg)
11, 7, 3, 4, 3, 5, 1, 8, 9 Bin size 20
7 5
3
83
9
4
1
Bins
11
![Page 25: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/25.jpg)
11, 7, 3, 4, 3, 5, 1, 8, 9 Bin size 20
7 5
3
83
9
4
1
Bins
11
We need 3 bins.
![Page 26: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/26.jpg)
Example 2Pack the following items into
bins of size 20:5, 8, 12, 4, 11, 17, 7, 9, 7
How many bins are required?
![Page 27: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/27.jpg)
5, 8, 12, 4, 11, 17, 7, 9, 7Bin size 20
8
1711 912
74 7
Bins
5
![Page 28: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/28.jpg)
5, 8, 12, 4, 11, 17, 7, 9, 7Bin size 20
8
1711 912
74 7
Bins
5
![Page 29: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/29.jpg)
5, 8, 12, 4, 11, 17, 7, 9, 7Bin size 20
8
1711 912
74 7
Bins
5
![Page 30: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/30.jpg)
5, 8, 12, 4, 11, 17, 7, 9, 7Bin size 20
8
1711 9
12
74 7
Bins
5
![Page 31: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/31.jpg)
5, 8, 12, 4, 11, 17, 7, 9, 7Bin size 20
8
1711 9
12
74 7
Bins
5
![Page 32: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/32.jpg)
5, 8, 12, 4, 11, 17, 7, 9, 7Bin size 20
8
1711 9
12
7
4
7
Bins
5
![Page 33: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/33.jpg)
5, 8, 12, 4, 11, 17, 7, 9, 7Bin size 20
8
17
11
9
12
7
4
7
Bins
5
![Page 34: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/34.jpg)
5, 8, 12, 4, 11, 17, 7, 9, 7Bin size 20
8
17
11
9
12
7
4
7
Bins
5
![Page 35: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/35.jpg)
5, 8, 12, 4, 11, 17, 7, 9, 7Bin size 20
8
17
11
9
12
7
4
7
Bins
5
![Page 36: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/36.jpg)
5, 8, 12, 4, 11, 17, 7, 9, 7Bin size 20
8 1711
9
12
7
4
7
Bins
5
![Page 37: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/37.jpg)
5, 8, 12, 4, 11, 17, 7, 9, 7Bin size 20
8 1711
9
12
7
4 7
Bins
5
![Page 38: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/38.jpg)
5, 8, 12, 4, 11, 17, 7, 9, 7Bin size 20
8 1711
9
12
7
4 7
Bins
5
![Page 39: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/39.jpg)
5, 8, 12, 4, 11, 17, 7, 9, 7Bin size 20
8 1711
9
127
4 7
Bins
5
We need 5 bins.
![Page 40: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/40.jpg)
Example 3A wholesale greengrocer is packing the following items into crates
that will carry 24 kg:Item Weight of item (kg) Number of items
required
Carrots 9 1
Apples 6 2
Pears 7 1
Courgettes 3 1
Cauliflowers 14 1
Potatoes 20 1
Oranges 10 1
Leeks 6 1
Bananas 8 1
Tomatoes 5 3
Grapes 2 1
Onions 18 1
How many crates will the greengrocer need?
![Page 41: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/41.jpg)
Crates (24 kg)
Item Weight of item (kg) Number of items required
Carrots 9 1
Apples 6 2
Pears 7 1
Courgettes 3 1
Cauliflowers 14 1
Potatoes 20 1
Oranges 10 1
Leeks 6 1
Bananas 8 1
Tomatoes 5 3
Grapes 2 1
Onions 18 1
![Page 42: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/42.jpg)
Crates (24 kg)9 kg
Item Weight of item (kg) Number of items required
Carrots 9 1
Apples 6 2
Pears 7 1
Courgettes 3 1
Cauliflowers 14 1
Potatoes 20 1
Oranges 10 1
Leeks 6 1
Bananas 8 1
Tomatoes 5 3
Grapes 2 1
Onions 18 1
![Page 43: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/43.jpg)
Crates (24 kg)9 kg, 6 kg
Item Weight of item (kg) Number of items required
Carrots 9 1
Apples 6 2
Pears 7 1
Courgettes 3 1
Cauliflowers 14 1
Potatoes 20 1
Oranges 10 1
Leeks 6 1
Bananas 8 1
Tomatoes 5 3
Grapes 2 1
Onions 18 1
![Page 44: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/44.jpg)
Crates (24 kg)9 kg, 6 kg, 6 kg
Item Weight of item (kg) Number of items required
Carrots 9 1
Apples 6 2
Pears 7 1
Courgettes 3 1
Cauliflowers 14 1
Potatoes 20 1
Oranges 10 1
Leeks 6 1
Bananas 8 1
Tomatoes 5 3
Grapes 2 1
Onions 18 1
![Page 45: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/45.jpg)
Crates (24 kg)9 kg, 6 kg, 6 kg, 7 kg
Item Weight of item (kg) Number of items required
Carrots 9 1
Apples 6 2
Pears 7 1
Courgettes 3 1
Cauliflowers 14 1
Potatoes 20 1
Oranges 10 1
Leeks 6 1
Bananas 8 1
Tomatoes 5 3
Grapes 2 1
Onions 18 1
![Page 46: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/46.jpg)
Crates (24 kg)9 kg, 6 kg, 6 kg
7 kg
Item Weight of item (kg) Number of items required
Carrots 9 1
Apples 6 2
Pears 7 1
Courgettes 3 1
Cauliflowers 14 1
Potatoes 20 1
Oranges 10 1
Leeks 6 1
Bananas 8 1
Tomatoes 5 3
Grapes 2 1
Onions 18 1
![Page 47: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/47.jpg)
Crates (24 kg)9 kg, 6 kg, 6 kg, 3 kg
7 kg
Item Weight of item (kg) Number of items required
Carrots 9 1
Apples 6 2
Pears 7 1
Courgettes 3 1
Cauliflowers 14 1
Potatoes 20 1
Oranges 10 1
Leeks 6 1
Bananas 8 1
Tomatoes 5 3
Grapes 2 1
Onions 18 1
![Page 48: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/48.jpg)
Crates (24 kg)9 kg, 6 kg, 6 kg, 3 kg
7 kg
Item Weight of item (kg) Number of items required
Carrots 9 1
Apples 6 2
Pears 7 1
Courgettes 3 1
Cauliflowers 14 1
Potatoes 20 1
Oranges 10 1
Leeks 6 1
Bananas 8 1
Tomatoes 5 3
Grapes 2 1
Onions 18 1
![Page 49: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/49.jpg)
Crates (24 kg)9 kg, 6 kg, 6 kg, 3 kg
7 kg, 14 kg
Item Weight of item (kg) Number of items required
Carrots 9 1
Apples 6 2
Pears 7 1
Courgettes 3 1
Cauliflowers 14 1
Potatoes 20 1
Oranges 10 1
Leeks 6 1
Bananas 8 1
Tomatoes 5 3
Grapes 2 1
Onions 18 1
![Page 50: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/50.jpg)
Crates (24 kg)9 kg, 6 kg, 6 kg, 3 kg
7 kg, 14 kg, 20 kg
Item Weight of item (kg) Number of items required
Carrots 9 1
Apples 6 2
Pears 7 1
Courgettes 3 1
Cauliflowers 14 1
Potatoes 20 1
Oranges 10 1
Leeks 6 1
Bananas 8 1
Tomatoes 5 3
Grapes 2 1
Onions 18 1
![Page 51: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/51.jpg)
Crates (24 kg)9 kg, 6 kg, 6 kg, 3 kg
7 kg, 14 kg
20 kg
Item Weight of item (kg) Number of items required
Carrots 9 1
Apples 6 2
Pears 7 1
Courgettes 3 1
Cauliflowers 14 1
Potatoes 20 1
Oranges 10 1
Leeks 6 1
Bananas 8 1
Tomatoes 5 3
Grapes 2 1
Onions 18 1
![Page 52: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/52.jpg)
Crates (24 kg)9 kg, 6 kg, 6 kg, 3 kg
7 kg, 14 kg, 10 kg
20 kg
Item Weight of item (kg) Number of items required
Carrots 9 1
Apples 6 2
Pears 7 1
Courgettes 3 1
Cauliflowers 14 1
Potatoes 20 1
Oranges 10 1
Leeks 6 1
Bananas 8 1
Tomatoes 5 3
Grapes 2 1
Onions 18 1
![Page 53: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/53.jpg)
Crates (24 kg)9 kg, 6 kg, 6 kg, 3 kg
7 kg, 14 kg
20 kg, 10 kg
Item Weight of item (kg) Number of items required
Carrots 9 1
Apples 6 2
Pears 7 1
Courgettes 3 1
Cauliflowers 14 1
Potatoes 20 1
Oranges 10 1
Leeks 6 1
Bananas 8 1
Tomatoes 5 3
Grapes 2 1
Onions 18 1
![Page 54: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/54.jpg)
Crates (24 kg)9 kg, 6 kg, 6 kg, 3 kg
7 kg, 14 kg
20 kg
10 kg
Item Weight of item (kg) Number of items required
Carrots 9 1
Apples 6 2
Pears 7 1
Courgettes 3 1
Cauliflowers 14 1
Potatoes 20 1
Oranges 10 1
Leeks 6 1
Bananas 8 1
Tomatoes 5 3
Grapes 2 1
Onions 18 1
![Page 55: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/55.jpg)
Crates (24 kg)9 kg, 6 kg, 6 kg, 3 kg
7 kg, 14 kg, 6 kg
20 kg
10 kg
Item Weight of item (kg) Number of items required
Carrots 9 1
Apples 6 2
Pears 7 1
Courgettes 3 1
Cauliflowers 14 1
Potatoes 20 1
Oranges 10 1
Leeks 6 1
Bananas 8 1
Tomatoes 5 3
Grapes 2 1
Onions 18 1
![Page 56: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/56.jpg)
Crates (24 kg)9 kg, 6 kg, 6 kg, 3 kg
7 kg, 14 kg
20 kg, 6 kg
10 kg
Item Weight of item (kg) Number of items required
Carrots 9 1
Apples 6 2
Pears 7 1
Courgettes 3 1
Cauliflowers 14 1
Potatoes 20 1
Oranges 10 1
Leeks 6 1
Bananas 8 1
Tomatoes 5 3
Grapes 2 1
Onions 18 1
![Page 57: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/57.jpg)
Crates (24 kg)9 kg, 6 kg, 6 kg, 3 kg
7 kg, 14 kg
20 kg
10 kg, 6 kg
Item Weight of item (kg) Number of items required
Carrots 9 1
Apples 6 2
Pears 7 1
Courgettes 3 1
Cauliflowers 14 1
Potatoes 20 1
Oranges 10 1
Leeks 6 1
Bananas 8 1
Tomatoes 5 3
Grapes 2 1
Onions 18 1
![Page 58: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/58.jpg)
Crates (24 kg)9 kg, 6 kg, 6 kg, 3 kg
7 kg, 14 kg, 8 kg
20 kg
10 kg, 6 kg
Item Weight of item (kg) Number of items required
Carrots 9 1
Apples 6 2
Pears 7 1
Courgettes 3 1
Cauliflowers 14 1
Potatoes 20 1
Oranges 10 1
Leeks 6 1
Bananas 8 1
Tomatoes 5 3
Grapes 2 1
Onions 18 1
![Page 59: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/59.jpg)
Crates (24 kg)9 kg, 6 kg, 6 kg, 3 kg
7 kg, 14 kg
20 kg, 8 kg
10 kg, 6 kg
Item Weight of item (kg) Number of items required
Carrots 9 1
Apples 6 2
Pears 7 1
Courgettes 3 1
Cauliflowers 14 1
Potatoes 20 1
Oranges 10 1
Leeks 6 1
Bananas 8 1
Tomatoes 5 3
Grapes 2 1
Onions 18 1
![Page 60: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/60.jpg)
Crates (24 kg)9 kg, 6 kg, 6 kg, 3 kg
7 kg, 14 kg
20 kg
10 kg, 6 kg, 8 kg
Item Weight of item (kg) Number of items required
Carrots 9 1
Apples 6 2
Pears 7 1
Courgettes 3 1
Cauliflowers 14 1
Potatoes 20 1
Oranges 10 1
Leeks 6 1
Bananas 8 1
Tomatoes 5 3
Grapes 2 1
Onions 18 1
![Page 61: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/61.jpg)
Crates (24 kg)9 kg, 6 kg, 6 kg, 3 kg
7 kg, 14 kg
20 kg
10 kg, 6 kg, 8 kg
Item Weight of item (kg) Number of items required
Carrots 9 1
Apples 6 2
Pears 7 1
Courgettes 3 1
Cauliflowers 14 1
Potatoes 20 1
Oranges 10 1
Leeks 6 1
Bananas 8 1
Tomatoes 5 3
Grapes 2 1
Onions 18 1
![Page 62: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/62.jpg)
Crates (24 kg)9 kg, 6 kg, 6 kg, 3 kg
7 kg, 14 kg, 5 kg
20 kg
10 kg, 6 kg, 8 kg
Item Weight of item (kg) Number of items required
Carrots 9 1
Apples 6 2
Pears 7 1
Courgettes 3 1
Cauliflowers 14 1
Potatoes 20 1
Oranges 10 1
Leeks 6 1
Bananas 8 1
Tomatoes 5 3
Grapes 2 1
Onions 18 1
![Page 63: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/63.jpg)
Crates (24 kg)9 kg, 6 kg, 6 kg, 3 kg
7 kg, 14 kg
20 kg, 5 kg
10 kg, 6 kg, 8 kg
Item Weight of item (kg) Number of items required
Carrots 9 1
Apples 6 2
Pears 7 1
Courgettes 3 1
Cauliflowers 14 1
Potatoes 20 1
Oranges 10 1
Leeks 6 1
Bananas 8 1
Tomatoes 5 3
Grapes 2 1
Onions 18 1
![Page 64: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/64.jpg)
Crates (24 kg)9 kg, 6 kg, 6 kg, 3 kg
7 kg, 14 kg
20 kg
10 kg, 6 kg, 8 kg
5 kg
Item Weight of item (kg) Number of items required
Carrots 9 1
Apples 6 2
Pears 7 1
Courgettes 3 1
Cauliflowers 14 1
Potatoes 20 1
Oranges 10 1
Leeks 6 1
Bananas 8 1
Tomatoes 5 3
Grapes 2 1
Onions 18 1
![Page 65: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/65.jpg)
Crates (24 kg)9 kg, 6 kg, 6 kg, 3 kg
7 kg, 14 kg
20 kg
10 kg, 6 kg, 8 kg
5 kg, 5 kg
Item Weight of item (kg) Number of items required
Carrots 9 1
Apples 6 2
Pears 7 1
Courgettes 3 1
Cauliflowers 14 1
Potatoes 20 1
Oranges 10 1
Leeks 6 1
Bananas 8 1
Tomatoes 5 3
Grapes 2 1
Onions 18 1
![Page 66: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/66.jpg)
Crates (24 kg)9 kg, 6 kg, 6 kg, 3 kg
7 kg, 14 kg
20 kg
10 kg, 6 kg, 8 kg
5 kg, 5 kg, 5 kg
Item Weight of item (kg) Number of items required
Carrots 9 1
Apples 6 2
Pears 7 1
Courgettes 3 1
Cauliflowers 14 1
Potatoes 20 1
Oranges 10 1
Leeks 6 1
Bananas 8 1
Tomatoes 5 3
Grapes 2 1
Onions 18 1
![Page 67: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/67.jpg)
Crates (24 kg)9 kg, 6 kg, 6 kg, 3 kg
7 kg, 14 kg, 2 kg
20 kg
10 kg, 6 kg, 8 kg
5 kg, 5 kg, 5 kg
Item Weight of item (kg) Number of items required
Carrots 9 1
Apples 6 2
Pears 7 1
Courgettes 3 1
Cauliflowers 14 1
Potatoes 20 1
Oranges 10 1
Leeks 6 1
Bananas 8 1
Tomatoes 5 3
Grapes 2 1
Onions 18 1
![Page 68: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/68.jpg)
Crates (24 kg)9 kg, 6 kg, 6 kg, 3 kg
7 kg, 14 kg, 2 kg, 18 kg
20 kg
10 kg, 6 kg, 8 kg
5 kg, 5 kg, 5 kg
Item Weight of item (kg) Number of items required
Carrots 9 1
Apples 6 2
Pears 7 1
Courgettes 3 1
Cauliflowers 14 1
Potatoes 20 1
Oranges 10 1
Leeks 6 1
Bananas 8 1
Tomatoes 5 3
Grapes 2 1
Onions 18 1
![Page 69: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/69.jpg)
Crates (24 kg)9 kg, 6 kg, 6 kg, 3 kg
7 kg, 14 kg, 2 kg
20 kg, 18 kg
10 kg, 6 kg, 8 kg
5 kg, 5 kg, 5 kg
Item Weight of item (kg) Number of items required
Carrots 9 1
Apples 6 2
Pears 7 1
Courgettes 3 1
Cauliflowers 14 1
Potatoes 20 1
Oranges 10 1
Leeks 6 1
Bananas 8 1
Tomatoes 5 3
Grapes 2 1
Onions 18 1
![Page 70: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/70.jpg)
Crates (24 kg)9 kg, 6 kg, 6 kg, 3 kg
7 kg, 14 kg, 2 kg
20 kg
10 kg, 6 kg, 8 kg
5 kg, 5 kg, 5 kg, 18 kg
Item Weight of item (kg) Number of items required
Carrots 9 1
Apples 6 2
Pears 7 1
Courgettes 3 1
Cauliflowers 14 1
Potatoes 20 1
Oranges 10 1
Leeks 6 1
Bananas 8 1
Tomatoes 5 3
Grapes 2 1
Onions 18 1
![Page 71: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/71.jpg)
Crates (24 kg)9 kg, 6 kg, 6 kg, 3 kg
7 kg, 14 kg, 2 kg
20 kg
10 kg, 6 kg, 8 kg
5 kg, 5 kg, 5 kg
18 kg
Item Weight of item (kg) Number of items required
Carrots 9 1
Apples 6 2
Pears 7 1
Courgettes 3 1
Cauliflowers 14 1
Potatoes 20 1
Oranges 10 1
Leeks 6 1
Bananas 8 1
Tomatoes 5 3
Grapes 2 1
Onions 18 1
![Page 72: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/72.jpg)
Crates (24 kg)9 kg, 6 kg, 6 kg, 3 kg
7 kg, 14 kg, 2 kg
20 kg
10 kg, 6 kg, 8 kg
5 kg, 5 kg, 5 kg
18 kg
Item Weight of item (kg) Number of items required
Carrots 9 1
Apples 6 2
Pears 7 1
Courgettes 3 1
Cauliflowers 14 1
Potatoes 20 1
Oranges 10 1
Leeks 6 1
Bananas 8 1
Tomatoes 5 3
Grapes 2 1
Onions 18 1
So the greengrocer
needs 6 crates.
![Page 73: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/73.jpg)
Example 4Pack the following items into
bins of size 16: 14, 2, 7, 3, 1, 9, 12, 4, 6
How many bins are required?
![Page 74: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/74.jpg)
14, 2, 7, 3, 1, 9, 12, 4, 6Bin size 16
2
9
1 47 6
3
12
Bins
14
![Page 75: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/75.jpg)
14, 2, 7, 3, 1, 9, 12, 4, 6Bin size 16
2
9
1 47 6
3
12
Bins
14
![Page 76: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/76.jpg)
14, 2, 7, 3, 1, 9, 12, 4, 6Bin size 16
2
9
1 47 6
3
12
Bins
14
![Page 77: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/77.jpg)
14, 2, 7, 3, 1, 9, 12, 4, 6Bin size 16
2
9
1 4
7
63
12
Bins
14
![Page 78: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/78.jpg)
14, 2, 7, 3, 1, 9, 12, 4, 6Bin size 16
2
9
1 4
7
63
12
Bins
14
![Page 79: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/79.jpg)
14, 2, 7, 3, 1, 9, 12, 4, 6Bin size 16
2
9
1 4
7
6
3
12
Bins
14
![Page 80: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/80.jpg)
14, 2, 7, 3, 1, 9, 12, 4, 6Bin size 16
2
9
1
4
7
6
3
12
Bins
14
![Page 81: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/81.jpg)
14, 2, 7, 3, 1, 9, 12, 4, 6Bin size 16
29
1
4
7
6
3
12
Bins
14
![Page 82: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/82.jpg)
14, 2, 7, 3, 1, 9, 12, 4, 6Bin size 16
2
9
1
4
7
6
3
12
Bins
14
![Page 83: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/83.jpg)
14, 2, 7, 3, 1, 9, 12, 4, 6Bin size 16
2
9
1
4
7
6
3
12
Bins
14
![Page 84: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/84.jpg)
14, 2, 7, 3, 1, 9, 12, 4, 6Bin size 16
2
9
1
4
7
6
3
12
Bins
14
![Page 85: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/85.jpg)
14, 2, 7, 3, 1, 9, 12, 4, 6Bin size 16
2
9
1
4
7
6
3
12
Bins
14
![Page 86: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/86.jpg)
14, 2, 7, 3, 1, 9, 12, 4, 6Bin size 16
2
9
1
4
7
6
3
12
Bins
14
![Page 87: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/87.jpg)
14, 2, 7, 3, 1, 9, 12, 4, 6Bin size 16
2
9
1
4
7
6
3
12
Bins
14
We need 4 bins.
![Page 88: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/88.jpg)
Example 5A music store is ordering musical instruments. They are packed into boxes
and delivered by a lorry. Each box can hold 20 kg.
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
How many boxes will be needed to deliver all the instruments?
![Page 89: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/89.jpg)
Boxes (20 kg)
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 90: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/90.jpg)
Boxes (20 kg)
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 91: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/91.jpg)
Boxes (20 kg)15 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 92: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/92.jpg)
Boxes (20 kg)15 kg, 15 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 93: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/93.jpg)
Boxes (20 kg)15 kg
15 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 94: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/94.jpg)
Boxes (20 kg)15 kg
15 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 95: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/95.jpg)
Boxes (20 kg)15 kg, 2 kg
15 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 96: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/96.jpg)
Boxes (20 kg)15 kg, 2 kg, 2 kg
15 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 97: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/97.jpg)
Boxes (20 kg)15 kg, 2 kg, 2 kg, 2 kg
15 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 98: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/98.jpg)
Boxes (20 kg)15 kg, 2 kg, 2 kg
15 kg, 2 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 99: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/99.jpg)
Boxes (20 kg)15 kg, 2 kg, 2 kg
15 kg, 2 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 100: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/100.jpg)
Boxes (20 kg)15 kg, 2 kg, 2 kg, 7 kg
15 kg, 2 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 101: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/101.jpg)
Boxes (20 kg)15 kg, 2 kg, 2 kg
15 kg, 2 kg, 7 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 102: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/102.jpg)
Boxes (20 kg)15 kg, 2 kg, 2 kg
15 kg, 2 kg
7 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 103: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/103.jpg)
Boxes (20 kg)15 kg, 2 kg, 2 kg
15 kg, 2 kg
7 kg, 7 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 104: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/104.jpg)
Boxes (20 kg)15 kg, 2 kg, 2 kg
15 kg, 2 kg
7 kg, 7 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 105: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/105.jpg)
Boxes (20 kg)15 kg, 2 kg, 2 kg, 1 kg
15 kg, 2 kg
7 kg, 7 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 106: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/106.jpg)
Boxes (20 kg)15 kg, 2 kg, 2 kg, 1 kg
15 kg, 2 kg
7 kg, 7 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 107: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/107.jpg)
Boxes (20 kg)15 kg, 2 kg, 2 kg, 1 kg
15 kg, 2 kg
7 kg, 7 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 108: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/108.jpg)
Boxes (20 kg)15 kg, 2 kg, 2 kg, 1 kg
15 kg, 2 kg, 2 kg
7 kg, 7 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 109: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/109.jpg)
Boxes (20 kg)15 kg, 2 kg, 2 kg, 1 kg
15 kg, 2 kg, 2 kg, 2 kg
7 kg, 7 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 110: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/110.jpg)
Boxes (20 kg)15 kg, 2 kg, 2 kg, 1 kg
15 kg, 2 kg, 2 kg
7 kg, 7 kg, 2 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 111: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/111.jpg)
Boxes (20 kg)15 kg, 2 kg, 2 kg, 1 kg
15 kg, 2 kg, 2 kg
7 kg, 7 kg, 2 kg, 2 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 112: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/112.jpg)
Boxes (20 kg)15 kg, 2 kg, 2 kg, 1 kg
15 kg, 2 kg, 2 kg
7 kg, 7 kg, 2 kg, 2 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 113: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/113.jpg)
Boxes (20 kg)15 kg, 2 kg, 2 kg, 1 kg
15 kg, 2 kg, 2 kg, 1 kg
7 kg, 7 kg, 2 kg, 2 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 114: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/114.jpg)
Boxes (20 kg)15 kg, 2 kg, 2 kg, 1 kg
15 kg, 2 kg, 2 kg, 1 kg
7 kg, 7 kg, 2 kg, 2 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 115: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/115.jpg)
Boxes (20 kg)15 kg, 2 kg, 2 kg, 1 kg
15 kg, 2 kg, 2 kg, 1 kg
7 kg, 7 kg, 2 kg, 2 kg,1 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 116: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/116.jpg)
Boxes (20 kg)15 kg, 2 kg, 2 kg, 1 kg
15 kg, 2 kg, 2 kg, 1 kg
7 kg, 7 kg, 2 kg, 2 kg,1 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 117: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/117.jpg)
Boxes (20 kg)15 kg, 2 kg, 2 kg, 1 kg
15 kg, 2 kg, 2 kg, 1 kg
7 kg, 7 kg, 2 kg, 2 kg,1 kg, 4 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 118: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/118.jpg)
Boxes (20 kg)15 kg, 2 kg, 2 kg, 1 kg
15 kg, 2 kg, 2 kg, 1 kg
7 kg, 7 kg, 2 kg, 2 kg,1 kg
4 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 119: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/119.jpg)
Boxes (20 kg)15 kg, 2 kg, 2 kg, 1 kg
15 kg, 2 kg, 2 kg, 1 kg
7 kg, 7 kg, 2 kg, 2 kg,1 kg
4 kg, 4 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 120: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/120.jpg)
Boxes (20 kg)15 kg, 2 kg, 2 kg, 1 kg
15 kg, 2 kg, 2 kg, 1 kg
7 kg, 7 kg, 2 kg, 2 kg,1 kg
4 kg, 4 kg, 4 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 121: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/121.jpg)
Boxes (20 kg)15 kg, 2 kg, 2 kg, 1 kg
15 kg, 2 kg, 2 kg, 1 kg
7 kg, 7 kg, 2 kg, 2 kg,1 kg
4 kg, 4 kg, 4 kg, 4 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 122: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/122.jpg)
Boxes (20 kg)15 kg, 2 kg, 2 kg, 1 kg
15 kg, 2 kg, 2 kg, 1 kg
7 kg, 7 kg, 2 kg, 2 kg,1 kg
4 kg, 4 kg, 4 kg, 4 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 123: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/123.jpg)
Boxes (20 kg)15 kg, 2 kg, 2 kg, 1 kg
15 kg, 2 kg, 2 kg, 1 kg
7 kg, 7 kg, 2 kg, 2 kg,1 kg, 18 kg
4 kg, 4 kg, 4 kg, 4 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 124: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/124.jpg)
Boxes (20 kg)15 kg, 2 kg, 2 kg, 1 kg
15 kg, 2 kg, 2 kg, 1 kg
7 kg, 7 kg, 2 kg, 2 kg,1 kg
4 kg, 4 kg, 4 kg, 4 kg,18 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 125: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/125.jpg)
Boxes (20 kg)15 kg, 2 kg, 2 kg, 1 kg
15 kg, 2 kg, 2 kg, 1 kg
7 kg, 7 kg, 2 kg, 2 kg,1 kg
4 kg, 4 kg, 4 kg, 4 kg
18 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 126: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/126.jpg)
Boxes (20 kg)15 kg, 2 kg, 2 kg, 1 kg
15 kg, 2 kg, 2 kg, 1 kg
7 kg, 7 kg, 2 kg, 2 kg,1 kg, 1 kg
4 kg, 4 kg, 4 kg, 4 kg
18 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 127: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/127.jpg)
Boxes (20 kg)15 kg, 2 kg, 2 kg, 1 kg
15 kg, 2 kg, 2 kg, 1 kg
7 kg, 7 kg, 2 kg, 2 kg,1 kg, 1 kg
4 kg, 4 kg, 4 kg, 4 kg
18 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 128: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/128.jpg)
Boxes (20 kg)15 kg, 2 kg, 2 kg, 1 kg
15 kg, 2 kg, 2 kg, 1 kg
7 kg, 7 kg, 2 kg, 2 kg,1 kg, 1 kg
4 kg, 4 kg, 4 kg, 4 kg,1 kg
18 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
![Page 129: Bin packing First-fit algorithm. 1 2 3 6 2 3 5 3 A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.](https://reader033.fdocuments.in/reader033/viewer/2022061520/56649f455503460f94c66387/html5/thumbnails/129.jpg)
Boxes (20 kg)15 kg, 2 kg, 2 kg, 1 kg
15 kg, 2 kg, 2 kg, 1 kg
7 kg, 7 kg, 2 kg, 2 kg,1 kg, 1 kg
4 kg, 4 kg, 4 kg, 4 kg,1 kg
18 kg
Instrument Weight of instrument (kg)
Number of each instrument ordered
Guitars 15 2
Trumpets 2 3
Saxophones 7 2
Violins 1 1
Trombones 2 3
Flutes 1 2
Bassoons 4 4
Tubas 18 1
Cymbals 1 2
5 boxes are
needed.