Question: Suppose that we are given a set of n objects where the size $s _ i$ of the $ textit { i } $th

Suppose that we are given a set of n objects where the size $s_i$ of the $\textit{i}$th object satisfies 0 $<$ $s_i$ $<$ 1. We wish to pack all the objects into the minimum number of unit-size bins. Each bin can hold any subset of the items whose total size does not exceed 1. In other words, we are trying to find a function f: $[n]$ $\rightarrow$ $[k]$ so that $\sum_{i:f(i)=j}$ $s_i$ $\leq$ 1 for all j $\epsilon$ $[k]$, and our goal is to minimize k. Let S = $\sum_{i=1}^n$ $s_i$\\
(a) Prove that the optimal number of bins required is at least $[S]$.\\
The first-fit algorithm considers each object in turn (from 1 to n) and places it in the first bin that can accommodate it. If there is no such bin, then we create a new bin for it and make it the last bin. Note that this defines an ordering over bins based on when we created them, so "first" and "last" make sense.\\
(b) Prove that the first-fit algorithm leaves at most one bin at most half full. In other words, all bins but one are mote than half full.\\
(c) Prove that the first-fit algorithm is a 2-approximation to bin packing.\\

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