Question: Project Description: The bin packing problem requires that we pack n items of lengths aj, A2, ..., an (assume that each a; = 1) into

Project Description: The bin packing problem

Project Description: The bin packing problem requires that we pack n items of lengths aj, A2, ..., an (assume that each a; = 1) into bins of unit length using the minimum possible number of bins. Several approximate methods, called heuristics, are available for solving the bin packing problem. The first-fit heuristic is one of the more popular of these heuristics. It works as follows. Arrange items in an arbitrary order and examine them one by one in this order. For an item being examined, scan the bins one by one and put the item in the bin where it fits first. If an item fits in none of the bins that currently contain an item, we introduce a new bin and place the item in it. Questions: (a) (80 points) Write a MATLAB code for the first-fit heuristic and apply the code in order to solve the problem of 20 items with the following lengths. [0.36, 0.88, 0.12, 0.22, 0.12, 0.56, 0.18, 0.33, 0.06, 0.79, 0.60, 0.14, 0.31, 0.22, 0.13, 0.52, 0.69, 0.01, 0.79, 0.31] Note: While applying your code for the above example, DO NOT change the order of items in the array. (b) (10 points) Show that your algorithm runs in O(n). (c) (10 points) Now, sort the items in descending order of their lengths and execute the first-fit heuristic again with your MATLAB code. Did you find a better solution or not? Project Description: The bin packing problem requires that we pack n items of lengths aj, A2, ..., an (assume that each a; = 1) into bins of unit length using the minimum possible number of bins. Several approximate methods, called heuristics, are available for solving the bin packing problem. The first-fit heuristic is one of the more popular of these heuristics. It works as follows. Arrange items in an arbitrary order and examine them one by one in this order. For an item being examined, scan the bins one by one and put the item in the bin where it fits first. If an item fits in none of the bins that currently contain an item, we introduce a new bin and place the item in it. Questions: (a) (80 points) Write a MATLAB code for the first-fit heuristic and apply the code in order to solve the problem of 20 items with the following lengths. [0.36, 0.88, 0.12, 0.22, 0.12, 0.56, 0.18, 0.33, 0.06, 0.79, 0.60, 0.14, 0.31, 0.22, 0.13, 0.52, 0.69, 0.01, 0.79, 0.31] Note: While applying your code for the above example, DO NOT change the order of items in the array. (b) (10 points) Show that your algorithm runs in O(n). (c) (10 points) Now, sort the items in descending order of their lengths and execute the first-fit heuristic again with your MATLAB code. Did you find a better solution or not

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related General Management Questions!