Modeling and Solving the Open-End Bin Packing Problem

In the Open-End Bin Packing Problem a set of items with varying weights must be packed into bins of uniform weight limit such that the capacity of the bin can be exceeded only by the last packed item, known as the overflow item. The objective is to minimize the number of used bins. In this paper, we present our Integer Linear Program model based on a modification of Cesili and Righini model [1]. Also, we propose two greedy heuristics to solve a problem. The first one is an adaptation of the Minimum Bin Slack heuristic where we have reduced to one unit capacity, the weight of the largest item in the current bin. While, the second heuristic is based on the well-known First Fit Decreasing heuristic. Computational results based on benchmark instances taken from the literature as well as generated instances show the effectiveness of the proposed heuristics in both solution quality and time requirement. Keywords—Open-End Bin-packing; heuristics; discrete optimization; combinatorial problem


I. INTRODUCTION
The one dimensional open-end bin packing problem (OEBPP) is a variant of the classical bin packing problem.In the OEBPP, items with varying weights are packed into identical bins such that in each bin, the total items weight content before packing the last item is strictly less than the bin capacity.The aim of the OEBPP is to minimize the number of bins used to pack all items.This problem was introduced by Leung et al. [2], where the authors proved that the OEBPP is NP-hard.Various application of this problem can be found in a wide variety of industries such as manufacturing, transportation, affectation tasks, etc.For example, in the fare payment system in the Hong Kong and Taipei subway stations, the passengers can buy a ticket of a fixed value.A machine at the entrance gateway records the ticket's value, while another machine deducts the fare from the ticket's value at the exit gateway.The machine at the exit gateway returns the ticket if the remaining balances of the ticket is positive; otherwise, it keeps the ticket.The objective from a passenger's point of view is to minimize the number of tickets they need to purchase as to minimize the number of bins generated by an algorithm.Another application can be found in job scheduling in the manufacturing environment that operates one shift per day.A worker loads jobs to a machine that can operate automatically.The objective is to schedule jobs to minimize the total time (days) to complete all the jobs.Intuitively, the job with the longest processing time is scheduled to the last to fully utilize the automated machine when the worker leaves from work, and the worker can unload the finished job next day.
Whilst, a few work carried out on this problem, we present a modification of the 0-1 linear programming formulation proposed by Ceselli and Righini [1] in which the authors studied a variant of the open-end bin packing called Ordered Open-End Bin Packing Problem (OOEBBP).Then we present our contributions based on the proposition of two greedy heuristics for solving the problem in an offline mode while ensuring high quality solutions in very short computational time compared to solving the problem in optimal way.The remainder of this paper is organized as follows.In the next Section, we present a few existing lower and upper bounds on which we based to develop our propositions.Suitable way to formulate the problem with an Integer Linear Program formulation without considering the order between items is presented in Section III.In Section IV, we describe and develop our proposed heuristics which are tested and compared by means of computational tests on benchmark instances in Section V.The last Section provides some final conclusions and directions for future work.
In the next, we assume the following notations: C: Bin capacity; I: Set of item; i;j: Index of items and bins respectively; w i : Weight or size of item i; r j : Residual capacity of bin j; S: Set of candidate items; O: Set of overflow items; R: Overall residual capacity of used bins;

II. LITERATURE REVIEW
While there exists abundant research for the classical bin packing problem (interested reader can reffered to the chapter of Coffman et al. [3] for an excellent survey of this topic), there is much less research on the OEBPP.Initially, Leung et al. [2] proposed this variant of bin packing, in which the authors modelled the ticketing system at the subway station in Hong Kong.The authors was showed that any online algorithm for the disscused problem have an asymptotic worst-case ratio of at least 2. Thereafter, Yang and Leng [4] studied the Ordered Open Bin Packing Problem which extends the requirement corresponding to the order of passenger's itinerary in subway station problem.The same problem, which is the Ordered Open-End Bin Packing Problem, have been also studied by Cesili and Righini [1] where authors present branch and price algorithm for its exact optimization.

