Next Article in Journal
Mathematical Modeling of Layered Nanocomposite of Fractal Structure
Previous Article in Journal
An Overview of Non-Destructive Testing of Goss Texture in Grain-Oriented Magnetic Steels
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Efficient Pre-Solve Algorithms for the Schwerin and Falkenauer_U Bin Packing Benchmark Problems for Getting Optimal Solutions with High Probability

1
Faculty of Information Technology, University of Pannonia, Egyetem Str. 10, 8200 Veszprém, Hungary
2
Alfréd Rényi Institute of Mathematics, Reáltanoda Str. 13–15, 1053 Budapest, Hungary
*
Author to whom correspondence should be addressed.
Mathematics 2021, 9(13), 1540; https://doi.org/10.3390/math9131540
Submission received: 19 April 2021 / Revised: 7 June 2021 / Accepted: 24 June 2021 / Published: 1 July 2021
(This article belongs to the Section Mathematics and Computer Science)

Abstract

:
Bin Packing is one of the research areas of Operations Research with many industrial applications, as well as rich theoretical impact. In this article, the authors deal with Bin Packing on the practical side: they consider two Bin Packing Benchmark classes. These benchmark problems are often used to check the “usefulness”, efficiency of algorithms. The problem is well-known to be NP-hard. Instead of introducing some exact, heuristic, or approximation method (as usual), the problem is attacked here with some kind of greedy algorithm. These algorithms are very fast; on the other hand, they are not always able to provide optimal solutions. Nevertheless, they can be considered as pre-processing algorithms for solving the problem. It is shown that almost all problems in the considered two benchmark classes are, in fact, easy to solve. In case of the Schwerin class, where there are 200 instances, it is obtained that all instances are solved by the greedy algorithm, optimally, in a very short time. The Falkenauer U class is a little bit harder, but, here, still more than 91% of the instances are solved optimally very fast, with the help of another greedy algorithm. Based on the above facts, the main contribution of the paper is to show that pre-processing is very useful for solving such kinds of problems.
MSC:
90-05 (primary); 90-08; 90C27; 90C59 (secondary)

1. Introduction and Literature Review

Bin Packing ( B P ) is a classical area within Combinatorial Optimization, with wide-range applicability in the everyday life. The optimal usage of the available capacity, e.g., in storing or transportation tasks, results in a smaller number of required containers, fewer vehicles, fewer flights, or fewer trips of ships. These advantages mean faster delivery processes and lower level of the transportation’s impact on the environment. Another application area is the design of different devices/products (e.g., cubesat, mobile phone, etc.), where all the parts of the device have to be placed in the volume of the product, usually, resulting as small device as possible. In the former mentioned application area, the bin sizes are often identical (e.g., containers on a ship), while, in the latter case, the sizes of the devices’ different parts are mainly different. However, in both cases, the theory of bin packing can optimize the packing process.
B P can be introduced as follows. Given are items with sizes p 1 , p 2 , , p n (positive rational numbers between 0 and 1), to be packed into the minimum number of unit-capacity bins, not exceeding the bin capacity. The problem is well-known to be N P -hard (see, e.g., Reference [1] or Reference [2]). What is more interesting, B P was “born” in the early seventies as the “test-bed” of so-called approximation algorithms. Johnson’s thesis [3] on bin packing (together with Graham’s work on scheduling [4,5]) belongs to the early influential works that started and formed the whole area of approximation algorithms. These algorithms run in polynomial time, and they find optimal or near-optimal solutions in some sense.
The offline case is considered, where all items are known before the packing procedure. Below, a short review is given about what kind of algorithms have been considered to solve the bin packing problem.

1.1. Approximation Algorithms

Johnson’s thesis analyzes several “Fit-type” algorithms, like First Fit ( F F ), Best Fit, and others. In this article, only the F F algorithm is dealt with, which can be defined as follows. (Algorithm First Fit probably appears first in the work of Ullman in 1971 [6], which is considered as the first work on B P ).
The First Fit algorithm ( F F for short) packs the items in a given order. The next item is always packed into the first bin where it fits, possibly opening a new bin if it does not fit into any currently open bin. The algorithm is called First Fit Decreasing ( F F D for short) if the order of the items is decreasing by size.
The efficiency of a bin packing algorithm is traditionally measured by approximation ratio. Its two main versions are the asymptotic and the absolute approximation ratios. Let L denote the set of the items to be packed. Let O P T denote an optimal offline algorithm and A an arbitrary packing algorithm. Let O P T ( L ) and A ( L ) denote the number of bins created by them to pack the items of L, respectively. The absolute and asymptotic approximation ratios of A are defined as
R a b s ( A ) = sup L A ( L ) / O P T ( L ) ,
and
R a s ( A ) = lim n sup L A ( L ) / O P T ( L ) O P T ( L ) n .
Below, only the main results will be reviewed regarding approximation algorithms for  B P .
The proof that R a s ( F F ) is, at most, 1.7 was given already by Ullman [6] and the matching lower bound by Garey et al. and Johnson et al. [7,8]. These were among the first results on approximation algorithms. An estimate about the absolute ratio appeared in 1994 by Simchi-Levy [9], who proved that R a b s ( F F ) 1.75 . The tight absolute bound for F F is R a b s ( F F ) = 1.7 , and this is proved in [10,11]. Regarding F F D , the tight result can be sated as F F D ( L ) 11 / 9 · O P T ( L ) + 6 / 9 in References [12,13], where tightness means that the additive term 6 / 9 cannot be decreased.
These algorithms (i.e., F F and F F D ) are also very popular today and often used in several applications of B P , as they are very simple and very efficient in practice. There is much more work on this topic; in particular, there exist many other (classical or new) algorithms, as well as asymptotic polynomial-time approximation schemes (APTAS), for this problem [14,15]. An approximation scheme means that, for any ε > 0 , there exists some algorithm A ε with R a s ( A ε ) < 1 + ε , with running time (number of steps) polynomial in ε . Note that, in practice, these algorithms are not efficient if the number of bins provided by the algorithm for item-set L is, at most, ( 1 + ε ) · O P T ( L ) + C (where C does not depend on the input) because the additive term C can be so large that the number of used bins is very big if L is small. So, the algorithm can be efficient only for very “large” O P T values, which is rare in “real-life”.

1.2. Exact Methods

Many exact algorithms have been published to solve the bin packing problem. B P can be tried to solve, among others, by dynamic programming, L P -relaxation (and some post-processing), branch-and-bound, branch-and-price, and constraint programming methods. The exact methods indeed provide the optimal solution, but they can usually be applied only to solve relatively small bin packing problem instances in a reasonable time. Below, only a few related publications are mentioned.
Delorme et al. [16] review the most important mathematical models and algorithms developed for the exact solution of B P and experimentally evaluate, on state-of-the-art computers, the performance of the main available software tools. Carvalho [17] treats L P models for bin packing (and the closely related Cutting Stock Problem). Wei et al. [18] solve the bin packing problem with a new branch-and-price-and-cut algorithm. This exact algorithm is based on the classical set-partitioning model and the subset row inequalities.
Note that the M I L P model of the bin packing problem is quite simple. The next model is one option. Assume that there are n items with sizes p 1 , p 2 , , p n . It is also assumed that there are n bins. Binary variables x ( i , j ) are introduced whose value is 1 if item i is packed into bin j (otherwise zero). Moreover, let also y ( j ) be a binary variable: its value is 1 if bin j is used (otherwise zero). Let M be a “big constant”; its value can be chosen, e.g., to  M = n . Then, there are the following constraints:
z = min j = 1 n y ( j ) ,
s.t.
j = 1 n x ( i , j ) = 1 , i ,
i = 1 n p i · x ( i , j ) 1 , j ,
i = 1 n x ( i , j ) M · y ( j ) , j .
Interestingly, even a relatively small model cannot be solved in reasonable time, with a commercial solver. This is not the fault of the solver, this is the property of the problem (and implicitly, caused by its N P -hardness).

1.3. Metaheuristics, the Main Directions

As B P is N P -hard, and there can be “problems” with an exact algorithm (i.e., such a method may need too much time to get an optimal solution), many kinds of metaheuristic approaches, such as genetic algorithms ( G A ), particle swarm optimization, tabu search, variable neighborhood search, etc., also have been introduced. These kinds of algorithms find near-optimal solutions; in fact, many times (applying for certain instances), they are able to get the optimal solution of the input. In Reference [19], the total number of 1318 benchmark problems are examined with the proposed grouping genetic algorithms, and, in 88.5 % of these instances, the obtained solutions are optimal.
Loh et al. [20] developed an algorithm that uses a simple and fast heuristic based on the concept of weight annealing metaheuristic. The algorithm found the existing best known or optimal solutions to 1584 instances taken from benchmark problem sets and generated new optimal solutions for three instances.
Kucukyilmaz et al. [21] also proposed grouping genetic algorithms. They examined 1318 benchmark problems and got the optimal result in their 99.6 % . On the hard28 test set, they found 23 optimal solutions out of 28. However, the genetic algorithm used has a high running time.
Borgulya [22] developed a hybrid evolutionary algorithm where an individual is a feasible solution, and it contains the description of the bins. The algorithm works with two new mutation operators and improves the quality of the solutions with local search procedures. He solved 1615 benchmark problems, and, in 99.7 % of these instances, the solutions were optimal. On the hard28 test set, this algorithm outperforms the earlier heuristics, it found the optimal solution for all instances.
Buljubašić and Vasquez [23] proposed a local search-based algorithm. The main feature of this algorithm is to proceed by partial configurations of the search space. Items are assigned to bins, while satisfying the capacity constraint, or are not assigned at all. This algorithm seeks to derive a set of non-assigned items that can be packed into two bins to obtain a completely feasible solution.
Only a few metaheuristic algorithms are mentioned. The interested reader can find many more in the references of the articles mentioned above. There are also hybrids, where two types of metaheuristics are combined; see, e.g., Reference [24].

1.4. The Metaheuristic Zoo

Recently, many other kinds of metaheuristic methods appeared. They all mimic the habit of some kind of animal. Maybe the first such algorithm was the Ant Colony Algorithm, which appeared efficient for many different optimization problems; see, e.g., Reference [25]. A similar, but not the same, kind is Particle Swarm Optimization [26].
However, there are many more. A whale optimization algorithm for B P is proposed in Reference [27]; some more “animal algorithms” are cuckoo search [28], squirrel search algorithm [29]; firefly, cuckoo search, and artificial bee colony algorithms are investigated (among others) in Reference [30], bat optimization is considered in Reference [31], and African buffalo optimization in References [32,33]. It is hard to imagine an animal whose habits cannot be used for optimization. Search on the Internet for “kangaroo search” will be successful, one can find, e.g., Reference [34]. What is not mentioned yet: grasshopper [35].
There are several surveys on B P ; see, e.g., References [1,16,36].

1.5. Very Recent Relevant Publications

Below are several very recent publications collected from the literature of bin packing, showing that this research is still active, moreover demonstrating that there are many competing research directions, as well as that the theoretical results are commonly used in a variety of industrial problems.
In Reference [37], the authors propose a novel slack-based flexible bin packing framework called reinforced bin packing framework for one-dimensional B P .
Ref. [38] proposes two new bin packing problems with many practical applications, particularly in logistics capacity planning. In both problems, besides the classical bin-selection costs, other assignment costs are also considered, and several constructive heuristics are proposed. The heuristics are evaluated by an extensive computational experimentation. The numerical results show good performance of the proposed heuristics, as well as the potential benefits of using the new models in practical applications. Ref. [39] deals with scheduling of aircraft maintenance tasks that are needed to keep a fleet of aircraft airworthy. This is a complex combinatorial problem that needs to be solved daily by maintenance operators. The problems is formulated as a time-constrained variable-sized bin packing problem. A novel approach is proposed that is capable of efficiently solving the multi-year task allocation problem for a fleet of aircraft in a few minutes. To solve this problem, a constructive heuristic based on the worst-fit decreasing algorithm is proposed. The heuristic is tested and validated using the maintenance data from a European airline. Compared with the previous solution, the proposed heuristic is more than 30% faster for all the test cases discussed with the airline, and, for most of the cases, the optimality gap is below 3%.
Ref. [40] presents a survey of the recent advances for one-dimensional B P , with specific interest on population-based metaheuristic algorithms. This paper wishes to give a reference guide for researchers to explore and develop more robust state-of-the-art metaheuristic algorithms for solving the emerging variants of the bin-parking problems. Ref. [30] presents a systematic performance evaluation study for some representative algorithms, with some initial computational results to show their effectiveness and their ability to achieve promising solutions. The experiments were made using three standard bin packing problem dataset categories with more than 1210 instances. The numerical results of the considered algorithms were compared with the solutions achieved with the the best fit and better fit heuristics, respectively. Some issues regarding the individual algorithm implementation are also treated.
In Reference [41], the authors consider a specific version of the temporal bin packing problem that occurs in job-to-server scheduling. This problem is a generalization of the bin packing problem with respect to an additional time dimension, and it requires to find the minimum number of bins (servers) to accommodate a given list of items (jobs) at any instance of time. Moreover, recent publications suggest to also incorporate the number of fire-ups of the respective servers as an important factor in sustainable and energy-efficient overall operation. Dealing with both of these objectives by a weighted sum method increases the complexity of the model, thus leading to challenging ILP formulations. It is shown that the current approaches fail to compute an exact solution of many moderately-sized instances in reasonable time. For this reason, the authors propose various new pre-processing techniques to reduce the number of variables or constraints. Based on numerical experiments on different sets of benchmark instances, the new and improved formulations are shown to lead (on average) to better performances in terms of instances solved to optimality and computation times.

1.6. A “New” Paradigm

In this article, a new kind of paradigm is proposed. First, some kind of pre-processing will be performed. Let an instance of B P be given, that has to be solved optimally. This task “can be hard”, as the problem is N P -hard. However, this fact does not mean that finding the optimal solution is really hard for each instance. For example, if all the sizes are equal, say p > 0 , then the problem is trivial. One can pack exactly 1 / p items into each bin “without thinking”, and the work is done. Of course, usually the packing problem is harder or much harder. Nevertheless, it will be shown a little later that, for many commonly used Benchmark problems, it is still able to find the optimal solution very easily.
So, the proposal of the authors is the following: First, try to get the optimal solution for the instance with a greedy-type method. If it is successful, the task is done. If not, apply some more sophisticated method (which is not treated in this paper). This kind of application of greedy methods is ubiquitous in the personal life, too, e.g., when one find shortcuts in the traffic, or when a person is doing the shopping. Operations Research also uses these tricks. For example, Reference [27] also builds some tricky improvements into the initial whale optimization algorithm (e.g., applies Lévy flight for whale movements, adds a new mutation phase, and switches in a clever way between the exploration and the exploitation phases by a logistic chaotic map).
Now, let us have a closer look at the so-called Benchmark Problems.

1.7. Bin Packing Benchmarks

In this section, the wide collection of benchmark problems that are listed on the homepage of Operations Research Group Bologna [42] are briefly introduced, which is a very good source if one would like to get acquainted with the bin packing literature, mainly from the point of view of “how to solve the instances optimally”.
The instances are given in the following formats: The number of items and the capacity of the bins are denoted by n and c, respectively, and for each item j ( j = 1 , , n ) , the size of the item (also called weight) is w j . The benchmark instances are categorized into several classes. Below, the authors briefly overview the classes one by one (just the same way as they can be found on the homepage). For each class, the article that introduces it is also provided.
Falkenauer [43]. The instances are divided into two classes, with 80 instances in each. The first class (“Falkenauer U”) is divided into four subclasses (20 instances in each), and, in each subclass, the number of items is n = 120 , n = 250 , n = 500 , and  n = 1000 , respectively. In all subclasses, the item sizes are uniformly distributed between 20 and 100, and the bin capacity is c = 150 .
The instances of the second class (“Falkenauer T”) include triplets (groups of three items) that need to be assigned to the same bin in any optimal packing, where n is between 60 and 501, and  c = 1000 .
In total: 160 instances.
Scholl [44]. The instances are divided into three parts, DataSet1, DataSet2, and DataSet3, having 720, 480, and 10 instances, respectively. These are again uniformly distributed instances with n between 50 and 500. The capacity c is between 100 and 150 (DataSet1), equal to 1000 (DataSet2), and equal to 100 , 000 (DataSet3), respectively.
In total: 1210 instances.
Wäscher [45]. These instances are considered as (some of) the most difficult ones. Here, n is between 57 and 239, and  c = 10 , 000 .
In total: 17 instances.
Schwerin [46]. These instances are divided into two sets (“Schwerin 1” and “Schwerin 2”) of 100 instances, each with n = 100 and n = 120 , respectively, and  c = 1000 . The items sizes are randomly drawn and uniformly distributed between 150 and 200.
In total: 200 instances.
Schoenfield_Hard28 [47]. Here, there are 28 instances, and n is between 160 and 200, while c = 1000 .
In total: 28 instances.
Some further benchmark sets. There are three more classes on the Unibo homepage. There are Randomly Generated Instances given in Reference [16]. Here, there are 8 different values of n between 50 and 1000, with 12 options for choosing c between 50 and 1000. The item sizes are between the minimum size ( 0.1 c , 0.2 c ) and the maximum size ( 0.7 c , 0.8 c ) . For each quadruplet, 10 instances (in total: 8 · 12 · 2 · 2 · 10 = 3840 instances) were generated. The same paper also provides the Augmented Non-IRUP and Augmented IRUP Instances. These are 250 instances within each set (Augmented Non-IRUP: ANI and Augmented IRUP: AI). In total: 500 instances.
Moreover, the GI Instances are proposed in Reference [48] with various instances. In total: 240 instances.
Altogether, the total number of instances in all groups listed on the homepage is 6195.
It is supposed that the items are ordered by decreasing sizes before any further discussion (they are already listed in this order on the homepage in Reference [42]).
Comparison with F F D . The first experience was that algorithm F F D performs quite well for many of the above-listed benchmark classes. First (separately), the results for the AI and ANI classes are provided because, for these classes, the optimum value is not given for each instance, only a lower bound and an upper bound ( U B ), which sometimes coincide. In Table 1, the results of F F D are compared with the upper bound.
It can be realized that F F D provided the “best known” solution for more than half of the AI class instances and all instances in the ANI class!
In Table 2, some of the other classes are considered.
One can conclude that F F D is very efficient for the instances in DataSet 1 (more than 75 percent of the instances were solved optimally); for (the harder) DataSet2, this ratio is still almost 50%. However, for the ten instances in DataSet3 (not included in the table above), F F D could not solve any instance optimally.
Continuing the “negative side”, F F D could not solve optimally any instance within the Falkenauer T class, and solved optimally only one instance from the GI class. No instance is solved optimally by F F D for the Schwerin class, only 2 (out of 17) for the Washer class, and 5 (out of 28) from the Hard28 class.
If F F D does not provide the optimal solution, usually it uses only one more bin. In total, F F D provided the “best known” solution for 2778 instances ( 44.84 % ) out of the 6195 instances. In some classes, this ratio is higher, and, in some other classes, it is lower, as shown by the data above.
Let Reference [49] be mentioned here. It proposes a new (sophisticated) algorithm and solves 120 instances from the Scholl group. The algorithm is able to solve all instances optimally. However, F F D is also able to solve all these instances optimally. Then, why should one use a more sophisticated algorithm?
The conclusion is the following:
  • Algorithm F F D is not always efficient, but it is a good idea to run F F D first, and almost half of the instances are already solved optimally!
  • Two classes are chosen: these are the Schwerin class and the Falkenauer U class. For these classes, F F D is not efficient; see the results above. However, it will be shown a little later in Section 3 for the Schwerin class and in Section 4 for the Falkenauer U class) that “smart”, but  greedy-type algorithms are still able to solve all, or almost all, of these instances optimally. Note that a key property of these chosen classes that the item sizes are drawn randomly and uniformly from some given interval.

