Question

In: Computer Science

, we are given a set of n items. Each item weights between 0 and 1....

, 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.

Solutions

Expert Solution


Related Solutions

The data provided below is the same for each item in a set of interrelated items...
The data provided below is the same for each item in a set of interrelated items about the FIFO approach to processes costing. Only the question asked tends to differ from item to item. Together this set of items addresses the same problem. Students are encouraged to work the ENTIRE problem out on scratch paper before responding to any items that relate to this problem. Knuckle makes t-shirts. It uses the FIFO approach to process costing and has a single-stage...
source: /** * A class to model an item (or set of items) in an *...
source: /** * A class to model an item (or set of items) in an * auction: a batch. */ public class BeerBatch { // A unique identifying number. private final int number; // A description of the batch. private String description; // The current highest offer for this batch. private Offer highestOffer; /** * Construct a BeerBatch, setting its number and description. * @param number The batch number. * @param description A description of this batch. */ public BeerBatch(int...
For each n ∈ N, let fn : [0, 1] → [0, 1] be defined by...
For each n ∈ N, let fn : [0, 1] → [0, 1] be defined by fn(x) = 0, x > 1/n and fn(x) = 1−nx if 0 ≤ x ≤1/n. The collection {fn(x) : n ∈ N} converges to a point, call it f(x) for each x ∈ [0, 1]. Show whether {fn(x) : n ∈ N} converges to f uniformly or not.
c++ The input items are given in one line and each item is separated by white...
c++ The input items are given in one line and each item is separated by white spaces (blank-space and tab). how can I implement? and input: 34 peach 7 output: number: 34 7 string: peach How can I separate the numbers and characters that I type at once?
Problem 1: Given an array A[0 ... n-1], where each element of the array represents a...
Problem 1: Given an array A[0 ... n-1], where each element of the array represents a vote in the election. Assume that each vote is given as integers representing the ID of the chosen candidate. Write the code determining who wins the election. Problem 2: How do we find the number which appeared maximum number of times in an array? ( Use Java and an original code )
Given an array A[0 … n-1], where each element of the array represent a vote in...
Given an array A[0 … n-1], where each element of the array represent a vote in the election. Assume that each vote is given as an integer representing the ID of the chosen candidate. Can you determine who wins the election? What is the complexity of your solution? Hint: it is similar to finding the element that is repeated the maximum number of times.
Given a difference equation x[n+2] + 5x[n+1]+6x[n]=n with start values x[0]= 0 and x[1]=0
Given a difference equation x[n+2] + 5x[n+1]+6x[n]=n with start values x[0]= 0 and x[1]=0
Using Java, Given an array A[0 ... n-1], where each element of the array represent a...
Using Java, Given an array A[0 ... n-1], where each element of the array represent a vote in the election. Assume that each vote is given as an integer representing the ID of the chosen candidate. Can you determine who wins the election? What is the complexity of your solution? Hint: it is similar to finding the element that is repeated the maximum number of times.
Part 2 BeerBatch Class /** * A class to model an item (or set of items)...
Part 2 BeerBatch Class /** * A class to model an item (or set of items) in an * auction: a batch. */ public class BeerBatch {     // A unique identifying number.     private final int number;     // A description of the batch.     private String description;     // The current highest offer for this batch.     private Offer highestOffer;     /**      * Construct a BeerBatch, setting its number and description.      * @param number The batch...
Q1- Given a set S = {1, 2, . . . , n} of players, with...
Q1- Given a set S = {1, 2, . . . , n} of players, with skill levels a1, a2, . . . , an, we need to partition the set of players S into two teams S1 and S2 of equal total skill. The teams do not need to be of equal size. However, every player must be in exactly one team. In other words, S1 ∪ S2 = S                                        (1) S1 ∩   S2 = ∅                                                     (2) Σ ak=...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT