Question: Algorithm is a small psuedocode in c++ Question 5: An instance of the bin packing problem consists of a set, S, of objects, each with

Algorithm is a small psuedocode in c++

Question 5: An instance of the bin packing problem consists of a set, S, of objects, each with a size 0.0 < si 1.0, and your objective is to fit these objects into the fewest possible number of bins. Each bin has size equal to 1.0, so if you had two objects of sizes 0.3 and 0.65, you could put both in the same bin.

Part a: Give a greedy algorithm for the bin packing problem.

Part b: Give an example where your greedy algorithm does not find the optimal solution.

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 Databases Questions!