A. Lower bounds
In this section we briefly describe two existing lower bounds from the OEBPP literature.
Ongkunaruk's lower bound: Ongkunaruk [5] presented a simple idea used to compute a lower bound for the OEBPP, it consists in determining the number of needed overflow items firstly in order to apply the continuous lower bound for the rest of items.The overflow items are those selected to be packed as the last item which exceed the capacity of bin.Generally, overflow items have a large weight.
The main target in the OEBPP is to maximize the overflow items in order to minimize the capacity of items inside bins, so minimize the number of bins used.
For do, the author order items in the non-increasing size firstly, then determine the smallest integer K which indicate the number of overflow item, using the following formula: So the lower bound of Ongkunaruk L 0 OBP can be expressed by: Ceselli's lower bound: Ceselli and Righini [1] proposed a combinatorial lower bound algorithm called in what follows CBA.This lower bound computes a set of overflow items iteratively in an optimal fractional packing by the following way; the authors define R to be the overall residual capacity of all the bins already initialized, whenever an item j is found, whose size is greater than R, a new bin is initialized and the overflow item of this bin is selected as the largest item among those already packed but not yet used as overflow items, then insert item j into the set O of overflow items in order to yield the maximum residual capacity for the next iteration.So this lower bound can be expressed by:

B. Upper bounds
Well known algorithms for the classical BPP: First Fit Decreasing(FFD) is one of the well-known algorithm often used to solve the classical BPP.Developed by Coffman et al. [3], FFD guarantees asymptotic worst case performance bounds of 11/9 [6].Let all items are sorted in the nonincreasing weight order, the FFD algorithm consist on packing the current item in the first opened bin, else, a new bin is opened.
Other effective algorithm for solving the classical BPP called Minimum Bin Slack (MBS).This algorithm was proposed by Gupta and Ho [7].At each step, an attempt is made to find a set of items that fits the bin capacity as much as possible.At each stage, a list of items not assigned yet is sorted in the decreasing order of their weights.Each time a packing is determined, the items involved are placed in a bin and removed from a set of unpacked items.Thereafter Fleszar et al. [8] proposed a variant of MBS called MBS', in which the item of maximum size is not unstuck.MBS has been used in several variants of bin packing problem, such as the bin packing problem with conflicts [9], and the variable sized bin packing problem [10].
Ongkunaruk's heuristic for the OEBPP: Ongkunaruk [5] proposed a modification of the well-known first fit decreasing algorithm for the OEBPP called Modified First Fit Decreasing (MFFD), this modification consists of determining the overflow items firstly, then apply the first fit decreasing for the rest of items not yet packed.
In MFFD, the author computes the lower bound K defined above (equation ( 2)) and considered as overflow items, the K−first large items , then apply the first fit decreasing algorithm for the remaining items i not yet packed, where i = k + 1 to n.Finally, assign the overflow items into the bins using FFD algorithm.

III. PROBLEM FORMULATION
In this section, we propose a modification of the integer linear program initially proposed by Cesili and Righini [1].The authors studied a variant of the open bin packing problem called the Ordered Open-End Bin Packing Problem (OOEBPP) in which items to be packed are sorted in a given order.For this formulation, the authors used the binary variable y i to indicate whether item i is the overflow item in its bin, and the binary variable x ij to indicate whether item i is assigned to the bin in which the overflow item is the item j.Because of the constraints on the order of the items, there is only x ij variables with i < j.Instead, for the general OEBPP (without order), we have therefore x ij decision variables with i = j.M inimize i∈N y i (4) s.t.
Each binary variable y i indicates whether item i is the overflow item in its bin.Each binary variable x ij indicates whether item i is assigned to the bin in which the overflow item is item j.Constraints (5) impose that each item must be assigned to a bin, while constraints (6) impose that the overall weight of the items assigned to a bin, excluding the overflow item, must fit into the bin and must leave at least one capacity unit available for accommodating the overflow item.The number of bins used is indicated in the objective function ( 4) by the number of binary variables y i set to 1.

A. Adapted First Fit Decreasing AFFD
In this section, we will describe our heuristic algorithm, called in the following Adapted First Fit Decreasing(AFFD).

1) Main idea:
In the open-end bin packing problem the capacity of any bin can be exceeded by only the last packed item, called the overflow item.Then, it is wise to consider the weightest items as overflow items in order to minimize the number of used bins.In this way, Ongkunaruk [5] proposed MFFD algorithm which is a modification of the FFD runway.The author determines overflow items firstly before packing, then apply first fit decreasing with bins capacity equal to C −1.
Our Proposition is an adaptation of the well-known first fit decreasing where each selected overflow item can occupy at least one unit of bin capacity.Sorted items in decreasing order of their weight, the AFFD algorithm consist on assignment of the current item i into the lowest indexed opened bin which accommodate it, else, a new bin is opened.An opened bin can receive an item i if and only if the residual capacity -without take into account the overflow item-is sufficient to contain it.In other words, an item i can be placed into an opened bin if the weight w i is less than or equal to C − 1 − j∈ I w j where I is the set of items assigned to the opened bin, except the overflow item.
When a new bin is opened, a selection of an overflow item j is to be made.The overflow item j is selected as the weighted item among those already packed into all previous opened bins, but not yet used as overflow items.Once the overflow item is selected, a permutation of the placement between the selected item j and the current item i is performed.
2) AFFD Pseudo code: Let I j a set of items assigned to bin j, except the overflow item o j .The AFFD heuristic can be summarized in the following steps: • Step 0: Sort the items into a list I in decreasing order of their weight, set i = 1, S = ∅, O = ∅. •

B. Adapted Minimum Bin Slack AMBS
We describe in the follow the second proposed heuristic which consists in a simple adaptation of MBS heuristic of Gupta and Ho [7].We call this proposition, Adapted Minimum Bin Slack heuristic (AMBS).In this heuristic, we execute the MBS procedure, in which we consider that the weight of the largest item in the current bin is equal to one capacity unit.Otherwise, this item is considered as the overflow item of its bin, and this bin must leave at least one capacity unit available for the requirement of the overflow item.The AMBS heuristic is summarized in the following: Until there are no items in the unpacked items set I: • Select the largest item in I and assign this item as an overflow item in the current bin j.The residual capacity of bin j becomes r j = r j − 1.Then, remove the selected overflow item from the set I; • Apply the MBS-one search procedure on I with a capacity of bin equal to C − 1, in which we obtain the best subset of unpacked yet items.
• Remove the founded subset from I.
The complexity of MBS procedure is O(2 n ), but the computational experience shows that it is quite efficient in solving practical problem instances with various parameters [8][9].This is due to the fact that in practical problem instances, the number of items involved in each packing is much smaller than n.If the maximum number of items that can be placed in one bin is u, then the complexity of MBS-one-packing procedure is reduced to O(n u ) and thus packings for all bins are built in O(n u+1 ).

V. COMPUTATIONAL RESULTS
Heuristics and lower bounds have been coded in java and run on an Intel i5 @ 2Go of RAM.The solver CPLEX 12.5 was used to solve the linear programming to the optimality.
We tested our heuristics algorithm on three data-sets called uniform, triplet and random instances.The two first data-sets contain eight instances classes were initially proposed by Falkenauer [11]  The performance and average run time of tested heuristics on data-sets described above are shown in Table I    Table I shows computational results for the Falkenauer uniform instances, from these results we note that the average deviation decreases when the problem size increases, this is due to the convergence of the upper bounds and lower bounds from the optimal solution.In average, our heuristic AFFD performs better than heuristic provided by Ongkunaruk, more particularly when the problem size increase, this is due to the way on which MFFD algorithm extract the set of overflow items.In fact, the lower bound provided by Ongkunaruk performs worse when the problem size increase.Ongkunaruk's upper bound MFFD gives a further solution.
Concerning AMBS, this heuristic gives an important deviation from the optimal solution, this is due to the fact that from the MBS adaptation, some items with a large weight will be packed inside the bin.While, the optimal solution requires that all largest weight items must be packed as overflow items in order to minimize the number of used bins.
In Table II, we present the computational results of MFFD and proposed heuristic for the Falkenauer triplet instances.From these results, the overall attracting remarks that our heuristic AMBS give the optimal solution for this instances, because it is enough to find three items in each subset to be packed inside the bin, and one as overflow item.So the solution given by AMBS coincides with the lower bound value L T OBP = n 4 .Moreover, from this table we note that both proposed heuristics AMBS and AFFD perform better than MFFD.
For a given problem size, the results given by both AFFD and MFFD are better on the uniform instances comparing to the triplet instances.These remarks can be explaining by the fact that the Falkenauer triplet instances are particularly difficult because in the optimal solution all constructed bins should have maximally three items as no overflow item plus one overflow item, therefore it is difficult to find an optimal subset of four items to each bin using first fit decreasing.
In overall, all the results present reasonable average computation time which confirms the good performances of our proposed heuristics.The time required by MFFD and AMBS are negligible.Furthermore, it is obvious to note that the time requirements increase with the problem size, but reasonable in order of some millisecond until problem size of 500 items.
Table III shows computational results for the random instances.In addition to both average deviation and execution time columns, we show the column Dif f which represent the average difference of number of bins obtained by the proposed heuristics and the lower bound.From these results we remark that the average deviation decreases when the problem size increases, this is due to the convergence of the upper bounds and lower bounds from the optimal solution.The results also show that MFFD and AFFD methods performs better in quality of solution and computational time.An average deviation of 0% to 2.58% is given for the small problem size and 0.47% to 2.75% for the problems beyond to 200 items.Also, for such an interval of weight distribution, the average deviations decreases when the problem size increases which ensures the good performances of proposed methods.In overall proposed AFFD performs better with an overall average deviation of 1.29%.However, MFFD and AMBS show good performances and the same behaviour in the variation of deviation with an overall average deviation of 1.36% and 6.33% respectively.Although we have positive values of deviation, the average difference between the lower bound and the upper bounds is usually just two bins for MFFD and AFFD, while this difference is in order to average seven bins for AMBS.Obviously, this value of the difference increases with the problem size.
Generally, obtained results are given with reasonable average computation time, in order to some milliseconds for MFFD and AFFD heuristics and few large running time for AMBS, but always in order to milliseconds.The execution time increase with the problem size.For 1000 items, the solutions are obtained after average 28, 10 and 149 milliseconds for MFFD, AFFD and AMBS respectively.These results confirm the excellent performances of proposed heuristics.