1.8. Pre-Solve Methods in the Literature

“Pre-solve” is a well-known and frequently applied technique in optimization. It mainly means that before the solution of a problem is started, the instance is simplified (if possible). If  some kind of linear optimization problem is dealt with, first the redundant constraints are removed to shorten the problem. Possibly, the first publication about a pre-solver technique in Linear Programming was the work of Brearley, Mitra, and Williams in 1975 [50], the subsequent similar publications are Tomlin and Welch in 1983 [51,52], Andersen and Andersen in 1995 [53], and Gondzio in 1997 [54].
Reference [55] considers pre-solve for Mixed Integer Programming problems. Some further publications on the same topic are References [56,57], from the same authors, and Reference [58].
Mészáros and Suhl deal with pre-solve in Linear and Quadratic programming [59]. A survey article on pre-processing techniques for integer programming is Reference [60]. (The model (3)–(6) is also an Integer Programming model.)
Note that even the ordering of the items is already a “pre-processing”, and it is very efficient. If the First Fit algorithm is applied for a given list L, in the “worst” case, its solution can give F F ( L ) = 1.7 · O P T ( L ) , no matter how big O P T ( L ) is Reference [10]. However, if the items are sorted into non-increasing order, and only after this is ordering the First Fit algorithm applied (i.e., in fact, it is F F D ), in the worst case, one will get F F D ( L ) ( 11 / 9 ) · O P T ( L ) for “big” O P T ( L ) values [3,13].
After shortly going through the above points, several slave algorithms will be introduced that are needed later. Then, a pre-processing technique will be shown that is applied for the Schwerin set of benchmark problems in Section 3 and the Falkenauer U class in Section 4.
Finally, the investigation will be closed by the Conclusions.

2. Greedy Knapsack Packing and Optimal Path Search

First, several slave algorithms are described. None of them is “new”, as they are commonly applied simple algorithms; but, for the sake of completeness, they are shortly introduced here. Note that the total size of items in a bin is called level.

2.1. The Knapsack Problem and Its Relation to B P

The Knapsack Problem ( K P ) (Algorithm 1) is the following. Given n items, each item i has a weight w i and a gain value g i . Moreover, given is a knapsack with capacity C. The goal is to pack a subset of the items into the knapsack so that their total weight is, at most, C and their total gain is as big as possible. It is well known [61] that K P is N P -hard in the ordinary sense, but  B P is strongly N P -hard. Thus, it is a straightforward idea to apply the next type of algorithm that is called Knapsack. It will be described in a general way; the special settings about its application will be treated later.
Algorithm 1 Knapsack algorithm
Input: the items of a B P instance (with given sizes p 1 , p 2 , , p n )
Output: packing of items into unit capacity bins
  • Choose several items to fill one bin “well”. Here, one bin plays the role of a knapsack. The items of the B P instance will be considered as items of the K P . The weight of each item (in the K P ) is defined as its size (in the B P ). The gain g i of item i can be defined in several ways;
  • Choose (by some knapsack algorithm) several items that fit into the knapsack and have maximum total gain;
  • Remove the items that are just packed into the knapsack (these items are packed into a bin), and go to Step 2 to pack the next bin.
First of all, it is necessary to note that there is no guarantee that the above algorithm will provide an optimal solution for B P . However, it will be shown that even this simple “greedy-type” method, or even some kind of its relaxation, will provide an optimal solution for many inputs. The algorithm is of greedy type, as instead of taking care of all items and all bins that should be filled “well”, at any moment, only one bin is dealt with and only a subset of all unpacked items is considered. However, as it is mentioned, this simple greedy-type method still works, at least for some kinds of inputs.
There are several ways to determine the gains of the items for the K P . (Recall, that the weights in K P are already given as they are equal to the sizes of the items in the B P , but there is a freedom to choose well the gain values.) The role of making a “good” choice for the gains is to fill the knapsack “well”. The simplest option is: g i = w i .
Observation 1.
Assume that the bin capacity is C > 0 (an integer) and all item sizes are positive integers between 1 and C. Applying the gain function g i = w i for the items, algorithm Knapsack will choose an item-set for packing the knapsack with a maximum total size (but at most K C ). This subproblem is usually called Subset Sum (which is a special case of K P ).
One may want to pack the items into the bins so that the bins are filled as much as possible. The above gain function (i.e., g i = w i ) is a suitable choice (a possible option) for this purpose. However, it can happen that the resulting packing is not so good in some sense, as it does not make a difference between different choices if the sum of sizes of packed items is just C.
A better choice can be, because of the mentioned phenomenon, the following: g i = w i 1 (if all sizes are greater or much greater than 1). This setting of the gain function will give preference to choosing bigger items rather than smaller ones, if possible. For example, let the bin size be 10, and let there be seven items: 6, 4, and five copies of 2. It is possible to fill the knapsack completely in different ways. However, the total gain will be largest if one completely fills the bin with as few items as possible. So, the gain function g i = w i would consider all full fillings equally fine, but applying g i = w i 1 the algorithm will prefer 6 , 4 rather than choosing, e.g., the five small items of size 2.
There are also other possible options; that will be discussed where needed later.
Let it be emphasized that the authors do not plan to build an “exact” algorithm. They build “only” some greedy-type algorithms that are able to find very good (in fact, optimal) solutions in many of the cases.

2.2. A Path Search Algorithm

The next algorithm is a well-known simple path search algorithm; it will be described it briefly. The algorithm determines if there is a collection of items that together fit into a bin and their total size is K, where K C . Step by step a (directed) path will be built from some node to another node in a graph. The initial node n 0 corresponds to the empty bin, and a directed path from n 0 to some other node n i corresponds to a packing with level (i.e., the total size of items in the bin) i.
Initially, the items i = 1 , 2 , , n are given, in a given order (recall that the size of item i is p i ). A directed graph is built where each vertex also has a label. First, the graph has C + 1 nodes and no edges. Node n i is represented by the value i of the horizontal axis. The smallest node is n 0 at the zero value, and the last node is n C , at value C. In the beginning, the label l i of any node is 1 , except that the label of node n 0 is l 0 = 0 . If a label of some node is 1 , this means that the node is “unreached”; otherwise, it is “reached”. If a node j is reached, the label l j means the last edge of the directed path from n 0 to node j (i.e., the size of the last item packed into a bin with level j). “Temporary labels”, denoted by k i , will be used also.
Then, the next steps are repeated (Algorithm 2):
Algorithm 2 Algorithm Path Search
  • Consider the next item i;
  • Consider all nodes with label bigger than 1 (i.e., all nodes that are already reached). For any such node, say node j, do the following. Add a directed edge from node j to node t, where t = j + p i (if t C ), and  let the temporary label of node t be k t = i . If node t was not reached before, let l t = k t . If node t was already reached, there is an option to leave its label as it was before this step, or change it to k t , as will be determined later;
  • Go to Step 2 if there is at least one more item. Otherwise, Stop.
Note that there can be several versions of the Path Search algorithm; the applied one is a very simple version that still works.

2.3. Lower Bounds

Finally, some words about lower bounds for B P . These lower bounds play an important role when one would like to get an optimal solution. For example, if there is a feasible solution to B P and also a matching lower bound, then it is known that the feasible solution is, in fact, optimal; thus, the procedure can be stopped from searching for an optimal solution. There is quite a big literature on lower bounds for B P and other problems, e.g., References [62,63].
Now, some well-known obvious lower bounds will be shown, that will be useful for later discussion. Let
L B 1 = i = 1 n p i / C ,
i.e., the sum of sizes divided by the bin capacity and rounding up. Another trivial lower bound is the number of items bigger than half of the bin capacity, which will be denoted by L B 2 . More generally: If one consider all items that are bigger then C / k , for some k > 1 , then this number divided by ( k 1 ) is again a lower bound.

