3-D Packing in Container using Teaching Learning Based Optimization Algorithm

: The paper aims to propose Teaching Learning based Optimization (TLBO) algorithm to solve 3-D packing problem in containers. The objective which can be presented in a mathematical model is optimizing the space usage in a container. Besides the interaction effect between students and teacher, this algorithm also observes the learning process between students in the classroom which does not need any control parameters. Thus, TLBO provides the teachers phase and students phase as its main updating process to find the best solution. More precisely, to validate the algorithm effectiveness, it was implemented in three sample cases. There was small data which had 5 size-types of items with 12 units, medium data which had 10 size-types of items with 106 units, and large data which had 20 size-types of items with 110 units. Moreover, it was also compared with another algorithm called Gravitational Search Algorithm (GSA). According to the computational results in those example cases, it can be concluded that higher number of population and iterations can bring higher chances to obtain a better solution. Finally, TLBO shows better performance in solving the 3-D packing problem compared with GSA


Introduction:
Transportation plays a vital role in the socialeconomic aspect as a national, regional, and local distribution channel, both in urban and rural areas. Available items are distributed from companies to serve the customers by available distribution channels 1 .
Besides routing management optimization 2 , critical activity in distribution is the packaging of items. Packaging in industrial activities especially logistics is based on the increased total cost of storing and distributing manufactured items. Using an optimal package, more items can be put into the container to minimize the use amount of the transport carrier and shipping costs 3 . Therefore, the companies can save more money in this aspect since the shipping costs are minimized.
A container 3-D packing problem is a complex problem in optimization. Besides having to consider the container volume which has length, width and height, this problem also considers the items volumes and shapes. Some researchers have proposed several technical placement methods to solve this problem. The container packaging problem discussed in this paper focuses on items having rectangular shapes where one large rectangular box called a container will be filled with different sizes smaller rectangular 4 . The objective of this item's packaging problem is to minimize the space used in the container. The optimal items placement in the container can optimize the item distribution since it will reduce the number of delivery routes. Some methods have been used to solve this problem such as hybrid genetic algorithm 4,5 and tabu search algorithm 6 . A coevolutionary multi-objective genetic algorithm has been proposed by adding the encoding and decoding process in order to apply the items placement procedure 4 . While another genetic algorithm hybridization used some rules in the decoding process for replacements 5 .
An algorithm based on the influence of interaction between teacher and students and between students in the classroom has been proposed called Teaching Learning-Based Optimization (TLBO) algorithm. The TLBO algorithm presents two types of teaching-learning: (i) through the teacher known as the teacher phase and (ii) through interacting with other students known as the student phase. Similar to other optimization algorithms, the TLBO brings population and number of iterations as its parameters. A population is considered as student group, while the design variables is considered as various subjects offered to the students 7 . Some optimization problems have been solved using TLBO. It has been proven to solve specific issues, such as problems related to power 8 and optimizing power flow problems 9 .
The TLBO algorithm has a special technique to find the optimal solution by removing the specific parameters from the process. It only requires general algorithmic parameters i.e size of population and design variables 7 . Since TLBO is free from tuning parameters, the usages of TLBO are more straightforward and the resulting solution is a global solution 7 . Based on research conducted by Rao et al. 10 , the TLBO algorithm saves the best solution in each iteration to improve the current solutions in order to obtain a convergence towards one point. A comparison between TLBO and several swarm intelligence-based metaheuristics algorithms such as Genetic Algorithm (GA), Artificial Bee Colony (ABC) and Ant Colony System (ANTS) has been conducted. Compared with those algorithms and Grenade Explosion Method (GEM), the TLBO algorithm is satisfactory effective in computation and consistency term 11 . By using the TLBO, it is expected to find a better solution by minimizing space in containers. In order to validate its performance, the TLBO algorithm was compared with Gravitational Search Algorithm Based on the research that has been conducted, GSA requires a shorter computing time to get a better solution than the Particle Swarm Optimization (PSO) 13 . This paper is designed thusly: next section is problem formulation continues with the overview of discussed algorithms. Then the procedure to solve the problem is presented in the next section. Last, before the conclusion, a short discussion is presented.

Problem Formulation:
The 3-D packing problem in the container is that items called items smaller than the container are arranged, both in the form of blocks or cubes.
The objective of this problem is to minimize the space in the container 14 . It is assumed that all the items can be placed in the container. In 3-D packing problem, there is a number of items ( ) that have length, width, and height, as well as containers with a fixed-length ( ), fixed-width ( ) and fixed-height ( ). The items are placed in containers effectively and adequately to optimize the objective function 15 . The illustration of 3-D packing problem is presented in Fig. 1. Container shapes can be represented as layers and strips to make this model simpler. The container length is divided as layers representing the items placement while strips partite the container height. The placement of the items will be started from the first layer and strip. After the first layer is full filled, the next item will be placed on the next strip but the same layer. Therefore, the objective function is to minimize the total thickness of layers ( , = 1,2, … , ) where denotes the number of layers in the container.

