The near exact bin covering problem

We present a new generalization of the bin covering problem that is known to be a strongly NP-hard problem. In our generalization there is a positive constant $\Delta$, and we are given a set of items each of which has a positive size. We would like to find a partition of the items into bins. We say that a bin is near exact covered if the total size of items packed into the bin is between $1$ and $1+\Delta$. Our goal is to maximize the number of near exact covered bins. If $\Delta=0$ or $\Delta>0$ is given as part of the input, our problem is shown here to have no approximation algorithm with a bounded asymptotic approximation ratio (assuming that $P\neq NP$). However, for the case where $\Delta>0$ is seen as a constant, we present an asymptotic fully polynomial time approximation scheme (AFPTAS) that is our main contribution.


introduction
We are given a parameter ∆ > 0 (independent of the input).The input to the NEAR EXACT BIN COVERING PROBLEM (NEBC) consists of a set of n input items I = {1, 2, . . ., n} where item j is associated with its size s j ∈ (0, 1].A feasible solution is a partition of the items into subsets called bins.For a given bin (in a fixed solution) we say that the bin is near exact covered if the total size of items in the bin is at least 1 and strictly smaller than 1 + ∆.The goal function (also known as reward function or objective function) is the number of near exact covered bins.Our problem NEBC is to find a partition of the item set into bins so as to maximize the goal function.We refer to the variant of NEBC where ∆ is given as part of the input as ∆-NEBC.
We focus on the offline settings of the problem and study it with respect to the criterion of asymptotic approximation ratio defined as follows.Given an algorithm A and an input I we denote by A(I) the goal function value of the solution output by A. We denote by OPT an (exponential-time) algorithm that computes an optimal solution for our problem.We say that a polynomial time algorithm ALG is a ρ asymptotic approximation algorithm for NEBC if lim sup I:OPT(I)→∞
In many cases it is easier to establish a stronger upper bound on the reward of the algorithm, and it is well-known that if there exists a constant C such that for every instance I we have then ALG is a ρ asymptotic approximation algorithm.We refer to the value of ρ as the asymptotic approximation ratio of algorithm ALG.An asymptotic polynomial time approximation scheme (APTAS) is a family of algorithms such that for every ε > 0, the family contains an algorithm ALG ε that is an 1 + ε asymptotic approximation algorithm.In this family the constant C in the stronger definition of asymptotic approximation ratio may depend on ε.If we require that the time complexity upper bound on ALG ε is polynomial of the input encoding length and 1/ε, then the family is referred to as an asymptotic fully polynomial time approximation scheme (AFPTAS).Next, we describe the connection of NEBC to the bin covering problem that was studied in the literature.The special case of NEBC where ∆ = 1 is equivalent to the bin covering problem.This equivalence means that a solution to one problem can be transformed to the other problem and vice versa.The definition of bin covering allows bins of total size larger than 2 (and they are still considered to be covered) but since the reward for such a bin is 1, we can delete one item at a time (to be packed in a dedicated bin) from such a bin and create a solution to NEBC with at least the same value.On the other hand, a solution to NEBC is a feasible solution for the bin covering problem with at least the same reward.The bin covering problem was suggested in [1,2].They proved that the greedy algorithm (which simply keeps putting items into the same bin until it is covered and then moves on to the next bin) has an asymptotic approximation ratio of 2. This is best possible for online algorithms as shown by [10].Moreover, two more offline algorithms were derived with asymptotic approximation ratios 3  2 and 4 3 , respectively.Most relevant to our work Csirik, Johnson, and Kenyon [9] designed an elegant APTAS for bin covering.The running time of this asymptotic scheme was improved into an AFPTAS by Jansen and Solis-Oba [23].Since NEBC is a generalization of the bin covering problem, our AFPTAS for NEBC will use some of the techniques of [9,23].Additional algorithmic results established for the bin covering problem and variants of it appear in e.g.[7,8,25,12,13,19,6,21,16,17,3,5].
For the bin covering problem we have the following motivating application.Assume that we have a food producer that sells its product as containers.The product has a minimum weight per container, and the goal of the producer is to maximize the number of packed containers that meet this minimum weight constraint.With this application in mind, the bin covering problem is the case where there is no upper limit on the weight of a container.Obviously, the producer has certain packages used for packing the product that cannot be over-packed.This requires an upper bound on the total weight of the packed containers, so we get an instance of NEBC.
In the bin packing literature where the total size of items packed into a bin must be at most 1 we refer to [15,24] for an AFPTAS.The variant where the cost of the bin depends on the total size of items packed into the bin, is called bin packing with bin utilization cost.For this variant under the condition that the cost function is monotone non-decreasing there is an AFPTAS established in [14].Note that in NEBC the reward of a bin is not a monotone function of the total size of items packed in the bin.
Paper outline.In Section 2 we consider a variant of NEBC where ∆ = 0, and show that this variant does not admit an approximation algorithm with a bounded asymptotic approximation ratio.This result also implies the same hardness of approximation for ∆-NEBC as we show in Section 2.Then, we turn our attention to designing an AFPTAS for NEBC that is our main contribution.We start our exposition of this result in Section 3 where we discuss some initial steps and mainly describe the main guessing step allowing the algorithm to partition the instance into two subproblems that can be solved independently.Then, in Section 4 we approximate the first subproblem, and in Section 5 we approximate the second subproblem.The novelty of our scheme is mainly in the guessing step allowing the algorithm to partition the problem into two independent subproblems.

Hardness of approximation of ∆-NEBC
We define the MAXIMUM EXACT PARTITION problem denoted as MEP.Specifically, MEP is the variant of NEBC with ∆ = 0. Observe that the standard reduction from 3-partition to bin packing implies that MEP is NP-hard in the strong sense.Furthermore, the standard reduction from partition implies that in MEP it is NP-hard to distinguish between instances in which the optimal value is at least 2 and instances in which the optimal value is zero.Note that in instances of MEP where all items have sizes larger than 1 t+1 (for a constant value of t) there is a t 2 + ε approximation algorithm for every ε > 0 by [20].Thus, the proof of our next inapproximability result needs to be based on instances where some of the items are small.Theorem 1. Unless P = N P , for every constant value of ρ, problem MEP does not admit a polynomial time algorithm ALG with an asymptotic approximation ratio that is at most ρ.
Proof.Assume by contradiction that the claim does not hold for a constant ρ.So there is a polynomial time algorithm ALG for MEP with an asymptotic approximation ratio that is not larger than ρ.Without loss of generality, ρ is an integer (otherwise, we can increase ρ to an integer).By definition of lim sup, we know that there is a positive integer T such that if OPT(I) ≥ T , then ALG(I) ≥ OPT(I) ρ+1 ≥ T ρ+1 , whereas if OPT(I) = 0, then ALG(I) = 0. Note that T is a constant defined by the performance guarantee of ALG.Thus it suffices to show that deciding if OPT(I) is exactly zero is NP-complete even if we assume that if OPT(I) > 0 then OPT(I) ≥ T .We show this claim via reduction from the partition problem.
Let a 1 , a 2 , . . ., a n be positive integers such that n i=1 a i = 2B where B is an integer.The partition problem asks if there is a subset S ⊆ {1, 2, . . ., n} such that i∈S a i = B.The partition problem is known to be NP-complete [18].Given such an instance to the partition problem we consider the following instance to MEP.
For j = 1, 2, . . ., T , we have n + 1 items which will be referred to as generation j items.The first n items of generation j have sizes a i,j = a i (3B) j , i = 1, 2, . . ., n and the last item of generation j has size We say that item (i, j) is the i-th item of generation j (the one of size a i,j ).This defines the instance of MEP.Note that a i,j > 1/2 if and only if i = n + 1 (for all j).We argue next the following two claims.The first claim is that if the partition instance is a YES instance, then the optimal solution value of the instance of MEP is at least T .The second claim is that if the partition instance is a NO instance, then every feasible solution of the instance of MEP has a zero reward.
Assume first that the partition instance is a YES instance.Let S ⊆ {1, 2, . . ., n} be an index subset such that i∈S a i = B.For every generation j, the items of generation j are packed as follows.We have one exact bin of generation j with the items (i, j) for all i ∈ S ∪ {n + 1}.The other items of generation j are packed into dedicated bins (one bin per item).The total size of the items in the exact bin of generation j is where the last equality holds as i∈S a i = B.So indeed the objective function value of our solution for MEP is at least T .
Next, assume that the partition instance is a NO instance.Assume by contradiction that there is a feasible solution with at least one bin denoted as B whose items have total size exactly 1.Consider the set of items packed into B then by definition it has at most one item of size larger than 1/2.However, since T j=1 n i=1 a i,j < 1, B must have exactly one item of size larger than 1/2.Assume that it is item (n + 1, j), that is, the last item of generation j.
We claim that all items packed in B are of generation j.First assume that there is an item (i, j ′ ) of generation j ′ < j packed into B, then a i,j ′ ≥ 1 (3B) j ′ > 1 − a n+1,j .So the total size of items in B is strictly larger than 1 that contradicts our assumption on B. Thus, all items packed into B are of generation at least j.Next, observe that all items of generations strictly larger than j which are smaller than 1/2 have total size However, the size of every item of generation j is an integer multiple of 1 (3B) j .Thus, B must contain items of a common generation j.We let By definition of B and S, we conclude that i∈S a i = (3B) j i∈S a i,j = B. Therefore, the partition instance is a YES instance after all, contradicting our assumption.Therefore, such a bin B may not exist.

⊓ ⊔
Observe that in the last proof, if we use ∆ = 1 (3B) T +1 , we get an instance of ∆-NEBC where the binary encoding length of ∆ is upper bounded by a polynomial in the binary encoding length of the items in this instance.In the resulting instance of ∆-NEBC whenever a near exact covered bin exists it must have items of total size exactly 1.This property holds as all items have sizes that are integer multiples of 1 (3B) T .Therefore, the last hardness of approximation claim holds even for ∆-NEBC.We summarize this conclusion in the following theorem.
Theorem 2. Unless P = N P , for every constant value of ρ, problem ∆-NEBC does not admit a polynomial time algorithm with an asymptotic approximation ratio that is at most ρ.
3 The initial steps of the AFPTAS for NEBC Let ε > 0 be such that we would like to get an algorithm with an asymptotic approximation ratio (1 + ε) c for a constant c for NEBC whose time complexity is upper bounded by a polynomial in the input encoding length and in 1 ε .Without loss of generality we assume that ε ≤ 1 12 and that 1 ε is an integer.We define δ > 0 to be the largest value satisfying δ ≤ ∆ 4 for which 1 δ is an integer.Then δ ≥ ∆ 8 and since ∆ is a positive constant, so does δ.
Our scheme has an initial item classification step followed by a characterization of near optimal solutions.This characterization motivates a guessing step that basically separates the input into two parts.One part of the input is handled using the methods of [15,24] developed for the bin packing problem (see Section 4).Whereas the second part of the input is tackled using the methods of [9,23] for the bin covering problem (see Section 5).The novelty of our approach lies in the characterization of the near optimal solution together with the resulting guessing step.We turn our attention to the description of the necessary background for presenting the characterization of the optimal solution.