3. Schwerin Class

This Benchmark set contains 200 instances in two parts, with 100 instances in each.

3.1. Schwerin 1: The First 100 Instances

Here, the bin capacity is 1000, and, in the case of each instance, there are given n = 100 items. The item sizes were randomly chosen from the interval between 150 and 200; of course, after drawing the items, the instances are fixed.
For each of the 100 instances, the optimum value is 18. Note that the lower bound L B 1 also provides 18 for each input.
One can observe at first sight that now, in fact, there are only 60 items to pack carefully, rather than 100. The reason is that the following two properties trivially hold by the given bin capacity and lower and upper bounds for the item sizes:
  • no seven items fit into a bin, and
  • any five items fit into a bin.
Hence, any bin will contain five or six items (except, at most, one bin). Consequently, at least 8 of the, at least, 18 bins will contain, at most, five items. Thus, the 40 biggest items can be packed arbitrarily into 8 bins without losing optimality, and only the packing of the other 60 items remains to think about. It should be emphasized that the input is already significantly simplified! Almost no time is spent for packing 40% of the items, thus not violating optimality!
How can one smartly pack the remained 60 items? Can one pack them into 10 bins (can one partition the 60 items into 10 groups so that any group contains six items that fit into a bin)?
One can try some version of Algorithm Knapsack (introduced in the previous section) for packing the remained 60 items (packing “well” one bin, excluding the items from the remained set of items, and repeating this step). However, it is found that the next much simpler greedy-type algorithm also helps. It is called Algorithm Rem SW (Algorithm 3), denoting that it is applied for packing the remaining items of a Schwerin type input .
Algorithm 3 ALG Rem SW
  • Let 0 k 6 be the biggest integer for which the k biggest items and the 6 k smallest items (from the set of unpacked items) fit altogether into a bin;
  • Pack the k biggest items into the bin;
  • Apply Algorithm Path Search to fill the remained room in the bin as much as possible;
  • Remove the packed items from the set of “unpacked items”;
  • Go to Step 1 if there is at least one more item. Otherwise, Stop.
Experience showed that, for the instances of this Benchmark set, k is generally 3 in the first few iterations; then it turns to 4, then to 5, and, finally, to 6.
Rarely, it happens that k = 2 in the beginning, then it increases to 3, and so on. It never happened that the six smallest items do not fit into the bin, so k is well defined (for the considered instances of the Schwerin class).
Due to the embedded Path Search subroutine, the running time of algorithm ALG Rem SW is pseudo-polynomial when applied for n items in general. Naturally, for 60 items the running time is constant. Nevertheless, it should be emphasized that the running time is really small.
The main consideration is that an optimal solution is obtained (i.e., the 100 items are packed into 18 bins) for all of the cases in the Schwerin 1 subclass.

3.2. Schwerin 2: The Second 100 Instances

For the second 100 instances, the bin capacity is still 1000, but there are n = 120 items in each instance. The sizes are again randomly drawn from the interval between 150 and 200 (by uniform distribution).
For each of the 100 instances, the optimum value is either 21 or 22. Note that the lower bound L B 1 equals the optimum value for each input.
If the same algorithm is applied as for the first 100 instances, it finds (also very fast) optimal solutions in 99 cases out of the 100 cases. However, if one restrict the choice of k only to 2 k 3 , the algorithm finds the optimal solution for all 100 cases. Moreover, this restricted choice of k also solves all 100 instances of the first 100 instances optimally. So, in this way, one can get the optimal solution for all 200 instances of the Schwerin type. The solution of each of the 200 instances can be checked step by step on the page [64].

3.3. Discussion of Scalability and Complexity

What happens if the input is different from the Schwerin type? If the size of the bins is not 1000, or the items are drawn not from [ 150 , 200 ] ? In other words, how can one scale the algorithm to a more general input class?
The authors think that if the item sizes are randomly chosen according to uniform distribution from a “narrow” interval (like [ 150 , 200 ] ), then an optimal solution is usually easy to found. The next idea can be followed:
  • Calculate the lower bound L B 1 (total size/bin size, rounded up).
  • Determine the minimum and the maximum number of items that can be packed into a bin. Suppose that this number can be only K 1 or K. (For the Schwerin type K = 6 ).
  • Fill a certain number of bins with the biggest items, with  K 1 items packed in each bin. After that, deal only with the remained set of items.
  • Perform Algorithm Rem SW, with the only difference that when determining the value of k (some range within 0 k K ), possibly choose k from some restricted interval (similarly to the discussion done in the previous subsection for the Schwerin 2 type, where k is chosen from 2 k 3 ).
Returning to the case of K = 6 as applied in the previous section, let the number of steps of ALG Rem SW be estimated if the instance has n items (now n = 100 in the Schwerin 1 set and n = 120 in the Schwerin 2 set). No matter how big n is, during Step 1, one make only a constant amount of computation, as for each value of k it is calculated the total size of six items, and k has seven different possible values. Only Step 3 needs more time. Here, the running time is O ( C · n ) , since there are, at most, C nodes t to consider for any item i. As this step is executed about n / 6 times (not taking into account that the number of items to be handled by ALG Rem SW is already reduced considerably by having a significant portion of the biggest items packed before executing this algorithm), the total running time is not more than C / 6 · n 2 . A similar computation can be carried out for general K, as well, hence obtaining a guaranteed upper bound on the running time.
A computer with Intel Core i5-4300M CPU at 2.60 GHz CPU and 8.00 GB of RAM was used to execute the benchmark problems. Table 3 shows the total running times for each input class in seconds.
The HEA algorithm was introduced and implemented by Borgulya [22]; this is one of the most effective and latest algorithms to solve these benchmark problems. It was executed on an iMAC with Intel Core i5 at 2.5 GHz CPU and 16.00 GB of RAM; this computer configuration is similar to the one used in the present research. From Table 3, one can conclude the following. The total running time of the algorithm proposed here for the entire set of 100 instances in case of Schwerin 1 is 0.3817811 s, and, in case of Schwerin 2, it is 0.408763 s. The average time of HEA for these input classes is 0.34 s for Schwerin 1 and 0.47 s for Schwerin 2. It can be seen that the present algorithm is 90 times faster for Schwerin 1 and 115 times faster for Schwerin 2. It should be noted, however, that HEA is a general-purpose algorithm applicable for all classes of the Benchmark site in question, while the faster method is a more specialized procedure that has so high efficiency on the Schwerin class.

4. Falkenauer U Class

There are 4 times 20 instances (altogether 80 instances) in the Falkenauer U class. The bin size is C = 150 , and the item sizes are between 20 and 100. The items are randomly drawn from this interval, with uniform distribution. In the four subclasses, only the numbers of items differ; these numbers are 120 items, 250 items, 500 items, and, finally, 1000 items.
The main difference between the instances of the Falkenauer U class vs. the Schwerin class is in the range of the items compared to the bin size. Recall that, in the case of the Schwerin class, the items come from interval [ 150 , 200 ] , and the bin capacity is 1000.
Now, in the Falkenauer U class, the items come from interval [ 20 , 100 ] , and the bin capacity is 150. The ratio of the biggest possible size and the smallest possible size is 100 / 20 = 5 in the present case, and it was 200 / 150 = 4 / 3 previously. So, it means that the variance of the items is much bigger. Now, one cannot declare in advance that the number of items is almost the same in all bins (as it was only 5 or 6 in the case of the Schwerin class). Still, it is possible to make a very simple observation that makes the optimization process for the Falkenauer U class much simpler!
Observation 2.
Suppose that there are two items, i and j, so that i + j = C , i.e., the sum of their sizes is exactly the bin capacity. It can be supposed that these two items (i.e., i and j) are packed into the same bin in the optimal solution.
Let the appropriate item pair in this observation be called a “good pair”. It follows that one does not lose anything from the quality/optimality of a packing if the good pairs are packed together into bins. For a closer look at one of the instances, consider the Falkenauer_u120_00 input (the very first input within the Falkenauer U120 subclass). Here, one can find 15 good pairs. It means that the size of the instance is already reduced from having 120 items to have only 90 items. Again, this is a huge amount of reduction (similarly to the simplification that one could perform in the Schwerin class, where from 100 items, one could pack “well” 40 items and only 60 items remained to deal with)! One can check that the situation is very similar in the other instances within the Falkenauer U120 subclass.
Now, the notion of initial reserve will be introduced. After computing the lower bound L B 1 , let the total size of items be subtracted from the product of L B 1 and the bin size C. This value shows how much space will not be filled in the optimal packing if O P T = L B 1 holds (which is the case in almost all instances in the Falkenauer U class).
Definition 1.
The initial reserve of the instance is r e s 0 = C · L B 1 i = 1 n p i .
Investigating the instances of the problem class in consideration, since the item sizes are drawn from a uniform distribution, usually it happens that some significant amount of reserve is made; typically it is comparable with the item sizes. It means that usually it is not needed to pack all bins fully. So, if two items (a pair) can be found so that they do not fill a bin completely but fill it “almost completely”, choosing this pair (instead of a good pair) still can be a good choice. Thus, sometimes it is satisfactory to fill the bin up to a certain level L, where L is “close” to the bin capacity. The reserve of the instance, denoted by r e s , will be calculated dynamically. In the beginning, this is the initial reserve r 0 , according to Definition 1. Then, if a bin is filled only up to L, and so lose l = C L from the reserve, the reserve r e s will be reduced by l. (For example, if the initial reserve is r 0 = 50 , and a bin is filled up to level L = 146 , then, since the bin capacity is C = 150 , 4 units are lost from the initial reserve, and reserve r e s = 46 remains.)
One more definition is needed.
Definition 2.
An item is called big if its size is above half of the bin capacity C.
In the Falkenauer U set, an item is big if its size is bigger than 75. It is clear that two big items cannot be packed into a bin, so one need to be careful with the big items: too many big items cannot be left at the end of the packing procedure.
The following algorithms will start with the whole set of items. Step by step, a bin is packed, then the already packed items are omitted from consideration, and the items not yet packed are called remained items. After creating a new bin, the value of the reserve r e s is reduced accordingly. To simplify the description of the main algorithm constructed here for the Falkenauer U class, several slave algorithms will be applied.
Recall that, by assumption, initially the items are sorted in non-increasing order. Step by step, this set of “unpacked” items will change, as some items from the set are packed and then deleted from the set of unpacked items. The remained items keep their ordering. Consider now a certain unpacked item; that will be called “current” item. Then, the “subsequent” items mean all the other unpacked items.
The first slave algorithm is called Pair(L, r) (Algorithm 4). During this algorithm, pairs of items are packed in each new bin. If an appropriate pair with total size L is found, these two items are packed into a bin dedicated for them, then they will be deleted them from the set of remaining items, and  the reserve will be modified accordingly. For making the decision about to pack or not to pack a pair of items, consider the total size of the chosen pair of items (it must be exactly L), and the current value of the reserve r e s (it cannot be smaller than r). First, the algorithm tries to find a pair for the largest unpacked item. If such a pair is found, they will be packed; otherwise, if such a pair is not found for the current item, nothing is done with it but go toward to find a pair for the next largest unpacked item, and so on.
Algorithm 4 ALG Pair(L, r)
  • Let i be the biggest unpacked item;
  • If p i < L / 2 or the current value of the reserve is r e s < r , then return;
  • If there exists a subsequent item j such that p i + p j = L : pack i and j into a new bin, delete these items from the set of unpacked items, reduce r e s by ( C L ), and go to Step 1;
  • Let i be the next unpacked item ( i = i + 1 ), and go to Step 2.