Figure 1. 3-D Packing Problem Illustration
Mathematically, for number of items, this problem is described as follows while the notation description is presented in Table 1. Eq.1 explains the objective function of this 3-D packing problem while Eqs.2,3 are the constraints. As explained in the previous section, the objective of this problem is to minimize the space used in the container.
Eq.2 states that the entire length of the -th item on the -th strip -th layer must not exceed the container's width. Meanwhile, Eq.3 is a constraint that states that the height -th item on the -th strip -th layer that is summed with the height of ℎ -th strip -th layer must not exceed the size of the container.

Overview of the Algorithm:
This section explains an overview of Teaching Learning Based Optimization (TLBO) algorithm and the compared algorithm, Gravitational Search Algorithm (GSA).

TLBO Algorithm
The teaching and learning process is the main idea for this algorithm. Teaching process involves an interaction between teacher and students while the learning process covers the interaction between students in the classroom based on its output. TLBO only requires general parameters: population and design variables. Population considers a group of students and the design variables as the various available subjects. Students learning outcomes or values are represented as the fitness values for the problems optimized. Two phases of learning are introduced in this algorithm: (i) teacher phase associates to outcomes learning process through the teacher and (ii) students phase associates to interaction with other students 16 .
The first TLBO algorithm phase is the teacher phase which the student studies through a teacher. In this learning process, the teacher lectures students supposing improves the average class performances in the subjects taught by the teacher depending on the teacher's abilities. At each iteration i, it is assumed that m number of subjects as design variables ( = 1,2, … , ), n number of students as population size ( = 1,2, … , ) and , are average results students in certain subjects − ℎ in iteration . The best learner is a student who has the best result, , , for all subjects tested compared with students in population for iteration . However, teacher has a task to motivate students to obtain better scores in all subjects. Furthermore, student who gets the best score in all subjects can be selected as a teacher. The modification is given below and the description of the notation is in Table  2. teacher phase, the fitness values obtained at the end of this phase will continue to the student phase as an input. The second basic model of learning is the student phase. The student phase is the second stage of the algorithm, where students interact among themselves in order to improve their knowledge. Students interact with other students and learn new things if other students have more ability. It is assumed that two students interact with P and Q so that , ≠ , . For the objective function of minimizing using the equation: , is better than , then update , , using Eq.7 for minimizing problem and Eq.9 for maximizing problem. If , is worse than , then update , , using Eq.8 for minimizing problem and Eq.10 for maximizing problem. , , is approved if it provides better fitness value 14 . The overall steps of this algorithm are presented in Fig. 2.