The initial classification of items into huge and non-huge items
We say that an item j whose size is s j is a huge item if s j ≥ δ, and otherwise it is a non-huge item.The set of huge items is denoted as H, the set of all items is denoted as I, so the set of non-huge items is I \ H.
We partition H into classes based on the following rule.The item set H ψ (for ψ ∈ {0, 1, . . ., Observe that this is indeed a partition of H, and we say that H ψ is class ψ of huge items that consists of |H ψ | items.The index set of classes is denoted as Ψ .Furthermore, we assume that each such class is sorted in a non-decreasing order of sizes of items in this class breaking ties based on decreasing indexes.For example, when we say the 5-th item in the class we refer to this sorting.
To motivate this classification, consider a bin B whose items have total size between 1 and 1 + ∆.Consider the operation of replacing its huge items by another set of huge items such that for every class of huge items, the new set has the same number of items as B used to have in the original solution.After applying this operation, the total size of items in B changes by at most 2δ 2 .This holds as B has at most 2 δ huge items and each of which is replaced by an item whose size differ by at most δ 3 .Furthermore, the number of classes of huge items is a constant.

Characterization of nice solutions
Next, we would like to show that every feasible solution SOL for NEBC can be transformed into a new solution SOL-NICE satisfying the following.SOL-NICE has an objective function value not significantly smaller than the objective function value of SOL and SOL-NICE has the characterization named being a nice solution with a certificate vector.This characterization enables the next guessing step of our scheme.Definition 1.A solution SOL-NICE for NEBC is a nice solution with a certificate vector (v ψ , u ψ ) ψ∈Ψ if there is a partition of the near exact covered bins in SOL-NICE into two sets called type 1 and type 2 bins such that the following properties hold.
5. Last, for every ψ ∈ Ψ , the following two conditions are satisfied.The number of items of H ψ packed into near exact covered bins in SOL-NICE of type 1 is at least Furthermore, the number of items of the class packed into near exact covered bins of type 2 in SOL-NICE is at least Lemma 1.Given a feasible solution SOL, there exists another feasible solution SOL-NICE with some certificate vector (v ψ , u ψ ) ψ∈Ψ that is a nice solution whose objective function value is at least (1 − 2ε) times the objective function value of SOL.
Proof.Consider SOL.For every bin B of SOL that is not near exact covered, we pack every item of the bin in a dedicated bin.This operation does not decrease the objective function value of the solution.Next, if a bin B of the resulting solution is near exact covered, but has items of total size at least 1 + δ, we can assume without loss of generality that this bin has only huge items.This is so as otherwise we remove one non-huge item at a time and pack this item into a dedicated bin until the first point in time where either the total size of the remaining items in B is smaller than 1 + δ, or there are no further non-huge items in B. We apply this operation as long as there are such near exact covered bins.This process does not decrease the number of near exact covered bins and create a solution satisfying the required property.Let SOL ′ be the resulting solution.
Next we partition the set of near exact covered bins in SOL ′ .We say that a near exact covered bin B is a type 1 bin if the total size of its items is at least 1 + 2δ and otherwise it is a type 2 bin.Note that at this point SOL ′ satisfies the first two properties of nice solutions.In order to obtain a nice solution we apply the following procedure for every class ψ of huge items.
For every ψ, we count the number of huge items of class ψ that SOL ′ packs into bins of type 1 denoted as vψ and the number of such items that SOL ′ packs into bins of type 2 denoted as ûψ .Our next step is to form an initial certificate vector (v ′ ψ , u ′ ψ ) ψ∈Ψ .This initial certificate vector will be modified later to the certificate vector that we will use for the proof of the lemma.The value of v ′ ψ (u ′ ψ , respectively) is the largest value in the set holds for all ψ ∈ Ψ .Our certificate vector will be component-wise not larger than the initial certificate vector so this required property will be satisfied.
We apply the following process in which we process every class H ψ of huge items.In this process we say we delete a near exact covered bin and we mean that all its items are packed into dedicated bins and the number of near exact covered bins is decreased by 1.If v ′ ψ < vψ we delete up to εδ 3 times the number of bins of type 1 in SOL ′ containing items of this class where we delete one such bin at a time until the first time when the number of items in such non-deleted bins decreases to be at most v ′ ψ where the bins are sorted in non-increasing order of items of this class.Similarly, if u ′ ψ < ûψ , we delete up to εδ 3 times the number of bins of type 2 in SOL ′ containing items of this class where we delete one such bin at a time until the first time when the number of items of H ψ in such non-deleted bins decreases to be at most u ′ ψ where the bins are sorted in non-increasing order of items of this class.Then, we move to the next class of huge items.Note that at later iterations we may delete additional bins containing items of the class.We denote by SOL ′′ the resulting solution.Observe that whenever we process a class, we may delete up to 2εδ 3 times the number of near exact covered bins in SOL ′ .So in total we may decrease the objective function value by at most 2ε times the objective function value of SOL ′ .In later steps we will not decrease the number of near exact covered bins so the output solution will have an objective function value that is at least (1 − 2ε) times the objective function value of SOL.
At the end of this step, we set v ψ (u ψ ) to be the smallest value in the set at least the number of items of class ψ contained in (remaining) bins of type 1 (and 2, respectively).Observe that this last step cannot increase the values of the certificate vector, so properties 4,5 in the definition of nice solutions will be satisfied using this certificate vector.Then we identify the set S(ψ, 1) of v ψ last items of class ψ.Whenever a type 1 bin contains items of this class that do not belong to S(ψ, 1), we remove such items from the bin leaving space for items of class ψ and add items from S(ψ, 1) to this bin (among the items which are not used to be packed in near exact covered bins of type 1).Similarly, we let S(ψ, 2) be the set of u ψ first items of class ψ.Whenever a type 2 bin contains items of this class that do not belong to S(ψ, 2), we remove such items from the bin leaving space for items of class ψ and add items from S(ψ, 2) to this bin (among the items which are not used to be packed in near exact covered bins of type 2).In both cases the number of items of each class in every bin is left without modification.This process does not hurt the properties 2,4,5.Property 3 is trivially satisfied and it remains to take care of the first property.We denote by SOL-NICE the resulting solution and we consider the first property.Before this last step occurred every bin of type 1 had items of total size at least 1 + 2δ and less than 1 + ∆, and we replace up to 2 δ huge items by other huge items of a common class.Each such replacement can only decrease the total size of items in such bin and such a decrease is not larger than δ 3 .Therefore, the total size of items in such bin is at least 1 + 2δ − 2δ 2 > 1 + δ and at most 1 + ∆.Similarly every bin of type 2 had items of total size at most 1 + 2δ and at least 1, and we replace up to 2 δ huge items by other huge items of a common class.Each such replacement can only increase the total size of items in such bin and such an increase is not larger than δ 3 .Therefore, the total size of items in such bin is at least 1 and at most 1 + 2δ + 2δ 2 < 1 + 3δ.So the first property of nice solutions is satisfied as well.

Guessing the certificate vector and partitioning the input into independent problems
We fix a nice solution whose objective function value is maximized.We let OPT-NICE be this solution.
Our guessing step is to guess the certificate vector (u ψ , v ψ ) ψ∈Ψ corresponding to OPT-NICE (or one such certificate vector if its identity is not well-defined).By the term guess, we mean that the next steps of our scheme will be applied for every possible value of the guessed certificate vector, each of which will lead to a feasible solution, and at the end of the scheme we will output the solution with the maximum objective function value breaking ties arbitrarily.In the analysis of our scheme we analyze the iteration of this exhaustive enumeration in which we have used the vector corresponding to OPT-NICE.We next show that this exhaustive enumeration has a polynomial number of iterations for fixed ∆.

Lemma 2. The number of iterations of the exhaustive enumeration loop implied by the guessing step is
Proof.We have that the number of components in the certificate vector is O( 1 δ 3 ).Each such component is a non-negative integer that is at most max ψ |H ψ | ≤ n and it is a rounded value of an integer power of 1+ε•δ 3 .Therefore, the number of possible values for each component is at most 2 + log 1+ε•δ 3 n = O( log n ε ) using ∆ 8 < δ < ∆ ≤ 1 and by the fact that ∆ is a constant.Therefore, the number of possible certificate vectors is We define two disjoint subsets of items.The first subset of items consists of items that may belong to bins of type 1 in OPT-NICE and the second subset consists of items that may belong to bins of type 2 in OPT-NICE.The first subset has for every ψ ∈ Ψ the last v ψ items of the class (and this subset has no nonhuge items).The second subset consists of all non-huge items and the first u ψ items of every class ψ of huge items.We denote by I 1 and I 2 the two inputs to our problem where in I k the items are of the k-th subset.By the fourth property in the definition of nice solutions we conclude that the two subsets are disjoint.Our algorithm will find a feasible solution APX 1 for I 1 and a feasible solution APX 2 for I 2 .Then, the output of our scheme is the union of the bin sets of these two solutions and its objective function value is the sum of the objective function value of APX 1 and the objective function value of APX 2 .
For the sake of our analysis, for I 1 we consider a solution that maximizes the number of bins with items of total size in [1 + δ, 1 + ∆) subject to the constraint that for every ψ ∈ Ψ at least v ψ 2 items of class ψ are packed in such bins.We refer to both the solution and the number of those bins in this solution by OPT 1 .Similarly, for I 2 we consider a solution that maximizes the number of bins with items of total size in [1, 1 + 3δ) subject to the constraint that for every ψ ∈ Ψ the number of items of class ψ that are packed in such bins is at least u ψ 2 .We refer to both the solution and the number of those bins in this solution by OPT 2 .Then, we have the following observation by the fact that OPT-NICE is an optimal nice solution.

Observation 3 The number of near exact covered bins in
Thus, by definition the following holds.Assume that we can find such APX 1 , APX 2 in polynomial time, such that (1 − κε)OPT 1 + C 1 ≤ APX 1 and (1 − κε)OPT 2 + C 2 ≤ APX 2 for a given constant κ that is not a function of ε or δ, and for given constants C 1 and C 2 (that may depend on ε, δ).Then we obtain an AFPTAS for NEBC.This scheme has an asymptotic approximation ratio of 4 Approximating I 1 Here, we apply a method similar to the AFPTAS's for the bin packing problem [15,24].These methods are based on linear grouping of the items, formulating a set of so-called bin configurations, solving a linear program for deciding how many bins are packed with each configuration, and then round up the resulting fractional solution.Most applications of this procedure invoke an approximated separation oracle to the dual linear program and use this approximated separation oracle to approximately solving the (primal) linear program.Here we simplify this step using the assumption that every item has size at least δ ≥ ∆ 8 where ∆ > 0 is a fixed constant.Using this simplification, we solve exactly the primal linear program without using this mechanism of [24].When we consider I 1 with respect to OPT 1 we say that a bin is a good bin if the total size of its items is in [1 + δ, 1 + ∆).

Linear grouping of each class of huge items
For every ψ ∈ Ψ , we apply linear grouping of H ψ into 1 ε 2 δ subsets.That is, for every ψ, if there are strictly less than 1 ε 2 δ items of class ψ in the input I 1 , then every item of the class has its own set in the collection of sets H α ψ for α = 1, 2, . . ., 1 ε 2 δ , and no rounding is applied so the rounded up size of an item in the class equals its size.Furthermore, we assume that H 1 ψ = ∅, and for α ≥ 2, the set H α ψ contains the α − 1-th largest index item of the class, and if there is no such item, then the last set is the empty set.
If for the given value of ψ we have at least 1 ε 2 δ items of class ψ in the input I 1 , then we require the following.First, Second, the indexes of the items in H 1 ψ are the largest ones in the class, the indexes of the items in H 2 ψ are the next largest ones in the class, and so on.In this case, we apply rounding and we let the rounded up size of an item of the class to be the largest size of an item in its subset.
Observe that for every ψ we have 1 be a solution for the input items in I 1 where the size of each item is its rounded up size such that OPT ′ 1 maximizes the number of good bins.The use of the linear grouping to approximate I 1 is motivated by the following lemma.In what follows we will approximate OPT ′ 1 .
Lemma 3. We have Furthermore, let SOL be a feasible solution to the rounded instance whose number of good bins is also denoted as SOL.Then, packing each item of the original (nonrounded) instance exactly as in SOL, results in a solution whose number of near exact covered bins is at least SOL.
Proof.First, consider the second part of this lemma.This claim holds as every good bin B of SOL (in the rounded instance) has at most 2 δ (huge) items of I 1 .Thus, when we compute the difference in the total size of items in B with respect to the rounded up size and with respect to the size, then this difference is nonnegative and at most 2 δ • δ 3 .Therefore, if B was one of the good bins in SOL of total (rounded up) size in Thus, in this case B is a near exact covered bin in this solution of the original instance.This suffices for this claim.It remains to prove the inequality We consider the solution OPT 1 and construct a feasible solution for the rounded instance based on OPT 1 .For a bin B whose total (original) size of items is either at most 1 + 3δ or at least 1 + ∆, we leave the items in B as they were in OPT 1 .Next, we claim that the number of those bins with total size in [1 + δ, 1 + ∆) is at least their number in OPT 1 .This is so because by rounding up the size of each item we can only increase the total size of items, and since we round the size of an item to a size of another item in the same class, such an increase is not larger than δ 3 .Using the fact that B has at most 2/δ items this last claim holds.Consider the other bins, and we refer to such bin as free bin whose items are called free items.
Next, for the purpose of this proof we re-index the items of every class so that the free items appear first (sorted by the original index of the items in the class) and only afterwards the non-free items.We repack the free bins as follows.For a class ψ that has less than 1 ε 2 δ items we do not change the assignment of the items of the class (there is no rounding of such class) and we say that every item of the class is replaced by itself.For other classes, we apply the following process.For a free item of class H ψ whose index (in the class) is i, we pack it in the bin of OPT 1 that used to have the item of index i − ⌈2ε 2 δv ψ ⌉ in this class.We say that item i − ⌈2ε 2 δv ψ ⌉ is replaced by i.Note that the rounded size of i − ⌈2ε 2 δv ψ ⌉ is at most the (original) size of i.If i − ⌈2ε 2 δv ψ ⌉ ≤ 0 (meaning there is no such item), then we pack i in a new dedicated bin.We have that if a bin B in OPT 1 has only items that are replaced by items, then the total rounded up size of the replacing items of B (in the new solution) is at most the total original size of items in B and this is at most 1 + ∆.On the other hand, every such replaced item has a size that is at most δ 3 smaller than the item it replaces.Since B has less than 2 δ items, the total (rounded) size of the items of the bin after this replacement is not smaller than 1 + 3δ − 2 δ • δ 3 > 1 + δ.It remains to show that the number of free bins containing items that are not replaced by other items is at most εOPT 1 .First note that every good bin of OPT 1 has at most 2 δ items out of at least ψ∈Ψ v ψ 2 items that participate in such bins.Therefore, Second, for a class ψ, the number of items that are not replaced is at most ⌈2ε 2 δv ψ ⌉ ≤ 2ε 2 δv ψ + 1.But such items exist only if ε 2 δv ψ ≥ 1 so we have at most 3ε 2 δv ψ such items of class ψ.Thus, by summing over all classes, we have at most ψ∈Ψ 3ε 2 δv ψ such items.This is also a valid upper bound on the number of free bins containing an item that is not replaced.Finally, we have where the last inequality holds using ε ≤ 1 12 .⊓ ⊔

The configuration LP
We define a bin configuration to describe a packing of one bin.These bin configurations are used next to formulate the so-called configuration integer program that directs our algorithm.We would like to approximate OPT ′ 1 and consider the instance with item set I 1 where the size of every item i is the rounded up size of the item s ′ i , i.e., the rounded-up instance.Our goal is to maximize the number of good bins.
Formally, a bin configuration is a multi-set of sizes of items in the rounded up instance where the total size of items in this multi-set is strictly less than 1 + ∆.Since the size of every item in this instance is at least δ, each multi-set of items described by a configuration has at most 2 δ items.Furthermore, we say that a bin configuration has a unit reward if the total size of its items is in [1 + δ, 1 + ∆) and otherwise it has zero reward.Next, we prove that there is polynomially many bin configurations (for a fixed value of δ).Lemma 4.There are at most ( 1 ε 2 δ 4 + 1) 2/δ bin configurations.
Proof.In the rounded-up instance the number of different sizes is at most 1 ε 2 δ 4 .We consider the items in a bin configuration as a sequence containing 2 δ positions.In such sequence the i-th position is the index (in the list of sizes) of the size of the i-th item in the sequence where if no such item exists, then the corresponding position is 0. In total there are exactly 2 δ positions and each of which is described as a non-negative integer that is at most 1 ε 2 δ 4 .So the claim holds.

⊓ ⊔
Observe that this last bound on the number of bin configurations is polynomial (of a constant degree) in 1 ε and independent of the input encoding length.So in order to design an AFPTAS we can have a step whose time complexity is polynomial in the number of bin configurations.Next, we formulate the configuration integer program.
For this formulation we treat a bin configuration as a vector of non-negative integers where the i-th component of the vector is the number of items of the i-th size in the multi-set described by the configuration.We let C denote the set of all bin configurations.The decision variable x c for a configuration c ∈ C is the number of bins with configuration c.For the i-th size in the input we denote by c i the i-th component of configuration c ∈ C and by ν i the number of items in the rounded up instance of this size.We denote the subset of C consisting of all configurations with unit reward by C 1 .We denote by σ the index set of sizes of items in the rounded up instance.The configuration integer program is the following integer program.
The number of decision variables is the number of bin configurations that is at most ( 1 ε 2 δ 4 + 1) 2/δ .The number of constraints (excluding the non-negativity constraints) is |σ| ≤ 1 ε 2 δ 4 .The configuration LP is the linear programming relaxation obtained from the above integer program by allowing the variables to be non-integers.
Our algorithm formulates the configuration LP and solves it (optimally) using the ellipsoid algorithm or another polynomial time algorithm for solving linear programs.This step runs in polynomial time as the dimension (i.e., the number of decision variables) and the number of constraints are upper bounded by a polynomial in 1 ε .The maximum encoding length of a number that appears in this linear program is O(log n).Therefore, the polynomial time algorithms for solving a linear program runs in time that is upper bounded by a polynomial in 1  ε times a polylog in the number of items n.Furthermore, we can assume that this algorithm outputs a basic optimal solution (by applying a basis-crashing algorithm like [4]).We denote an optimal basic solution of this linear program by x * .We have that OPT ′ 1 ≤ c∈C 1 x * c as we show next using the fact that OPT ′ 1 defines an integer feasible solution to the configuration LP.
Lemma 5. We have Proof.Based on OPT ′ 1 we define a bin configuration for every bin of this solution, that is, the multi-set of sizes packed into this bin.Observe that without loss of generality every bin in this solution has items of total size less than 1 + ∆, so indeed there is a configuration in C with this multi-set of sizes.Then, we set the integer feasible solution x o as follows.For every c ∈ C, the value of x o c is the number of bins in the solution OPT ′ 1 with configuration c.Since every item is packed into exactly one bin, the constraint c∈C c i • x c = ν i is satisfied for all i ∈ σ.Thus, indeed x o is a feasible integer solution for the configuration LP.Its objective function value as a solution to this linear program is exactly OPT ′ 1 .The claim holds as x * is an optimal solution for the linear program.

⊓ ⊔
We let x ′ c = ⌊x * c ⌋ for all c ∈ C. We pack a subset of items based on this integer vector x ′ using the following process.For every c ∈ C we have x ′ c bins packed according to c.For each such bin B packed according to c and every size i ∈ σ, we pick c i items of the i-th size and pack them into B.These picked items are not picked to other bins.We have enough items of each size as c is non-negative for all c ∈ C and holds for all i ∈ σ.Additional items that were not packed by this process are packed into dedicated bins and do not contribute to the objective function value of x ′ .In this way we output a feasible solution APX 1 satisfying the required performance guarantee as we establish next.
Lemma 6.We have Proof.We have the following.
where the first inequality holds as x * is a basic optimal solution for the linear program, the second inequality by Lemma 5, and the last inequality by Lemma 3.
⊓ ⊔ 5 Approximating I 2 Here, we will say that a bin B is a good bin if the total size of items in B is in the interval [1, 1 + 3δ).Recall that OPT 2 is a solution maximizing the number of good bins among all solutions that for every ψ have at least u ψ /2 items packed in good bins.We have that without loss of generality every good bin in OPT 2 that has a non-huge item have items of total size in [1, 1 + δ), and there is at most one bin that is not a good bin containing non-huge items.To see the first observation we can repack one non-huge item placed in a good bin with items of total size larger than 1 + δ into a dedicated bin, and repeat as long as this first property does not hold.To verify the second observation, move all non-huge items packed into bins that are not good bins, into one bin.This process cannot decrease the number of good bins and satisfy the second property.If the first property stops to hold, we partition this one new bin into several ones, where at most one of these new bins is not a good bin.
Additional guessing step.Our first step is to guess the value of β defined as the number of good bins in OPT 2 containing non-huge items.Since β is a non-negative integer not larger than the number of non-huge items and in particular β ≤ n, we can enumerate all possibilities for the value of β.For each such possibility, we construct a feasible solution for our problem instance (see below).Last we choose the best feasible solution (among all iterations of the exhaustive enumeration implementing this guessing step).In what follows, β is the value of the guessed information.
Another classification of items.We let X denote the set of non-huge items.We sort the items in X in a non-increasing order of size (breaking ties based on the index of the item).We classify the items in X as follows.The first min{|X|, ⌈ β+1 ε ⌉} items in the sorted list of X are large items, and we let L = H 0 be the set of large items.As will be clear later on, we also let L be the class 0 of huge items (although they are not huge items).The next β items in the sorted list are medium items and their set is denoted as M .Last, the remaining items are small items whose set S is S = X \ (L ∪ M ).If |X| − |L| < β, then M = X \ L and S = ∅.Furthermore, we let Ψ ′ = Ψ ∪ {0} be the set of classes of huge items including the class 0 containing the large items, and we let H ′ = H ∪ L.

Linear grouping of each class in H ′ and excluding the items in M
We apply a linear grouping step similar to [9,23], that is, this time the rounded size will be rounded down value and not rounded up as we did when approximating I 1 .For every ψ ∈ Ψ ′ we apply linear grouping of H ψ into 1 ε 2 δ subsets.That is, for every ψ, if there are strictly less than 1 ε 2 δ items of class ψ in the input I 2 , then every item of the class has its own set in the collection of sets H α ψ for α = 1, 2, . . ., 1 ε 2 δ .In this case, no rounding is applied so the rounded down size of an item in the class equals its size and we assume that If for the given value of ψ ∈ Ψ ′ we have at least 1 ε 2 δ items of class ψ in the input I 2 , then we will require that and that the indexes of the items in H 1 ψ are the largest ones in the class, the indexes of the items in H 2 ψ are the next largest ones in the class, and so on.In this case, we apply rounding and we let the rounded down size of an item of the class to be the smallest size of an item in its subset.Observe that for every ψ, we have

We denote by s ′
i the rounded down size of item i and for item in S ∪ M we let the rounded down size of the item be its size.For a subset of items Λ we let s(Λ) = i∈Λ s ′ i be its total rounded size.Furthermore, we allow the algorithm to pack temporarily the items in S fractionally.That is, we treat the small items as fluid or sand of total size s(S), and every bin may pack an arbitrary sized sand as long as the total size of the packed sand is not larger than s(S).We define the rounded down instance of the problem as the input with item set I 2 \ M , the size of every item is the rounded down size of the item, and sand of total size s(S) that can be packed fractionally.
Let OPT ′ 2 be a solution for the rounded down instance such that OPT ′ 2 maximizes the number of good bins subject to the constraint that the number of good bins with non-zero sand is at most β.The use of the linear grouping to approximate I 2 is justified by the following two lemmas.Lemma 7.There is a polynomial time algorithm accomplishing the following task.The input consists of a solution SOL ′ for the rounded-down instance whose number of good bins is SOL ′ where we assume that the number of good bins with non-zero space for sand in SOL ′ is at most β.The output is a solution to the original instance I 2 whose number of near exact covered bins is at least SOL ′ .
Proof.First, we consider the packing of huge or large items in SOL ′ , that is of the original sized items and without modifying the allocated sand for each bin.We identify the set ζ of good bins in SOL ′ containing non-zero space for sand (as a solution to the rounded down instance).Consider a bin B in the resulting solution, and we show that if B was a good bin in SOL ′ , then either B is a near exact covered bin in the resulting solution, or we can can repack some of the large items used to be packed into B (and move these repacked items into dedicated bins), so that the resulting bin of the items and sand left in B is near exact covered.Thus, the upper bound of β on the number of good bins containing sand will continue to hold.
Since the rounding of items was rounding down and B was a good bin in the rounded down instance, the total (original) size of its items and sand, whose size is not modified, is at least 1.If B has no large items, then it has at most 2 δ items plus some additional sand, and the maximum difference between the original size of an item and its rounded-down size is at most δ 3 .Since B was a good bin, its total rounded-down size is smaller than 1 + 3δ.Using the fact that the total size is at most 1 + 3δ + 2 δ • δ 3 < 1 + ∆, the claim follows.Next, consider the case where some items in B are large.If the total size of the items in B is less than 1 + ∆, then we are done.Otherwise, we start deleting from B the large items, one after the other.The process stops either once there are no large items, or when the total size of the items and sand left in B is less than 1 + ∆.By the proof of the case where the original bin had no large items, we conclude that when the process ends it must be the case that the total size of the items and sand left in B is less than 1 + ∆.
At this point, the set ζ contains all good bins with non-zero sand and by the assumption of the lemma, ζ has at most β bins.Our next goal is to replace the sand in the bins of ζ by the items in S ∪ M , so that the number of near exact covered bins will not decrease.First, note that we can decrease the amount of packed sand in some good bins to ensure that if a good bin has non-zero sand, then its total size of items and sand is exactly 1.With a slight abuse of notation, we let ζ be the resulting set of good bins with non-zero sand.This is a subset of the original set ζ so it has at most β bins.
We process the bins in ζ, one by one.Consider the current bin B ∈ ζ.We remove the sand from B and we start adding items from S until the first time in which the added item is about to increase the total size of items in B to be at least 1.This last item from S is not added to B and instead we add one item from M .Then, we conclude that the resulting bin has size not smaller than 1 and not larger than 1 + δ where the upper bound follows as medium items are not huge.The items that we added to B are deleted from the corresponding sets (S or M ) and we continue to process the next bin from ζ.
Observe that the total size of small items that we pack to a good bin B is not larger than the size of sand packed into B in the solution SOL ′ .Therefore, by summing over all bins in ζ, we have sufficiently many small items to pack into all bins in ζ.We have enough medium items as every bin in ζ gets one medium item and |ζ| ≤ β ≤ |M | where the second inequality holds in cases there is sand in the instance (and otherwise ζ = ∅ and this step does not exist).If the process leaves some unpacked small or medium items (after processing all bins in ζ), then we pack each such item in its own dedicated bin without modifying the number of near exact covered bins.
⊓ ⊔ Next, we consider the other direction showing that approximating the rounded down instance is sufficiently close to approximate the original instance.
Proof.We consider the solution OPT 2 and modify it in two steps.First, we consider the rounded-down instance including the items in M (the rounded down size of such item is its original size) and construct a feasible solution SOL whose number of good bins is at least (1 − 2ε)OPT 2 − 1.Then, in the second step we construct another solution for the rounded down instance without medium items whose number of near exact covered bins is at least (1 − 3ε)OPT 2 − 1.In both steps the allocation of small items is not modified and we will not use the ability to pack them fractionally when we consider the rounded down instance.Furthermore, we will say below that every small item i is replaced by itself.Consider the first step.Assume without loss of generality that in OPT 2 every bin of total size at least 1 + δ satisfies that the bin consists only of huge items (so every item has size at least δ).For a bin B whose total size of items in the original instance is either less than 1 or at least 1 + δ, we leave the items in B as they were in OPT 2 .Next, we claim that the number of those good bins is the same as it were in OPT 2 .To show this first note that by rounding down the size of each item, we can only decrease the total size of items, and since we round the size of an item to a size of another item in the same class, such decrease is at most δ 3 .Since by our assumption a good bin B has no large items and the size of small items is not modified, B has at most 2/δ huge items, and so this last claim holds.Consider the other bins, and we refer to such bin as free bin whose items are called free items.
Next, for the purpose of this proof we re-index the items of every class of H ′ so that the free items appear first (sorted by the original index of the items in the class) and only afterwards the non-free items.We repack the free bins as follows.For a class ψ ∈ Ψ ′ that has less than 1 ε 2 δ items, we do not change the assignment of the items of the class (there is no rounding of such class) and we say that every item of the class is replaced by itself.
For other classes, we apply the following process where we let u 0 = |L| be the number of large items.For a free item of class H ψ whose index (in the class) is i, we pack it in the bin of OPT 2 that used to have the item of index i − ⌈2ε 2 δu ψ ⌉, and we say that item i − ⌈2ε 2 δu ψ ⌉ is replaced by i.We note that the rounded size of i − ⌈2ε 2 δu ψ ⌉ is at least the (original) size of i.If i − ⌈2ε 2 δu ψ ⌉ ≤ 0 (meaning there is no such item), then we pack i in a new dedicated bin.
We have that if a bin B in OPT 2 has only items that are replaced by (perhaps other) items, then the total rounded down size of the replacing items of B (in the new solution) is at least the total original size of items in B and this is at least 1.On the other hand, every such replaced item has a size that is at most δ 3 larger than the item it replaces.Since the free bin B has less than 2 δ huge items, the total (rounded) size of the bin after this replacement is not larger than 1 + δ + 2 δ • δ 3 < 1 + 3δ if there are no large items in B, so this is a good bin.
Note that if there are also large items in B, then the last proof shows that the total rounded size of the replaced items of the huge and small items is less than 1 + 3δ, and we can add one large item after the other until the first iteration in which the resulting bin is a good bin.Since the size of every large item is at most δ, the resulting bin will be indeed a good bin.
It remains to show that the number of free bins containing items that are not replaced by other items is at most 2εOPT 2 + 1.First note that every good bin of OPT 2 has at most 2 δ huge items and the number of huge items participating in good bins is at least ψ∈Ψ u ψ 2 .Therefore, Second, for a class ψ ∈ Ψ , the number of items that are not replaced is at most ⌈2ε 2 δu ψ ⌉ ≤ 2ε 2 δu ψ + 1, but such items exist only if ε 2 δu ψ ≥ 1 so we have at most 3ε 2 δu ψ such items of class ψ ∈ Ψ .Summing over all such classes, we have at most ψ∈Ψ 3ε 2 δu ψ such items and this is also a valid upper bound on the number of free bins containing a huge item that is not replaced.Note that where the last inequality holds using ε ≤ 1 12 .Next consider the number of large items that are not replaced.These are at most 3ε 2 δ|L| items.By definition of L, we know that |L| ≤ β+1 ε + 1, and β ≤ OPT 2 .So the number of non-replaced large items is at most . This is a valid upper bound on the number of free bins containing large items that are not replaced.This conclude the first step where we have considered the rounded-down instance including the items in M and construct a feasible solution denoted as SOL whose number of good bins is at least In the last step of the proof, we modify SOL into a feasible solution that does not pack the items in M .We replace the medium items in SOL by large items by repacking the items of at most εβ good bins and other bins containing large items.In this repacking process every bin containing i medium items will be assigned i large items that were not packed there prior to this step.This repacking increases the total rounded size of items in the bin so it will be at least 1.However, if it becomes at least 1 + 3δ, we remove one large item after another until the total rounded size becomes less than 1 + 3δ.Thus this repacking will generate the required solution for the rounded instance.
However, we need to show that there is a set of at most εβ good bins such that together with all non-good bins contains at least |M | large items.This is so, as in OPT 2 there is a set of β + 1 bins containing all large items and |L| ≥ β+1 ε or M = ∅.By the pigeonhole principle, out of the bins of OPT 2 with large items, there is a set of εβ good bins such that together with the unique non-good bin having large items we get a subset BIN S of the bins with at least β large items.So the claim follows.

The configuration LP
We define a bin configuration to describe a packing of one bin.These bin configurations will be used to formulate the configuration integer program whose linear programming relaxation is used to direct our algorithm.Both the definition of bin configurations as well as the configuration integer program differ from the ones we have considered in Section 4 to approximate I 1 .We would like to approximate OPT ′ 2 and consider the rounded down instance.
Formally, a bin configuration is a multi-set of sizes of items in H ′ together with a non-negative allocated space for sand such that the total rounded down size of the items together with the space for sand is at most 1 + 3δ.It is clear that without loss of generality we conclude that for every bin configuration corresponding to a good bin either the space for sand is zero, or it is exactly 1 minus the total size of the items in H ′ in this bin configuration.However, for a multi-set of items of total size smaller than 1 there are two configurations, one with sand so that it is a good bin and one without sand (and in this case it is not a good bin).Therefore, the information regarding the allocated space for sand in the configuration is implied by the multi-set of items in H ′ together with one additional bit of information.Furthermore, we say that a bin configuration has a unit reward if the total size of its items and sand is in [1, 1 + 3δ) and otherwise it has zero reward.However, unlike the case of I 1 , the number of bin configurations is not polynomially bounded and we prove the following upper bound.Proof.The items in H ′ have at most 1 ε 2 δ 4 different sizes of items, and for each such size the number of items in the configuration is a non-negative integer that is at most n.Every such multi-set of items has at most two configurations where one of those has unit reward and at most one of those has zero reward.Therefore, a valid upper bound on the number of configurations is 2(n + 1) ⊓ ⊔ Observe that this last bound on the number of bin configurations is not polynomial (of a constant degree).So in order to design an AFPTAS we cannot enumerate all bin configurations.Next, we formulate the configuration integer program.Here, we consider bin configuration as a vector of non-negative integers where the i-th component of the vector is the number of items of the i-th size in the multi-set described by the configuration.We let C denote the set of all bin configurations.For c ∈ C, we let s(c) denote the space for sand in the configuration c.We denote the subset of C consisting of all configurations with unit reward by C 1 .We let σ denote the index set of sizes of items in H ′ .For i ∈ σ, let ν i denotes the number of items of (rounded down) size s i in the rounded instance.
The decision variable x c for a configuration c ∈ C is the number of bins with configuration c.For i ∈ σ, we denote by c i the i-th component of configuration c ∈ C. The configuration integer program is the integer program stated below.Here, we use the assumption that if a solution to this integer program does not use all items of a given size (or the full amount of sand in the instance), then additional items can be packed into dedicated bins without changing the objective function value.This motivates our use of inequalities (instead of equalities) in the constraints (beside the non-negativity constraints) of the configuration integer program.
The number of decision variables is the number of bin configurations.The number of constraints (excluding the non-negativity constraints) is |σ| + 2 ≤ 1 ε 2 δ 4 + 2. The configuration LP is the linear programming relaxation obtained from the above integer program by allowing the variables to be non-integers.
Our algorithm considers the configuration LP without stating its formulation, and solve it approximately within a multiplicative factor of 1 − ε using the ellipsoid algorithm via the column-generation approach of [24].We postpone the details of this step and assume that we are given a feasible solution x * to the configuration LP such that the support of x * has at most polynomial number of elements, and satisfying that for every other feasible solution x for the configuration LP, we have c∈C 1 x * c ≥ (1 − ε) • c∈C 1 xc .Furthermore, using a basis-crashing algorithm [4] we can assume that the support of x * has at most 1 ε 2 δ 4 + 2 elements.We have that (1 − ε) • OPT ′ 2 ≤ c∈C 1 x * c as we show next using the fact that OPT ′ 2 defines an integer feasible solution to the configuration LP.
Lemma 10.We have Proof.Based on OPT ′ 2 we define a bin configuration for every bin of this solution, that is, the multi-set of sizes of H ′ packed into this bin.Observe that without loss of generality every bin in this solution has items of total size at most 1 + 3δ.So indeed there is a configuration in C with this multi-set of sizes where we may have identical configurations where one copy belongs to C 1 with non-zero sand packed into it and the other copy to C \ C 1 .We pick the first such copy if the bin is a good bin in OPT ′ 2 and the second copy if it is not a good bin.Then, we let the integer feasible solution x o be defined as follows.For every c ∈ C, the value of x o c is the number of bins in the solution OPT ′ 2 with configuration c.Since every item is packed into exactly one bin, the constraint c∈C c i • x c ≤ ν i is satisfied for all i ∈ σ.Similarly the sand resulting from small items is packed once, so the constraint c∈C 1 s(c) • x c ≤ s(S) is also satisfied.Last, the number of unit reward bins with some small items in OPT ′ 2 is at most β by the guessing step.So indeed this is a feasible integer solution for the configuration LP.Its objective function value as a solution to this linear program is exactly OPT ′ 2 .The claim holds as x * is a 1 − ε approximation for the linear program.

⊓ ⊔
We let x ′ c ⌊x * c ⌋ for all c ∈ C. We pack a subset of items based on this integer solution x ′ using the following process.For every c ∈ C we have x ′ c bins packed according to c.For each such bin B packed according to c and every size i ∈ σ, we pick c i items of the i-th size and pack them into B.These picked items are not picked to other bins.We have enough items of each size as c is non-negative for all c ∈ C and Additional items of H ′ that were not packed by this process are packed into dedicated bins and do not contribute to the objective function value of x ′ .The sand is allocated only to bins where the corresponding configuration belongs to C 1 and such bin gets sand of size that is the minimum amount for which the total size of its items and sand will be at least 1.Since s(c) is non-negative for all configurations, we have c∈C Therefore, x ′ satisfies the constraints of the configuration LP.Thus, we can apply Lemma 7, and obtain a feasible solution to the original instance whose number of near exact covered bins is exactly the objective function value of x ′ to the configuration LP.We let APX 2 be the resulting solution that is a feasible solution to the original instance whose number of near exact covered bins satisfies the following lower bound.

Lemma 11. The solution APX
Proof.We have the following.
where the first inequality holds as x * is a basic solution for the linear program, the second inequality by Lemma 10, and the last inequality by Lemma 7.

⊓ ⊔
It remains to show that we can indeed solve the configuration LP within a multiplicative factor of 1 − ε in polynomial time as we prove next.

Approximating the configuration LP.
Here, we refer to the configuration LP as the primal LP.Since the dimension of this linear program is exponential in 1 ε , we consider its dual linear program and refer to it as the dual LP.This dual LP has number in the vector of decision variables c where the integer program denoted as IP 1 (ι, ι ′ ) is parameterized by two parameters ι, ι ′ .
We solve these problems for every pair of values of ι, ι ′ that are non-negative integer multiples of εδ n subject to the constraint ι, ι ′ ≤ 2. Observe that if we multiply the two constraints ( 7) and ( 8) by n εδ we get an equivalent integer program where there are only two constraints (excluding the box constraints of the form ( 9)) and the constraint matrix has only non-negative integer entries that are at most 2n εδ .Such integer programs can be solved in polynomial time (polynomial in n, 1  δ , 1 ε , |σ|) using e.g. the algorithms of [11,22].Since there are polynomial number of pairs of values (ι, ι ′ ) satisfying our conditions, we solve all these problems in polynomial time.We denote by c (ι,ι ′ ) an optimal solution for the integer program IP 1 (ι, ι ′ ).For each pair (ι, ι ′ ), we check if the configuration c (ι,ι ′ ) has total size at least 1 and less than 1 + 3δ, and if so, we check if its corresponding constraint (4) is violated.
If we found such a violating constraint, we are done.Otherwise, we argue next that all constraints of the form (4) corresponding to configurations with size in the interval [1, 1+δ) are satisfied.To see this last claim, assume by contradiction that there is a configuration c ′ ∈ C 1 with s(c ′ ) = 0 and total size in the interval [1, 1 + δ) whose corresponding constraint is violated.Let (ι, ι ′ ) be the pair for which c ′ is a feasible solution to IP 1 (ι, ι ′ ).Since c (ι,ι ′ ) is optimal for this integer program we have that i∈σ c , and so by our assumption the constraint (4) corresponding to c (ι,ι ′ ) is not violated.However, since the constraint corresponding to c ′ is violated, so ι < 1.Therefore, the constraint corresponding to c (ι,ι ′ ) is also violated.This contradicts the assumption, so the claim holds.
The approximated separation oracle for constraint (4) corresponding to configurations with size in [1 + δ, 1 + 3δ).Consider the subset of configurations c of items in H ′ with size in [1 + δ, 1 + 3δ).The motivation for the following oracle is that in this case we can round down a little bit the sizes and still get a good bin.Note the difference with the earlier case where decreasing the size of a configuration whose size was slightly larger than 1 could potentially make it smaller than 1 so the bin is no longer a good bin.
For this case, we define the modified size of an item of size s i as ŝi = ⌊ n•s i δ ⌋• δ n .Since every configuration has at most n items, we are guaranteed that if a subset of items has total size in the interval [1 + δ, 1 + 3δ), then its total modified size is in the interval [1, 1 + 3δ).So we consider the following set of integer programs denoted as IP 2 (ι, ι ′ ) in the vector of decision variables c where the integer program is parameterized by two parameters ι, ι ′ .
We solve these problems for every pair of values of ι, ι ′ that are non-negative integer multiples of εδ n subject to the constraint ι, ι ′ ≤ 2. Observe that if we multiply the two constraints (11) and ( 12) by n εδ , we get an equivalent integer program where there are only two constraints (excluding the box constraints of the form ( 13)) and the constraint matrix has only non-negative integer entries that are at most 2n εδ .Such integer programs can be solved in polynomial time (polynomial in n, 1  δ , 1 ε , |σ|) using [11,22].Since there are polynomial number of pairs (ι, ι ′ ) satisfying our conditions, we can indeed solve all these problems in polynomial time.We denote by c (ι,ι ′ ) an optimal solution for the integer program IP 2 (ι, ι ′ ).For each pair (ι, ι ′ ) we check if the configuration c (ι,ι ′ ) has total size at least 1 and less than 1 + 3δ, and if so, we check if its corresponding constraint (4) is violated.
If we found such a violating constraint, we are done.Otherwise, we argue next that all constraints of the form (4) corresponding configurations of size in the interval [1 + δ, 1 + 3δ) are satisfied.To see this last claim, assume by contradiction that there is a configuration c ′ ∈ C 1 with s(c ′ ) = 0 and total size in the interval [1 + δ, 1 + 3δ) whose corresponding constraint (4) is violated.Let (ι, ι ′ ) be the pair for which c ′ is a feasible solution to IP 2 (ι, ι ′ ) and there is such a pair of values with ι ′ ≥ 1 since every such configuration of total size in the interval [1 + δ, 1 + 3δ) has total modified size in the interval [1, 1 + 3δ).Since c (ι,ι ′ ) is optimal for this integer program we have that i∈σ c (ι,ι ′ ) i s i ≤ i∈σ c ′ i s i < 1 + 3δ.Therefore, as the size of c (ι,ι ′ ) i is at least ι ′ ≥ 1, by our assumption, the constraint corresponding to c (ι,ι ′ ) is not violated so ι ≥ 1.However, since the constraint corresponding to c ′ is violated, ι < 1 and this is a contradiction, so the claim holds.
The approximated separation oracle for constraint (3).Here, we define the modified size of an item of size s i as rounded down, namely, as ŝi = ⌊ n•s i δ ⌋ • δ n .Since every configuration has at most n items, we are guaranteed that if a subset of items has total modified size of at most 1, then its total size is at most 1 + δ.So we consider the following set of integer programs denoted as IP 3 (ι, ι ′ ) in the vector of decision variables c where the integer program is parameterized by two parameters ι, ι ′ .
We solve these problems for every pair of values of ι, ι ′ that are non-negative integer multiples of εδ n subject to the constraints that ι < 1 and ι ′ ≤ 1. Observe that if we multiply the two constraints ( 15) and ( 16) by n εδ , we again obtain an equivalent integer program where there are only two constraints (excluding the box constraints of the form (17)) and the constraint matrix has only non-negative integer entries that are at most n εδ .So it can be solved using [11,22].Since there are polynomial number of pairs (ι, ι ′ ) satisfying our conditions, we can indeed solve all these problems in polynomial time.We denote by c (ι,ι ′ ) an optimal solution for the integer program IP 3 (ι, ι ′ ).For each pair (ι, ι ′ ), we check if the configuration c (ι,ι ′ ) has total size smaller than 1, and if so, we check if its corresponding constraint (3) is violated.
If we found such a violating constraint, we are done.If we have found a constraint from the family (4) that is violated using the earlier cases, we are also done.Otherwise, we argue next that all constraints of the form (3) are satisfied.To see this last claim, assume by contradiction that there is a configuration c ′ ∈ C 1 with s(c ′ ) > 0 whose corresponding constraint (3) is violated.Let (ι, ι ′ ) be the pair for which c ′ is a feasible solution to IP 3 (ι, ι ′ ).Since c (ι,ι ′ ) is optimal for this integer program, we have that s(c (ι,ι ′ ) ) ≤ s(c ′ ), and so ι + s(c (ι,ι ′ ) ) • z 1 + z 2 ≤ ι + s(c ′ ) • z 1 + z 2 .Since the constraint corresponding to c ′ is violated, the last term is smaller than 1.Therefore, if s(c (ι,ι ′ ) ) > 0, then the constraint corresponding to configuration c (ι,ι ′ ) is also violated.If however, s(c (ι,ι ′ ) ) = 0, then using ι < 1, we get that the constraint (4) corresponding to c (ι,ι ′ ) is violated.This contradicts the assumption, so the claim holds.