The next slave algorithm is Triplet(L, r) (Algorithm 5). During this algorithm, triplets (three items) are packed in any new bin. If an appropriate triplet is found, pack these three items into a bin dedicated for them, delete them from the remained set of items, and reduce the value of the reserve accordingly. To find a “good” triplet, the total size of the chosen three items is taken into account, as well as the current value of the reserve. When this algorithm is called from the master algorithm, it is also distinguished as to whether there exists a big unpacked item or not.
Algorithm 5 ALG Triplet (L, r)
  • Let i be the biggest unpacked item;
  • If p i < L / 3 or the current value of the reserve is r e s < r , then return;
  • If there exist two subsequent items, j and k, such that p i + p j + p k = L , pack i, j, and k into a new bin, delete these items from the set of unpacked items, reduce r e s by ( C L ), and go to Step 1;
  • Let i be the next unpacked item ( i = i + 1 ), and go to Step 2.
Finally, the last slave algorithm is Quadret(L, r e s ) (Algorithm 6). During this algorithm, four appropriate items are packed in any new bin. If such four items are found, pack them into a bin, delete these items from the remained set of items, and reduce the value of the reserve accordingly. This algorithm is applied only if there is no unpacked big item.
Algorithm 6 ALG Quadret (L, r)
  • Let i and j be the two biggest unpacked items;
  • If p i + p j < L / 2 or the current value of the reserve is r e s < r , then return;
  • If there exist two subsequent items, k and l, such that p i + p j + p k + p l = L , pack i, j, k, and l into a new bin, delete these items from the set of unpacked items, reduce r e s by ( C L ), and go to Step 1;
  • Let i = j , let j be the next unpacked item, and go to Step 2.
Now, it is possible to define the master algorithm Alg FU (Algorithm 7). For the sake of simplicity, it is designed for the Falkenauer U120 subclass; but only with changing its parameters can it be applied for the other three subclasses (U250, U500, and U1000), as well. The procedure of the algorithm is briefly summarized now. First, the algorithm tries to fill “well” as many bins as possible, with only two items. If the current value of the reserve is “big”, the algorithm is more permissive to allow such bins where the level of the bin is below the capacity. As the reserve is decreasing, the algorithm becomes more exclusive. After filling “well” as many bins as possible with pairs of items, the algorithm turns to fill well bins with three items and then with four items. Then, the remained (usually only few) items are packed by F F D . The exact description of the algorithm is given below. In the second step, r b 2 i denotes some value of the reserve (that makes it possible to apply this step), where there exists a big item (this is the meaning of “b” in the notation), and, similarly, r n 2 i means some value of the reserve in the case when there is no unpacked big item (this is the meaning of “n” in the notation).
The efficiency of Algorithm ALG FU is discussed in the next subsection. Here, one should mention only that, in Step 2 (lines 7–22), if there exists an unpacked big item, the algorithm is more restrictive than when all big items are already packed. Note also that, in Step 3 (lines 23–27), the algorithm is not restrictive at all in the sense of the value of the reserve; no matter what the value of the current reserve is, bins will be packed if the level will be at least 148.

4.1. Evaluation of the Algorithm

In Table 4 and Table 5, the applied values of the reserve in the algorithm are collected for the different subclasses. (In the description of the algorithm, the parameters for the U120 subclass are applied; naturally, in case of the other subclasses, other parameter values are applied, but the algorithm remains the same in any other sense).
Algorithm 7 ALG FU (Falkenauer U120 subclass)
  • Call Pair(150, r 11 = 0 );
  • Call Pair(149, r 12 = 1 );
  • Call Pair(148, r 13 = 2 );
  • Call Pair(147, r 14 = 3 );
  • Call Pair(146, r 15 = 4 );
  • Call Pair(145, r 16 = 5 );
  • whilethere exists unpacked big itemdo
  • Call Triplet(150, r b 21 = 0 );
  • Call Triplet(149, r b 22 = 5 );
  • Call Triplet(148, r b 23 = 10 );
  • Call Triplet(147, r b 24 = 15 );
  • Call Triplet(146, r b 25 = 20 );
  • Call Triplet(145, r b 26 = 25 );
  • end
  • ifthere is no unpacked big itemthen
  • Call Triplet(150, r n 21 = 0 );
  • Call Triplet(149, r n 22 = 5 );
  • Call Triplet(148, r n 23 = 10 );
  • Call Triplet(147, r n 24 = 15 );
  • Call Triplet(146, r n 25 = 30 );
  • Call Triplet(145, r n 26 = 30 );
  • end
  • ifthere is no unpacked big itemthen
  • Call Quadret(150, r 31 = 0 );
  • Call Quadret(149, r 32 = 0 );
  • Call Quadret(148, r 33 = 0 );
  • end
  • Pack all unpacked items by F F D .
Note that the exact values of r 11 , r 12 , , r 33 can be optimized by some method, as well as the levels of bins until the packings in Steps 1–3 are allowed. So far, a very careful optimization has not been performed regarding the “best” choice of the parameters. Only some trials have been made for getting “good enough” values for them, so even better efficiency may be achieved by some better choice.
In Table 6, one can see the results of the algorithm in different settings, for the U_120 subset of the instances. Green color means that the algorithm found the optimum, while red color indicates that the algorithm did not find the optimum. In each row, L B = O P T .

Evaluation

The following considerations and conclusions are established:
  • First, experiences are made so that the level of the next bin is not allowed to be smaller than L = 150 , or L = 149 , or L = 148 . The results of ALG FU are presented in columns 2 , 3 , 4 . It is concluded that being more restrictive, e.g., forbidding a level lower than 149, is not advantageous. This observation has led to allowing level, at least, 145 if the amount of reserve is “not too small”.
  • Experiments are also made so that the final step (Step 4, line 28) is changed from applying F F D to applying the path searching algorithm. The results of this modified algorithm are in the next three columns 5 , 6 , 7 . It can be seen that there is no significant difference in the results: the algorithm is not sensitive for the packing of the last several unpacked items. This means that it is not very crucial how the algorithm is finished, if the majority of the items are already “well packed”. Thus, it is decided to apply F F D in Step 4 (instead of a more tricky slave algorithm) in later runs v2 and v3.
  • Further relaxation of the level constraint, namely L = 145 , is applied in versions v2 and v3; the latter also takes into account whether there is still an unpacked big item. The output of this last (optimized) version of the algorithm can be seen in column 9. Here, one can see that the algorithm could solve all 20 instances within the Falkenauer U_120 subclass optimally.
  • Note that the optimum value (which is known from the literature) is the same as the value of the simple lower bound L B 1 , in all cases within the Falkenauer U_120 subclass. The same holds for all four subclasses (comprising 80 instances) in all but one case. The only exception is the case of instance u250_13, where L B 1 = 102 and O P T = 103 .
  • There are several cases where all algorithm versions find the optimal solution, e.g., Falkenauer_u120_01; but, in Falkenauer_u120_19, only the optimized v3 reached O P T = 49 . Remarkably, in Falkenauer_u120_12, a rather small initial reserve of 20 allows all versions to run optimally, whereas, in Falkenauer_u120_00 and Falkenauer_u120_11, an even much larger reserve is not sufficient for that.