GSA
In 2009, Rashedi et al. introduced GSA. The GSA is inspired by the object gravity law considering the mass presences. In this algorithm, each individual is assumed to be an object, and their performance is seen from its mass. Each object interacts with other things through the force of gravity. The heavier the mass of the object, the better solution. A more severe group expresses slow movement 10 .
There are four specifications described in GSA i.e the objects positions, mass of inertial, their mass in active gravitational, and their mass in passive gravitational. The part of the object is the solution to the problem. The fitness value determines the gravitational mass and inertial mass. This algorithm is directed by adapting the mass of gravitational and inertial. There are three parameters used in GSA, such as the initial gravitational constant ( 0 ), the coefficient of decrease ( ), the epsilon value ( ). With 0 , , is a non-negative number. Following are the steps in GSA 17 : i) Initialization of parameter Initialization of parameters is used to solve the problem, such as the number of objects, initial gravitational constant, alpha value ( ), epsilon value ( ), and maximum iteration. ii) Initialization population Generating the initial population of objects consisting of random real numbers at the interval (0,1). The process of developing a population is done as many as (number of objects). iii) Initialization velocity of an object It is the same as generating an initial population of objects. Effecting the initial velocity of things consisting of random real numbers at the interval (0,1) of the number of units of items. The process of generating a population is done as many as (number of objects). iv) Grouping items by the type Each dimension of the object will be transformed into a sequence of items to be put into the container. The first step is to sort the dimensions from the smallest to the biggest and then number the dimension. From the numbering, the data is modified in such a way as to order items by type. v) Objective function evaluation Evaluating the objective function for each object. vi) Update the gravitational constant, best, worst Gravitational constant (G), best, worst is always updated for each iteration. To determine the gravitational constant obtained using Eq.11 in the following formula: : maximum iteration Then determine best and worst. vii) Calculates inertial mass for each object Calculating the mass of inertial, mass of active gravitational and passive gravitational. To determine these masses, the thing to do is calculate the mass value of objects for each iteration with Eq.12, which is in the formula as follows: : the sum of the mass weight of all objects on -th iteration viii) Calculates the force for each object The next step is to calculate the total force on each object. To find out the actual object, the thing to do is to figure the object against other objects in each dimension. Therefore, Eq.15 is used as follows: with the calculation of ( ), which is the distance of object with object in Eq.16 as follows 11 : From the force of one object to another with the formula above, the total energy of each object can be determined using Eq.17 as follows: where ( ): total force of object -th in -th dimension on iteration : uniform real numbers generated randomly in (0,1) for object ix) Calculates the acceleration for each object After the total force of each object has been obtained, the next step is to calculate the acceleration for each object in each dimension. Determine the using acceleration Eq.18 as follows: where ( ): acceleration of object in -th dimension on iteration x) Update velocity and position of the object for the next iteration With the acceleration of each object that has been obtained, the velocity and position for the next iteration can be calculated. To find out the velocity of each object can be calculated using Eq.19 as follows: : velocity of object in -th dimension on iteration + 1 : uniform real numbers generated randomly in (0,1) for object After the velocity for each object is obtained, then the position for the next iteration can be calculated using Eq.20 as follows: ( + 1) = ( ) + ( + 1) 20 where ( + 1) : position of object in -th dimension on iteration + 1 xi) Check the maximum iteration In this step, a maximum iteration is checked.
If the ultimate iteration has been reached, the results of the best objective function can be displayed. If the complete iteration has not been called, a new position has been formed, and the objective function is calculated. The optimization problem that appeared in this 3-D packing problem is to find the ideal placement of available items in a container so that the space uses can be optimized. The solution in the algorithm represents the sequence of items placement. After the solution is obtained, then the objective function of each solution is determined in order to find the best items placement. This procedure refers to the objective function calculation of TLBO algorithm presented in Fig.2. For = 1,2, … , items where is the placement order index, the placement method can be described as follows 15 : 1) Assign the th item in the container based on the available layer and strip. 2) Check whether the item can be placed on a given layer. If it is possible, then continue to the next step. Otherwise, go to step 7. 3) Put the th item in the container in the given layer and strip. 4) Update the length remains in the layer or height remains in the strip. Go to step 1 for the next item. 5) Check whether the item can be placed on a given strip. If it is possible, then continue to step 3. Otherwise, continue to the next step.
6) Add a new layer and back to step 2. 7) Add a new strip on a given layer and back to step 5.
Steps in items placement in the container needed for the objective function calculation are shown in Fig.3.

Figure 3. Placement Steps in 3-D Packing
Result and Discussion: TLBO algorithm program to obtain the solution for the 3-D Packing problem has been implemented in three types of cases. The program is implemented in the C++ programming language using Borland C++ 5.02 Software. From the data obtained from OR-Library by J. E. Beasley, this paper used different number of items per type. In this case, there are as many as three types of data, which are small data 18 , medium 19 , and large 20 . The result of running the calculation of the objective function value using small data are packing data consisting of 5 types of items with 81 units of items, medium data composed of 10 kinds of items with 106 units of items, and big data consisting of 20 types of items with 110 units of items. The following tables are the calculation results of the objective function values obtained from the program created using two general parameters both in TLBO and GSA: the number of students/ objects and the maximum iteration. Moreover, the parameters used are the initial gravitational constant ( 0 ) = 100 and coefficient of decrease ( ) = 20 21 , epsilon value ( ) is various depending on the best result after experiments. The computational result and its comparison with GSA for small, medium, and large data are presented in Table 3, Table 4, and Table 5, respectively.  Based on Table 3, 4 and 5, the TLBO performs better using higher number of iterations. On the other hand, higher number of iterations failed to obtain a better solution in GSA as seen in Table 5. A similar pattern has happened in population size parameter. For TLBO, higher number of population size can bring a better solution in 3-D packing problem while as seen in Table 4 and 5, this parameter does not bring much effect in GSA. It is proven that the general parameters applied in TLBO is sufficient to find a better solution in this problem. Therefore, it does not require any specific or tuning parameters. Furthermore, the TLBO gives better performance compared with the GSA in all three types of data.

Conclusion:
According to the previous discussion, it can be terminated that TLBO algorithm can be implemented to solve the problem of 3-D Packing. The simulation results demonstrate that TLBO algorithm provides a better solution when the number of iteration and the number of students increases. Moreover, it performs better compared with GSA in solving the 3-D Packing problem.