In: Computer Science
, we are given a set of n items. Each item weights between 0 and 1. We also have a set of bins (knapsacks). Each bin has a capacity of 1, i.e., total weight in any bin should be less than 1. The problem is to pack the items into as few bins as possible. For example Given items: 0.2, 0.5, 0.4, 0.7, 0.1, 0.3, 0.8 Opt Solution: Bin1[0.2, 0.8], Bin2[0.5, 0.4, 0.1], Bin3[0.7, 0.3] Each item must be placed in a bin before the next item can be pro- cessed. This problem is NP-hard. Give an approximation algorithm to solve the bin packing problem. Provide pseudo-code, time complexity analysis and proof of performance ratio.