4.2. Evaluation Regarding the Whole Falkenauer U Class

  • The algorithm developed here solves 73 instances optimally out of the 80 instances. The situation with the other 60 instances is similar to that in the U120 class as detailed above, but, in some cases, no version of the algorithm can find the optimum.
  • The running time is relatively small. It needed 31.8683809 s in total to solve all 80 instances. The complexity of the algorithm is of the order O ( n 3 ) , where the hidden coefficient in the O ( . ) symbol is about 20.
In Table 7, the running times are presented for the Falkenauer U class. The overall average running time of the new algorithm after a rough implementation is less than 0.4 s, and, for HEA, it is 1.48. Regarding the total running time of the algorithm, it is only 31.8683809 s, and, for HEA, it is 118.4 s. The greedy algorithm proposed here already has a 3.7 speed-up factor. With a more careful implementation, further significant improvement is achievable, possibly the algorithm can be made ten times faster.

5. Conclusions

The main conclusion is that applying pre-processing is very useful, as demonstrated here by bin packing benchmark classes. It is well known that the bin packing problem is strongly NP-hard, so one might think that optimally solving a B P instance is necessarily hard. But this is not the case: For some inputs, and even for certain input classes which look hard for first sight, the problem turns out to be relatively easy.
In other words, instead of saying that any B P instance is hard to solve, the truth is that there are hard instances beside the easy ones. It is an interesting problem to find or recognize the hard instances; at this moment, it is not clear at all how to distinguish between easy and hard instances.
If the universe of bin packing instances is imagined as a town having different districts where the easy and hard instances “live”, the question is, according to what parameters or properties can one decide that some district likely has some hard instances? In this direction, there is some research about the hard instances, e.g., in Reference [45]; in the present paper, the authors focused on recognizing easy instances.
The proposed pre-processing procedures are very fast, and, in a high percentage of the inputs, they provided optimal solutions. It means that it is highly recommended to apply them and their relatives, and it is necessary to use more complicated algorithms only if the pre-processing procedure does not provide good enough (or optimal) solution.

5.1. Main Conclusions in Detail

Here, the considerations are briefly collected for the two considered benchmark classes: the Schwerin class and the Falkenauer U class. As shown above, in a given instance, several items can be packed very easily so that their packing does not violate optimality. This step is class-dependent to some extent.
In case of the Schwerin class, the five biggest items are taken and packed into a bin. Then, the next five biggest items are taken and packed into another bin. Following this procedure about 40 % of the items are packed very fast, so that one could not do better about these items, and it is still possible to pack optimally the smaller items.
In case of the Falkenauer U class, “good pairs” are formed from the items. A good pair means two items so that their total size is just the bin capacity. It has been proved that the good pairs can be packed into their private bins, so that this packing does not violate optimal packing for the whole set. It is found that about 30 % of the items can be packed in this way.
For the sake of simplier wording, let the items allowing a simple decision described above be called easy items (i.e., this includes 40 % of items in the Schwerin instances, the biggest ones; and about 30 % of items in the Falkenauer U class, those forming the good pairs), and call the remainder of the items hard items.
Conclusion 1.
In case of both benchmark classes, the number of hard items is significantly smaller than the whole set of items.
This conclusion means that the number of items can significantly be reduced so that “hard decision” should be made only for the reduced set of items. Naturally, the smaller the number of items, the simpler is the decision of how to get an optimal packing.
Hence, the “easy” items got packed, and there remained only the “hard” items. For the latter, some greedy-type algorithms have been designed, that successfully pack the hard items optimally for 100 % of the instances in the Schwerin class and for about 91 % of the instances in the Falkenauer U class. This yields a second conclusion.
Conclusion 2.
There exists a greedy-type algorithm that packs the items optimally for a high percentage of the instances.

5.2. Further Research

Here, some options are briefly reviewed that can be applied to improve the efficiency of the algorithm ALG FU further (that is applied to solve the instances from the Falkenauer U class). Recall that, in case of the Schwerin class, it is possible to solve all instances optimally, so there is no need to “improve” the algorithm applied for that class. But, in case of the Falkenauer U class, optimal solutions were obtained for about 91 percentage of the instances. So, here, there is some room for possible improvement.
  • One can apply not only one but several parameter settings, i.e., make several runnings so that the parameters of the algorithm (listed in Table 4 and Table 5) are chosen in several different ways, and finally choose the best solution. Naturally, if some running provides the optimal solution then there is no need to apply any further setting and running.
  • One can take into account further parameters, e.g., not only the “existence” of some big unpacked items but also their number.
It is also a question, what happens if the number of items grows.
Suppose that C (the integer bin size) is fixed, then as a consequence all integer sizes come from the interval [ 1 , C ] . Then, a classical theorem of Lenstra says that the problem can be solved in polynomial time in n, the number of items. Despite polynomial solvability, the number of steps in such an algorithm is huge, as the exponent of n is very big, as well as the coefficient in the O(.) notation can also be very big. For this reason, such an algorithm cannot be used in practice.
On the other hand, this theorem does not take into account if the sizes are drawn randomly from some interval. So, let the following conjecture be stated.
Conjecture 1.
Let 1 a < b C be fixed integers, where C represents the bin size. Assume that the n item sizes are chosen at random with uniform distribution from the integers a , a + 1 , , b . Then, there exists an algorithm whose running time is a low-degree polynomial with practically applicable fairly small coefficients, that solves the instance optimally with probability tending to 1 as n .
For example, an algorithm with running time 20 n 4 and performing optimally with probability 0.9 for n = 1000 may already be of interest.

5.3. Limitations

Naturally, greedy-type methods do have limitations, since the bin packing problem is strongly NP-hard. What are the limitations?
Note that, in both cases (Schwerin class and Falkenauer U class), the item sizes are drawn from some interval. In case of the Schwerin class, the bin size is 1000, and the item sizes are between 150 and 200. This is a relatively narrow interval. In case of the Falkenauer U class, the interval is not so narrow: the bin size is 150, and the items’ sizes are between 20 and 100.
This leads to the following conclusion.
Conclusion 3.
The narrower the interval from which the item sizes are taken, the bigger is the chance that an efficient greedy algorithm can be built.
Note that, in both classes, the item sizes are drawn randomly, according to uniform distribution. It means that further research will be needed for other types of instances where the item sizes are determined in some other ways, e.g., by a very malicious adversary.
The results presented here also demonstrate that, in case of the Falkenauer U class, the greedy algorithm works well if the reserve (the total space left unused in the bins) is relatively large. If the initial reserve is small, then the chance to obtain an optimal solution by a greedy-type method is really small or even impossible.

Author Contributions

Investigation, G.Á., G.D., T.D., Z.T. and Á.W.-S.; Software, G.Á.; Writing—original draft, G.Á., G.D., Z.T. and Á.W.-S.; Writing— review& editing, T.D. developed by the first author; all other parts of this work shared by the authors. All authors have read and agreed to the published version of the manuscript.

Funding