VI. CONCLUSION
The open end bin-packing problem is an NP-hard combinatorial problem often encountered in the practical field.Few works are carried out to solve the problem in polynomial or pseudo-polynomial time.Through the present paper, we have proposed and described two newly heuristics for the OEBPP problem, these heuristics are an adaptation of the well-known first fit decreasing algorithm and minimum bin slack algorithm.
Computational results based on a benchmark test bed show the good performance of proposed heuristics both on quality of solution, and on required execution time.

n 4 where
and they were excessively used to test the performances of several bin packing problem variants.Each class contains 10 different instances.The uniform data-set includes four instances classes of bins capacities C = 150 and items with integer weights uniformly distributed in the interval of [20 − 100].The number of items n for each class is respectively, 120,250,500 and 1000.The second data-set was called the triplet bin-packing instances because in the classical bin-packing problem, each bin can be filled with at most three items.This data-set includes also four instances classes of bin capacities C = 1000 and items with integer weights uniformly distributed over the interval [25 − 50] with one decimal digit.The number of items n for each class is respectively, 60, 120, 249 and 501.If for the triplet instances in the classical bin-packing problem (closed bin), each bin cannot contains more than three items, so for the open bin cases we can add no more than one item as an overflow item.Therefore, a valid lower bound (lower number of used bins) can be expressed by L T OBP = n is the problem size or the number of items.The last data-set was generated randomly and contains five classes of instances with different problem size, n = 50, 100, 200, 500 and 1000.For each class, items weight was generated using uniform distribution over four different intervals [20 − 140], [20 − 160], [40 − 140] and [40 − 160].The capacity of bins is fixed to 200.Ten different instances was generated for a given problem size and weight interval distribution.
Open a new bin if it cannot be assigned to any existing bin; • if a bin k is opened, select the overflow item o k such that w o k = argmax i∈ I {w i } we pack firstly the overflow item; Permute placement of the current item i and selected overflow item o k Set O = O ∪ o k and update I.
Step 1: Until there are no items in a list I do • S = S ∪ i; • Pack the current item i into the lowest indexed opened bin j * in which the total weight of items I j * already assigned to it -except, the over flow itemis strictly less than the bin capacity.Algorithm 1: Adapted First Fit Decreasing AFFD Data: I Set of items ordered in decreasing order of weights, w i weight of item i, C Bins capacity.Result: The number of used bins |O| initialization O := ∅ S := ∅ for i = 1 to n do S = S ∪ {i} if ( i can be assigned in one of opened bins ) then assign item i with bin capacity C − 1 using FFD procedure else j = argmax j∈S {S} S = S \ {j} O = O ∪ {j} Permute assignment between items i and jAFFD procedure can be implemented on O(n log n) time, where n is the number of concerning items.
, Table II and Table III respectively.Each line contains average results over ten OEBPP instances and the best results are shown in bold faced characters.
Table headings are as follows: Dev.: Deviation of solution obtained by the corresponding heuristic(H) from the best lower bound provided by Ongkunaruk [5] LB 0 OBP and the lower bound provided by Cesili and Righini [1] LB CBA , computed as :