Presentation is loading. Please wait.

Presentation is loading. Please wait.

BIN SORTING Problem Pack the following items in bins of size 20 8 7 14 9 6 9 5 15 6 7 8 Firstly, find the lower bound by summing the numbers to be packed.

Similar presentations


Presentation on theme: "BIN SORTING Problem Pack the following items in bins of size 20 8 7 14 9 6 9 5 15 6 7 8 Firstly, find the lower bound by summing the numbers to be packed."— Presentation transcript:

1 BIN SORTING Problem Pack the following items in bins of size 20 8 7 14 9 6 9 5 15 6 7 8 Firstly, find the lower bound by summing the numbers to be packed and divide this total by the size of the bin. The lower bound is the least integer greater than or equal to the result. The sum is 94 94 divided by 20 is 4.7 So the lower bound is 5  we need at least 5 bins

2 FIRST-FIT ALGORITHM Take the items in the order given and place each item in the first available bin that can take it, starting from Bin 1 each time. 8714969515678 Bin Size = 20 Bin 1Bin 2Bin 3Bin 4Bin 5Bin 6 Spare = 12Spare = 5Spare = 6Spare = 11FULLSpare = 2FULLSpare = 5Spare = 14Spare = 7 Hence 6 bins are needed

3 You don’t have to actually use bins, you can just list them but remember the order within each bin is important Bin 1:875 Bin 2:146 Bin 3:99 Bin 4:15 Bin 5:67 Bin 6:8

4 FIRST-FIT DECREASING ALGORITHM Firstly, reorder the items so that they are in decreasing order. Then apply the first-fit algorithm to the reordered list. 8714969515678 Bin Size = 20 1514998877665 Bin 1Bin 2Bin 3Bin 4Bin 5Bin 6 Spare = 5Spare = 6Spare = 11Spare = 2Spare = 12Spare = 4Spare = 13Spare = 6FULL Hence only 5 bins are needed

5 Hence the bins may be filled as follows: This is totally different compared with the First-Fit method: Bin 1:875 Bin 2:146 Bin 3:99 Bin 4:15 Bin 5:67 Bin 6:8 Bin 1:155 Bin 2:146 Bin 3:99 Bin 4:88 Bin 5:776 First-Fit Decreasing MethodFirst-Fit Method In this case, the First-Fit Decreasing Method is the more efficient one.

6 FULL-BIN PACKING ALGORITHM Use observations to find combinations of items that will fill a bin. Pack those items first. Any remaining items are placed in the next available bin that can take the item, starting from Bin 1 each time. 8714969515678 Bin 1Bin 2Bin 3Bin 4Bin 5Bin 6 Bin Size = 20 14 + 6 = 20 FULL 7 + 6 + 7 = 20 FULL 5 + 15 = 20 FULLSpare = 12Spare = 3Spare = 11Spare = 3 Hence 5 bins are needed

7 Hence the bins may be filled as follows: Bin 1:146 Bin 2:767 Bin 3:515 Bin 4:89 Bin 5:98

8 We now have 3 different solutions: Bin 1:875 Bin 2:146 Bin 3:99 Bin 4:15 Bin 5:67 Bin 6:8 Bin 1:155 Bin 2:146 Bin 3:99 Bin 4:88 Bin 5:776 Bin 1:146 Bin 2:767 Bin 3:515 Bin 4:89 Bin 5:98 First-Fit Method First-Fit Decreasing Method Full-Bin Method


Download ppt "BIN SORTING Problem Pack the following items in bins of size 20 8 7 14 9 6 9 5 15 6 7 8 Firstly, find the lower bound by summing the numbers to be packed."

Similar presentations


Ads by Google