Project TKP2020-NKA-10 has been implemented with the support provided from the National Research, Development and Innovation Fund of Hungary, financed under the 2020-4.1.1-TKP2020 Thematic Excellence Programme 2020–National Challanges sub-program funding scheme. The authors acknowledge financial support also from the Slovenian–Hungarian bilateral project “Optimization and fault forecasting in port logistics processes using artificial intelligence, process mining and operations research”, grant 2019-2.1.11-TÉT-2020-00113, and from the National Research, Development and Innovation Office–NKFIH under the grant SNN 129364. Tibor Dulai is also supported by the ÚNKP-20-4 New National Excellence Program of the Ministry for Innovation and Technology from the source of the National Research, Development and Innovation Fund.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Program codes and computational results are available from the first author’s official web page, https://virt.uni-pannon.hu/index.php/hu/a-tanszekrol/oktatoi-oldalak/184-abraham-gyula accessed on 18 April 2021 [64].

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Coffmann, E.G.; Garey, M.R.; Johnson, D.S. Approximation algorithms for bin packing: A survey. In Approximation Algorithms for NP-Hard Problems; Hochbaum, D., Ed.; PWS Publishing: Boston, MA, USA, 1997. [Google Scholar]
  2. Garey, M.R.; Johnson, D.S. Computer and Intractability: A Guide to the Theory of NP-Completeness; Freeman: New York, NY, USA, 1979. [Google Scholar]
  3. Johnson, D.S. Near-Optimal Bin Packing Algorithms. Ph.D. Thesis, Massachusetts Institute of Technology, Cambridge, MA, USA, 1973. [Google Scholar]
  4. Graham, R.L. Bounds for certain multiprocessing anomalies. Bell Syst. Tech. J. 1966, 45, 1563–1581. [Google Scholar] [CrossRef]
  5. Graham, R.L. Bounds on multiprocessing timing anomalies. SIAM J. Appl. Math. 1969, 17, 263–269. [Google Scholar] [CrossRef] [Green Version]
  6. Ullman, J.D. The Performance of a Memory Allocation Algorithm; Technical Report 100; Princeton University: Princeton, NJ, USA, 1971. [Google Scholar]
  7. Garey, M.R.; Graham, R.L.; Ullman, J.D. Worst-case analysis of memory allocation algorithms. In Proceedings of the 4th Symposium Theory of Computing (STOC); ACM: New York, NY, USA, 1973; pp. 143–150. [Google Scholar]
  8. Johnson, D.S.; Demers, A.; Ullman, J.D.; Garey, M.R.; Graham, R.L. Worst-case performance bounds for simple one-dimensional packing algorithms. SIAM J. Comput. 1974, 3, 299–325. [Google Scholar] [CrossRef] [Green Version]
  9. Simchi-Levi, D. New worst case results for the bin-packing problem. Nav. Res. Logist. 1994, 41, 579–585. [Google Scholar] [CrossRef]
  10. Dosa, G.; Sgall, J. First Fit bin packing: A tight analysis. In Proceedings of the 30th International Symposium on Theoretical Aspects of Computer Science (STACS2013), LIPIcs 3, Schloss Dagstuhl, Kiel, Germany, 27 February–2 March 2013; pp. 538–549. [Google Scholar]
  11. Dosa, G.; Sgall, J. Optimal analysis of Best Fit bin packing. In ICALP 2014, Part I; Lecture Notes in Computer Sciences; Springer: Berlin/Heidelberg, Germany, 2014; pp. 429–441. [Google Scholar]
  12. Dosa, G. The tight bound of First Fit Decreasing bin-packing algorithm is FFD(I) ≤ 11/9 ≤ OPT(I) + 6/9. In Proceedings of the 1st International Symposium on Combinatorics, Algorithms, Probabilistic and Experimental Methodologies (ESCAPE), Lecture Notes in Computer Sciences, Hangzhou, China, 7–9 April 2007; pp. 1–11. [Google Scholar]
  13. Dosa, G.; Li, R.; Han, X.; Tuza, Z.S. Tight absolute bound for First Fit Decreasing bin-packing: FFD(L) ≤ 11/9·OPT(L)+ 6/9. Theor. Comput. Sci. 2013, 510, 13–61. [Google Scholar] [CrossRef]
  14. Fernandez de la Vega, W.; Lueker, G.S. Bin packing can be solved within 1 + ε in linear time. Combinatorica 1981, 1, 349–355. [Google Scholar] [CrossRef]
  15. Karmarkar, N.; Karp, R.M. An efficient approximation scheme for the one-dimensional bin packing problem. In Proceedings of the 23rd Annual Symposium on Foundations of Computer Science, Chicago, IL, USA, 3–5 November 1982; pp. 312–320. [Google Scholar]
  16. Delorme, M.; Iori, M.; Martello, S. Bin Packing and Cutting Stock Problems: Mathematical Models and Exact Algorithms. Eur. J. Oper. Res. 2016, 255, 1–20. [Google Scholar] [CrossRef]
  17. Valério de Carvalho, J.M. LP models for bin packing and cutting stock problems. Eur. J. Oper. Res. 2002, 141, 253–273. [Google Scholar] [CrossRef]
  18. Wei, L.; Luo, Z.; Baldacci, R.; Lim, A. A new branch-and-price-and-cut algorithm for one-dimensional bin-packing problems. INFORMS J. Comput. 2020, 32, 428–443. [Google Scholar] [CrossRef]
  19. Dokeroglu, T.; Cosar, A. Optimization of one-dimensional bin packing problem with island parallel grouping genetic algorithms. Comput. Ind. Eng. 2014, 75, 176–186. [Google Scholar] [CrossRef]
  20. Loh, K.; Golden, B.; Wasil, E. Solving the one-dimensional bin packing problem with a weight annealing heuristic. Comput. Oper. Res. 2008, 35, 2283–2291. [Google Scholar] [CrossRef]
  21. Kucukyilmaz, T.; Kiziloz, H.E. Cooperative parallel grouping genetic algorithm for the one-dimensional bin packing problem. Comput. Ind. Eng. 2018, 25, 157–170. [Google Scholar] [CrossRef]
  22. Borgulya, I. A hybrid evolutionary algorithm for the offline Bin Packing Problem. Cent. Eur. J. Oper. Res. 2021, 29, 425–445. [Google Scholar] [CrossRef]
  23. Buljubašić, M.; Vasquez, M. Consistent neighborhood search for one-dimensional bin packing and two-dimensional vector packing. Comput. Oper. Res. 2016, 76, 12–21. [Google Scholar] [CrossRef]
  24. Alvim, A.C.F.; Ribeiro, C.C.; Glover, F.; Aloise, D.J. A Hybrid Improvement Heuristic for the One-Dimensional Bin Packing Problem. J. Heuristics 2004, 10, 205–229. [Google Scholar] [CrossRef]
  25. Brugger, B.; Doerner, K.F.; Hartl, R.F.; Reimann, M. AntPacking—An Ant Colony Optimization Approach for the One-Dimensional Bin Packing Problem. In Evolutionary Computation in Combinatorial Optimization; Gottlieb, J., Raidl, G.R., Eds.; EvoCOP 2004; Lecture Notes in Computer Science, 3004; Springer: Berlin/Heidelberg, Germany, 2004. [Google Scholar]
  26. Laurent, A.; Klement, N. Bin Packing Problem with priorities and incompatibilities using PSO: Application in a health care community. IFAC-PapersOnLine 2019, 52, 2596–2601. [Google Scholar] [CrossRef]
  27. Abdel-Basset, M.; Manogaran, G.; Abdel-Fatah, L.; Mirjalili, S. An improved nature inspired meta-heuristic algorithm for 1-D bin packing problems. Pers. Ubiquitous Comput. 2018, 22, 1117–1132. [Google Scholar] [CrossRef]
  28. Zendaoui, Z.; Layeb, A. Adaptive Cuckoo Search Algorithm for the Bin Packing Problem. In Modelling and Implementation of Complex Systems; Chikhi, S., Amine, A., Chaoui, A., Kholladi, M., Saidouni, D., Eds.; Lecture Notes in Networks and Systems, 1; Springer: Cham, Switzerland, 2016. [Google Scholar]
  29. Jain, M.; Singh, V.; Rani, A. A novel nature-inspired algorithm for optimization: Squirrel search algorithm. Swarm Evol. Comput. 2019, 44, 48–175. [Google Scholar] [CrossRef]
  30. Munien, C.; Mahabeer, S.; Dzitiro, E.; Singh, S.; Zungu, S.; Ezugwu, A.E.S. Metaheuristic Approaches for One-Dimensional Bin Packing Problem: A Comparative Performance Study. IEEE Access 2020, 8, 227438–227465. [Google Scholar] [CrossRef]
  31. Babalik, A. Implementation of Bat Algorithm on 2D Strip Packing Problem. In Intelligent and Evolutionary Systems; Lavangnananda, K., Phon-Amnuaisuk, S., Engchuan, W., Chan, J., Eds.; Proceedings in Adaptation, Learning and Optimization; Springer: Cham, Switzerland, 2016; Volume 5, pp. 209–218. [Google Scholar]
  32. Gherboudj, A. African Buffalo Optimization for One Dimensional Bin Packing Problem. Int. J. Swarm Intell. Res. (IJSIR) 2019, 10, 38–52. [Google Scholar] [CrossRef]
  33. Odili, J.B.; Kahar, M.N.M.; Anwar, S. African Buffalo Optimization: A Swarm-Intelligence Technique. Procedia Comput. Sci. 2015, 76, 443–448. [Google Scholar] [CrossRef] [Green Version]
  34. Gourgand, M.; Grangeon, N.; Klement, N. An Analogy between Bin Packing Problem and Permutation Problem: A New Encoding Scheme. In Proceedings of the IFIP International Conference on Advances in Production Management Systems (APMS); Springer: Berlin/Heidelberg, Germany, 2014; pp. 572–579. [Google Scholar]
  35. Feng, H.; Ni, H.; Zhao, R.; Zhu, X. An Enhanced Grasshopper Optimization Algorithm to the Bin Packing Problem. J. Control Sci. Eng. 2020, 2020, 3894987. [Google Scholar] [CrossRef] [Green Version]
  36. Coffman, E.G., Jr.; Csirik, J.; Galambos, G.; Martello, S.; Vigo, D. Bin packing approximation algorithms: Survey and classification. In Handbook of Combinatorial Optimization; Pardalos, P.M., Du, D.-Z., Graham, R.L., Eds.; Springer: New York, NY, USA, 2013. [Google Scholar]
  37. Yang, T.; Luo, F.; Fuentes, J.; Ding, W.; Gu, C. A flexible reinforced bin packing framework with automatic slack selection. Math. Probl. Eng. 2021, 2021, 6653586. [Google Scholar] [CrossRef]
  38. Crainic, T.G.; Fomeni, F.D.; Rei, W. Multi-period bin packing model and effective constructive heuristics for corridor-based logistics capacity planning. Comput. Oper. Res. 2021, 132, 105308. [Google Scholar] [CrossRef]
  39. Witteman, M.; Deng, Q.; Santos, B.F. A bin packing approach to solve the aircraft maintenance task allocation problem. Eur. J. Oper. Res. 2021, 294, 365–376. [Google Scholar] [CrossRef]
  40. Munien, C.; Ezugwu, A.E. Metaheuristic algorithms for one-dimensional bin-packing problems: A survey of recent advances and applications. J. Intell. Syst. 2021, 30, 636–663. [Google Scholar] [CrossRef]
  41. Martinovic, J.; Strasdat, N.; Selch, M. Compact integer linear programming formulations for the temporal bin packing problem with fire-ups. Comput. Oper. Res. 2021, 132, 105288. [Google Scholar] [CrossRef]
  42. Bin Packing Benchmarks of Homepage Unibo. Available online: http://or.dei.unibo.it/library/bpplib (accessed on 18 April 2021).
  43. Falkenauer, E. A hybrid grouping genetic algorithm for bin packing. J. Heuristics 1996, 2, 5–30. [Google Scholar] [CrossRef] [Green Version]
  44. Scholl, A.; Klein, R.; Bison, C.J. A fast hybrid procedure for exactly solving the one-dimensional bin packing problem. Comput. Oper. Res. 1997, 24, 627–645. [Google Scholar] [CrossRef]
  45. Wäscher, G.; Gau, T. Heuristics for the integer one-dimensional cutting stock problem: A computational study. OR Spectr. 1996, 18, 131–144. [Google Scholar] [CrossRef]
  46. Schwerin, P.; Wäscher, G. The bin-packing problem: A problem generator and some numerical experiments with FFD packing and MTP. Int. Trans. Oper. Res. 1997, 4, 377–389. [Google Scholar] [CrossRef]
  47. Schoenfield, J.E. Fast, Exact Solution of Open Bin Packing Problems without Linear Programming; Technical Report; US Army Space and Missile Defense Command: Huntsville, AL, USA, 2002. [Google Scholar]
  48. Gschwind, T.; Irnich, S. Dual Inequalities for Stabilized Column Generation Revisited. INFORMS J. Comput. 2016, 28, 175–194. [Google Scholar] [CrossRef] [Green Version]
  49. Adamuthe, A.; Nitave, T. Harmony search algorithm with adaptive parameter setting for solving large bin packing problems. Decis. Sci. Lett. 2020, 9, 581–594. [Google Scholar] [CrossRef]
  50. Brearley, G.; Mitra, A.H.W. Analysis of Mathematical Programming Problems Prior to Applying the Simplex Method. Math. Program. 1975, 8, 54–83. [Google Scholar] [CrossRef]
  51. Tomlin, J.; Welch, J. A pathological case in the reduction of linear programmings. Oper. Res. Lett. 1983, 2, 53–57. [Google Scholar] [CrossRef]
  52. Tomlin, J.; Welch, J. Formal optimization of some reduced linear programming problems. Math. Program. 1983, 2, 232–240. [Google Scholar] [CrossRef]
  53. Andersen, E.; Andersen, K. Presolving in Linear Programming. Math. Program. 1995, 71, 221–245. [Google Scholar] [CrossRef]
  54. Gondzio, J. Presolve Analysis of Linear Programs Prior to Applying an Interior Point Method. INFORMS J. Comput. 1997, 9, 73–91. [Google Scholar] [CrossRef]
  55. Savelsbergh, M.W.P. Preprocessing and Probing Techniques for Mixed Integer Programming Problems. ORSA J. Comput. 1994, 6, 445–454. [Google Scholar] [CrossRef] [Green Version]
  56. Achterberg, T.; Bixby, R.E.; Gu, Z.; Rothberg, E.; Weninger, D. Multi-row presolve reductions in Mixed Integer Programming. In Proceedings of the Twenty-Sixth RAMP Symposium, Tokyo, Japan, 16–17 October 2014; pp. 1–16. [Google Scholar]
  57. Achterberg, T.; Bixby, R.E.; Gu, Z.; Rothberg, E.; Weninger, D. Presolve reductions in Mixed Integer Programming. INFORMS J. Comput. 2020, 32, 473–506. [Google Scholar] [CrossRef]
  58. Gemander, P.; Chen, W.K.; Weninger, D.; Gottwald, L.; Gleixner, A.; Martin, A. Two-row and two-column mixed-integer presolve using hashing-based pairing methods. EURO J. Comput. Optim. 2020, 8, 205–240. [Google Scholar] [CrossRef]
  59. Meszaros, C.S.; Suhl, U.H. Advanced preprocessing techniques for linear and quadratic programming. OR Spectr. 2003, 25, 575–595. [Google Scholar] [CrossRef]
  60. Johnson, E.L.; Nemhauser, G.L.; Savelsbergh, M.W.P. Progress in Linear Programming-Based Algorithms for Integer Programming: An Exposition. INFORMS J. Comput. 2000, 12, 2–23. [Google Scholar] [CrossRef]
  61. Kellerer, H.; Pferschy, U.; Pisinger, D. Knapsack Problems; Springer: Boston, MA, USA, 2004; pp. 1–20. [Google Scholar]
  62. Martello, S.; Toth, P. Lower bounds and reduction procedures for the bin packing problem. Discret. Appl. Math. 1990, 28, 59–70. [Google Scholar] [CrossRef]
  63. Fekete, S.; Schepers, J. New classes of fast lower bounds for bin packing problems. Math. Program 2001, 91, 11–31. [Google Scholar] [CrossRef]
  64. Official Web Page of Gyula Ábrahám. Available online: https://virt.uni-pannon.hu/index.php/hu/a-tanszekrol/oktatoi-oldalak/184-abraham-gyula (accessed on 18 April 2021).
Table 1. Comparison with FFD for the AI and ANI classes.
Table 1. Comparison with FFD for the AI and ANI classes.
AI ANI
#%#%
F F D = U B 13152.4250100
F F D > U B 11947.600
Total250100250100
Table 2. Comparison with F F D for several further classes.
Table 2. Comparison with F F D for several further classes.
DataSet1DataSet2Falk_URGI
#%#%#%#%
F F D = O P T 54675.8323649.1767.5160141.69
F F D > O P T 17424.1724450.837492.5223958.31
Total720100480100801003840100
Table 3. Running times of the Schwerin benchmark problems, compared to HEA average.
Table 3. Running times of the Schwerin benchmark problems, compared to HEA average.
ClassTotal (s)Average (s)HEA Average (s)
Schwerin 10.38178110.0038178110.34
Schwerin 20.4087630.004087630.47
Table 4. Parameter setting for the Falkenauer U class in lines 1–13.
Table 4. Parameter setting for the Falkenauer U class in lines 1–13.
r 11 r 12 r 13 r 14 r 15 r 16 r b 21 r b 22 r b 23 r b 24 r b 25 r b 26
U1200123450510152025
U2500123040500510303030
U500010153030300510152025
U100003045609010001010101010
Table 5. Parameter setting for the Falkenauer U class in lines 16–26.
Table 5. Parameter setting for the Falkenauer U class in lines 16–26.
r n 21 r n 22 r n 23 r n 24 r n 25 r n 26 r 31 r 32 r 33
U1200510153030000
U2500510303030000
U5000515303030000
U100003040506070000
Table 6. Results of Falkenauer U120 problems.
Table 6. Results of Falkenauer U120 problems.
v1 v2v3
FFD Path Search
150149148150149148145145LBReserve
u120_00494848504849484848122
u120_01494949494949494949145
u120_02464646464646464646106
u120_0350494950494949494965
u120_04505050505050505050146
u120_0548484848484848484878
u120_0648484848484848484863
u120_0750504950494949494955
u120_0851505051505051505022
u120_0947464647464647464630
u120_10525252525252525252120
u120_11504950515050494949103
u120_1248484848484848484820
u120_13494949494949494949148
u120_14505050505050505050127
u120_1548484848484848484898
u120_16525252525252525252112
u120_1753525254525252525297
u120_1849494949494949494995
u120_1950505050505050494928
Table 7. Running times of the Falkenauer U benchmark problems, compared to HEA average.
Table 7. Running times of the Falkenauer U benchmark problems, compared to HEA average.
ClassTotal (s)Average (s)HEA Average (s)
Falkenauer U 1200.2418590.012092951.48
Falkenauer U 2501.16334590.058167295
Falkenauer U 5004.14699280.20734964
Falkenauer U 100026.31618321.31580916
Falkenauer U31.86838090.39835481.48
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Ábrahám, G.; Dósa, G.; Dulai, T.; Tuza, Z.; Werner-Stark, Á. Efficient Pre-Solve Algorithms for the Schwerin and Falkenauer_U Bin Packing Benchmark Problems for Getting Optimal Solutions with High Probability. Mathematics 2021, 9, 1540. https://doi.org/10.3390/math9131540

AMA Style

Ábrahám G, Dósa G, Dulai T, Tuza Z, Werner-Stark Á. Efficient Pre-Solve Algorithms for the Schwerin and Falkenauer_U Bin Packing Benchmark Problems for Getting Optimal Solutions with High Probability. Mathematics. 2021; 9(13):1540. https://doi.org/10.3390/math9131540

Chicago/Turabian Style

Ábrahám, Gyula, György Dósa, Tibor Dulai, Zsolt Tuza, and Ágnes Werner-Stark. 2021. "Efficient Pre-Solve Algorithms for the Schwerin and Falkenauer_U Bin Packing Benchmark Problems for Getting Optimal Solutions with High Probability" Mathematics 9, no. 13: 1540. https://doi.org/10.3390/math9131540

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop