An optimization system for container loading

1 downloads 0 Views 200KB Size Report
in which a simple greedy algorithm is employed to allocate objects, whereby ... A common sense knowledge is that subsets of objects .... of data structure is different. ..... [4] M.R. Garey and D.S. Johnson, Computers and Intractability: A Guide.

An optimization system for container loading based on metaheuristic algorithms Sadaaki Miyamoto

Yasunori Endo

Faculty of Systems and Information Engineering, University of Tsukuba, Ibaraki 305-8573, Japan E-mail:[email protected]

Faculty of Systems and Information Engineering, University of Tsukuba, Ibaraki 305-8573, Japan E-mail: [email protected]

Koki Hanzawa

Yukihiro Hamasuna

Master’s Program in Risk Engineering, Graduate School of Systems and Information Engineering, University of Tsukuba, Ibaraki 305-8573, Japan

Master’s Program in Risk Engineering, Graduate School of Systems and Information Engineering, University of Tsukuba, Ibaraki 305-8573, Japan

Abstract— Abstract. A family octs, and computational requirement. Commonsense and expert knowledge incorporation is considered to combine with metaheuristics. Handling groups of objects in a metaheuristic scheme is moreover considered. Numerical examples are given.

I. I NTRODUCTION Container loading problems have been studied by a variety of different methods. Yet they are attracting more researchers’ attention now, mainly due to remarkable progress in distribution systems and automatization in freightage. In this paper we consider a system for a class of automatic container loading problems. Many related studies formulate such problems as optimization of allocating boxes or objects of various shapes [1], [2], [3], [5], [10], [11]. However, knowledge on loading is considered to be more important than optimization in the sense of efficient space utilization in a container. Our approach to this problem is incorporation of various types of knowledge in a system of optimization. For this purpose we use the methodology of metaheuristics in which a simple greedy algorithm is employed to allocate objects, whereby the incorporation of different types of knowledge becomes possible. We first describe a general framework in which an optimization system incorporating knowledge is developed. Two different optimization algorithms for allocating objects to be loaded are given. Simulation results are shown to compare effectiveness and efficiency of the two algorithms. A common sense knowledge is that subsets of objects form natural groups which are of the same shapes or their destinations are the same. Hence a family of search algorithms taking the grouping into account is studied, in which neighborhoods of groups are employed. Moreover mixed strategies of an ordinary and group-based searches are proposed. Second simulation results are shown to compare performances among the ordinary, group-based, and mixed search algorithms.

II. K NOWLEDGE AND O PTIMIZATION S YSTEM FOR C ONTAINER L OADING A container loading problem requests us a procedure of locating objects that should be loaded into a container in which objects mean cartons, boxes, parcels, cases, bags and other types that can be handled as freights in general. Many studies on container loading are based on the formulations as optimization problems; the simplest formulation is a bin packing problem, which is known to be NP-hard [4]. However, another essential feature is knowledge in the loading. Experiences tell us that frequently knowledge for loading is more important than optimization. There are various types of knowledge in actual container loading that makes the problem more complicated. Some knowledge belongs to the common sense; for example, stability of loaded objects is the most important aspect to be considered in practice. Others include strict regulations such as hazardous objects should be placed separately. Moreover there is expert knowledge that is not expressed explicitly. Thus the problem should be a mixture of such a knowledge system and an optimization system. How to mix these different characteristics is the most important point of the container loading problem. We begin with showing a list of different knowledge types in this problem. (i) (ii) (iii) (iv)

Framework knowledge, Commonsense knowledge, Regulatory knowledge, Expert knowledge.

We also show another knowledge classification scheme based on different functions in the system. (A) Formulation: Knowledge used in formulating the problem, (B) Strategies: Knowledge used as strategies, (C) Constraints: Strict knowledge used as constraints, (D) Objectives: Knowledge used as objective functions,

(E) Parameters: Knowledge represented as parameters in the system. Table I shows examples in each categories defined by the above two classifications. First column implies that a framework should be established in which an expert system and/or optimization system formulation is necessary. A simple bin packing problem is a pure optimization problem while an expert system does not consider the feature of optimization. It is obvious that both features should be taken into consideration. A promising formulation for such problem is metaheuristics, which means that heuristic procedures are used for searching a solution and a mechanism to improve a set of solutions exists as a metastructure of the heuristics. The methodology of metaheuristic optimization [1], [8], [9] is most suited to the present class of problems where a knowledge system and optimization should be considered simultaneously. A simple overview is given in Fig. 1 in which the whole system is divided into two stages. In the lower stage a greedy algorithm is used to determine locations of objects to be loaded. When loading, constraints and preferences for the object locations can be taken into account. On the other hand, the upper stage employs an optimization scheme of local search, simulated annealing [6], genetic algorithms [10], etc. to evaluate the output from the lower stage. In this stage an objective function should be used for the evaluation. The selection of an objective function is not an easy problem, and generally multiobjectives should be considered. Different types of knowledge can be included into the both stages. Let us note the followings while observing Table I. The formulation by the metaheuristic optimization encompasses the “framework knowledge” in that we should consider knowledge and optimization at the same time. We have “commonsense knowledge” such as stability of loaded objects, which can be represented as objective functions and/or constraints in selecting locations of objects when a greedy algorithm is being applied. Regulations are frequently strict and should be implemented as constraints in the greedy algorithm, while other regulations that can be relaxed may be soft constraints implementable as objective functions or preferences. Expert knowledge may be explicit or implicit. When explicit, it may either be implemented as a part of constraints, preferences, or objective functions. Implicit knowledge is harder to implement, but feedback mechanism that controls parameters in the system whereby the system performance can be adapted to experts. Notice also that these are only a small part of knowledge incorporation in the present system. III. P ROBLEM D ESCRIPTION As shown above, we formulate the loading problem as that of metaheuristic optimization [8], [9] in which knowledge incorporation is done through several methods.

First, formulation knowledge is incorporated already in the metaheuristics and the choice of greedy algorithms, since a greedy algorithm is a simple method that are flexible to knowledge incorporation. Second, knowledge base should be prepared and converted into algorithms of the system. As shown above, they should be represented as a part of criteria in a multiobjective optimization, constraints, and parameter values. These observations lead us to the following basic framework of general loading problems that consists of a triplet:     where 1) is a knowledge base in which different types of knowledge are included; 2)  is a metaheuristic optimization system of which the substructure is defined below; 3)  is a transformation mechanism whereby elements in are transformed into working knowledge in . Among the three components, the metaheuristic optimization system should be especially remarked, since the metaheuristic structure of the system controls the other two. The system of metaheuristic optimization has eight components:


The first component is the set of objects to be loaded:     . Moreover  is all sequences of the objects    ½     where      runs all permutations of   . The components  and imply the upper and lower stages in Fig. 1. In the lower stage a certain heuristic algorithm  is chosen to allocate each object  in a given order  in . In the upper stage  the order of the objects is altered using

a metaheuristic method such as the local search, the simulated annealing [6], the tabu search, or the genetic algorithm. A solution is represented by the sequence  of objects. Together with an allocation subalgorithm , the locations of the objects are determined. By using a metaheuristic method, the solutions are iteratively optimized. In a metaheuristic method, the concept of neighborhood of a solution is used. We assume a neighborhood of  is denoted by  (  ). A typical example of  is the exchange: an element    is obtained by exchanging two objects in the sequence  (see eqn.(1)). Generally an allocation subalgorithm uses a heuristic local criterion  for finding a location of an object  , which is dependent on particular implementation of . On the other hand, the optimization in the metaheuristic level  uses another global criterion  . These two criteria depend strongly on individual application and the algorithm, as we will see later. There are many choices for the algorithm  in and many different metaheuristic schemes in  . Moreover the choices are independent between  and . As noted before, knowledge is incorporated in both  and . The global criterion  includes a weighted sum of soft

constraints while the local criterion also can. The greedy algorithm includes constraints when allocating objects. IV. A LLOCATION A LGORITHMS In this section we propose algorithms for allocating objects to be loaded and optimization schemes. We assume that all objects and the container are rectangular boxes. The purpose of the algorithms is to maximize the volume ratio of the container as follows:


Here,  and  are respectively the volume of the container and that of  which are allocated in the container. A. Loading strategies In this paper, we consider two strategies of loading. One is vertical loading (see Fig. 2) and the other is flat loading (see Fig. 3). B. Constraints 1) Constraint of a container: All objects should be allocated inside a container so that no object is stuck out of the container. 2) Rotation of objects: Rotation of an object is sometimes prohibited and in other cases free. We consider two ways to rotate each object. In one way any side of an object can be the bottom, in the other way any objects can not be turned upside down. 3) Stability of objects: The measure of stability  of an object which is allocated onto other objects is defined as follows: contact space between upper object and lower objects underside space of upper object

2) Degree of brick stacking pattern: The ‘brick stacking’ pattern means that an object should be allocated regularly on the boundary of objects under the former object (see Fig. 4). Such allocation is obviously robust to vibration in transportation. We define the degree of brick stacking pattern   by the following, where ‘n.’ implies ‘numbers’. and objects on the floor means that of the container.

n. of objects allocated in brick stacking pattern n. of all allocated objects n. of objects on the floor

3) Average number of objects in brick stacking pattern: We introduce the average number of objects in the brick stacking pattern  as follows:

n. of objects right under each object

n. of allocated objects Here we assume that the number of objects which are right under the object on the floor is 1. D. Allocation Subalgorithm  In this section, we describe two allocation subalgorithms in to find the location of an object  . These subalgorithms are both based on a simple greedy algorithm, but management of data structure is different. In the following subalgorithms stability criteria in the last section are compared against predetermined thresholds. 1) Cell division management: A method to manage objects in the container uses cell division (cf. [12]), which means that a container is divided into small cells and when an object is allocated, the space occupied by the object is marked ‘1’ and those not occupied is marked ‘0’, whereby management of free space is simple and flexible. The method is called here ‘cell division’ management (see Fig. 5).

Algorithm 1: Cell division management      of the CD 1 Determine an allocation order  We called  the ratio of contact between the upper object objects and divide the container space    into and lower objects. The range of  is   .      unit cubes      

means that a part of the underside of the upper object is not    .   means that some object exists completely contacted onto the lower objects. in  and   means that any object does not exist in  . Assume that the object  is the rectangular box with    . Set  . C. Evaluation of allocation position of objects CD 2 Check  for all    and judge whether the object We employ the following criteria of stability to evaluate

 can be allocated in the cubes or not by checking staallocation positions of objects. bility using the aforementioned criteria. If  satisfies 1) Protruding ratio of objects             

2) Degree of the ‘brick stacking’ pattern     and the stability criteria, add  to 3) The average number of the brick stacking patterns the list of the allocatable positions. CD 3 Allocate  onto the cubes beginning from the position 1) Protruding ratio:  : set         

The allocation with   is not desirable in general. Hence, we define the ratio of protruding   as follows:        . CD 4 If  ! the algorithm stops, else    and go back total sum of protruding underside space of objects to CD 2.   total sum of underside space of the allocated objects   CD  3 uses admissible rotation of objects or the strategies of knowledge, e.g., vertical or flat loading (see Table I).

2) Vertex management: Second algorithm uses vertices of objects to manage the space [13]. The method is called ‘vertex management’. Algorithm 2: Vertex Management VM 1 Determine an allocation order of objects      . Initial list of vertices " is   . Set   and # . VM 2 Take $  " . VM 3 Check the followings: stability criteria, the constraint of the container, and overlapping with other objects. Check if        can be allocated using $ . If

 cannot be allocated, # #  and go back to VM 2, else go to VM 4. VM 4 Add the vertices       ,        and        to the list " and delete $ from " . If  ! the algorithm stops, else   , #  and go back toVM 2. Like Algorithm 1, VM 3 uses admissible rotation of objects. Figures 6 and 7 illustrate how the vertexes are updated. E. Metaheuristic Schemes We use a local search and the simulated annealing as metaheuristic schemes in  . A local search and the simulated annealing employ search in a neighborhood and an appropriate definition of a neighborhood  of an object . Notice that a solution  is an order of all objects. In such a case a natural neighborhood is obtained by exchanging two objects. That is, for

                    We define



A. Comparison of cell division and vertex management

In Tables III  V, we do not observe a significant difference between the cell division and vertex management. The results thus depend on the container size, the number of different shapes, and the number of objects. On the other hand, the vertex management is more efficient than the cell division from Table VI in view of the processor time. B. Comparison of initial solutions

We observe better results from the initial ordering by the sorting than the random order by the local search in Tables III  V, while the effect of the initial ordering is weaker in the simulated annealing, since the simulated annealing employs randomness and the search space becomes broader than the local search. C. Stability and evaluation of loading

We show the values ,  ,  and  in Tables VII and VIII. The values % and  are the thresholds of  , that is, if  is more than % or , the object can be allocated. From this result, we do not clearly observe the condition for occurrence of brick stacking patterns. VI. O BJECT G ROUPS As noted earlier, we have natural groupings of the objects: objects of the same shape can be put into a group, or objects having the same destination form a group. In both cases, a group of objects should be placed closely, which is common sense knowledge in most loading problems. To reflect such grouping into the metaheuristic optimization, a natural strategy is to alter a neighborhood from (1) into another type of neighborhoods based on the groups. Let a group & be a sequence of objects:



For later use, we denote the set of objects in V. F IRST S IMULATION We use the above two subalgorithms of the cell division management and the vertex management with the local search and the simulated annealing. Three sets of objects in Table II have been used with the container size is       . According to the container size, the number of cells is     in the cell division management. Moreover   % and two types of initial ordering are considered: (a) random ordering, and (b) sorting into the decreasing order of the sum of three edges of an object. Let us consider a ‘big object’ that is equal to the space of the container. All objects to be allocated are made from ‘cutting the big object into small rectangular pieces’ so that the truly optimum solution satisfies :  . We show simulation results of Cases 1  3 in Tables III  V, respectively, where LS and SA mean the local search and the simulated annealing, respectively. Moreover, Figures 8 and 9 exhibit graphic outputs for Case 1.

&        and &  is the number of objects in & .

& by

It should be noticed that frequently the sequence itself is not essential but the set &  is generally important. For two sequence & and &  , if & & and & & , then & and & have actually the same object set. Assume the solution  is separated into subsequences:


and each subsequence forms a group:

                   & &  & &   & &   &  Thus we have a sequence of groups instead of the original sequence of individual objects.

For  & &  & &   & &   & , we can define a new neighborhood    by groupwise exchange:

These groups are recovered by the next algorithm. 1. Sort '&   , #   ' into ascending order. Suppose the sorted sequence to be

     & &  & &   & &   &  #  Handling an object sequence by groups has two effects: 1) Objects in a group become a subsequence and hence placed closely in a container. This means that, e.g., objects in a group of the same destination are placed as a cluster and handling at a freight station becomes easier. 2) Search space becomes narrower by using the groups and hence the greedy subalgorithm is more efficient. A. Mixed search Mixing an ordinary search by individual objects using , which is also called a standard search (abbreviated as S), and the groupwise search using    (abbreviated as G) is studied. Notice that using a standard search  does not have a group as a subsequence in general, while a groupwise search requires those subsequences. Let us assume & &  & &   & &   & . By that  using a standard search,  is randomized into   in which & is scattered. For example &        and we may have      . Suppose we wish to perform a groupwise search for   . Recovery of groups: To recover the groups from a randomized  is necessary. A simple method is to take the mean value of the objects in a group. In order to describe this, a position function $     is employed: Suppose  is at the first position, is at the last position, and  is at the -th position in  :

         Then we define $     to be the position of  in  : $      $      $    ! The mean of the positions of objects in & is defined by  $           '&    &  Assume that the initial sequence is divided into  &  &  and then a standard search is done and the

'&½   '&¾    '&   2. For    ' , put &   &  3. Make the sequence

 & ½  & ¾   &  

Example 6.1. Let us consider an initial solution of eight objects:

           in which  is written as  for simplicity. We have &    &    &    &  &  &  &     &     &    &   &   &  After a standard search, we suppose the groups are scattered:


$    $     $    $    $     $    $    $     and accordingly,

'&    '&    '&      &    &    &  Since the sorted sequence is


 ¾  ¿    

groups are scattered in the result

        We use another function   &  to extract the subsequence corresponding to &  in which the order preserves that of  :  &   ½  ¾    

we have

&    &     &   &    &   &    

and hence

in which

        &  ( & 


 &   &  &          

VII. S ECOND S IMULATION Second set of objects to be loaded is 60 samples which have been taken from the OR library [7]. Throughout the second examples the vertex management algorithm has been used. The local search (LS) and the simulated annealing (SA) have been applied. We have compared four methods including the grouping: 1) the standard search (with the symbol S) using  which does not take any groups into account, 2) the groupwise search (with the symbol S) which employs  , 3) a mixed search (with the symbol S-G-S) which divides the whole search process into three stages: first S, second G, and finally S. The three stages have the same numbers of neighborhood searches. Notice that the group recovery is needed between the first and second stage. 4) Another mixed search (with the symbol G-S-G) divides the whole search process into three stages: first G, second S, and finally G. The three stages have the same numbers of neighborhood searches. Notice that the group recovery procedure is applied between the second and the third stage. In all four methods using LS and SA, the total number of searches is the same. In the local search, the number of searches in a neighborhood is , and the total number of iterations is  , while in the simulated annealing, the number of searches in a neighborhood is , the initial temperature is , the final temperature is  , and the ratio of decreasing temperature is  . Ten trials have been done for each of the eight algorithms. The result is shown in Table IX. It is seen that the four methods S, G, S-G-S, and G-S-G have no remarkable difference; S-GS and G-S-G outperforms S. Another virtue of the grouping is easier handling at freight stations. Although we observe the method G gives compact groupings in the loaded results, we cannot yet evaluate the compactness using an adequate measure. VIII. C ONCLUSION In this paper, a framework in which an optimization system with knowledge incorporation has been described. Secondly, two algorithms of cell division and vertex management have been proposed. Simulation examples were shown and the effectiveness was discussed. The features of cell division management are as follows: All empty space in the container can easily be recognized because the container is managed by unit cubes. Processor time becomes longer. The algorithm can handle various shapes of objects in addition to rectangular boxes. In contrast, the features of vertex management are as follows: Processor time is shorter than the cell division management.

Unnatural empty space is sometimes created. Irregular shapes are difficult to handle. In spite of the listed drawbacks, the processor time is the most crucial factor and in most real examples the vertex management is preferable. In the future, however, we will have real cases in which the cell division should also be employed. We moreover have proposed searches based on object groups. Algorithms S-G-S and G-S-G have been discussed. Note that while such object groups naturally arises in practice, we have shown that the algorithms handling groups are at least as good as an ordinary metaheuristic algorithm. Future study include testing on actual sets of objects at freight stations and evaluation of the proposed algorithms using more extensive criteria. Evaluation by experts in actual freight stations is also necessary. Acknowledgments We thank Dr. Shigeyuki Takahara of Kagawa Prefectural Industrial Technology Center, Mr. Kunimitsu Urayama of the Sanukite Co. Ltd., and Mr. Daisuke Kobayashi of the MTI Co. Ltd. for their helpful suggestions. This study has been supported by the Program for Promoting Fundamental Transport Technology Research from the Japan Railway Construction, Transport and Technology Agency (JRTT), Project Number 2004-01. R EFERENCES [1] A. Albano and G. Sapuppo, Optimal allocation of two-dimensional irregular shapes using heuristic search methods, IEEE Trans. Syst., Man, Cybern., vol.10, no.5, 1980, pp. 242–248. [2] E.E. Bischoff and M.S.W. Ratcliff, Issues in the development of approaches to container loading, Omega, vol.23, no.4, 1995, pp. 377–390. [3] A. Bortfeldt and H. Gehring, A hybrid genetic algorithm for the container loading problem, European J. Oper. Res., vol.131, 2001, pp. 143–161. [4] M.R. Garey and D.S. Johnson, Computers and Intractability: A Guide to the Theory of NP-Completeness, San Francisco: Freeman, 1979. [5] P.C. Gilmore and R.E. Gomory, Multistage cutting stock problems of two or more dimensions, Oper. Res., vol.13, 1965, pp. 94–120. [6] S. Kirkpatrick, C.D. Gelatt, and M.P. Vecchi, Optimization by simulated annealing, Science, vol.220, 1983, pp. 671–680. [7] OR library ( [8] S. Takahara and S. Miyamoto, Adaptive algorithms of metaheuristics with application to optimal allocation problems, Proc. 1999 IEEE Int. Conf. Systems, Man, and Cybernetics, Tokyo, 1999, pp. III-545–III-550. [9] S. Takahara, Y. Kusumoto and S. Miyamoto, An adaptive meta-heuristic approach using partial optimization to non-convex polygons allocation problem, Proc. 10th IEEE Int. Conf. Fuzzy Systems, Melbourne, 2001. [10] D. Smith, Bin packing with adaptive search, Proc. 1st Int. Conf. Genetic Algorithms and Their Applications, Pittsburgh, 1985, pp. 202–207. [11] Y.G. Stoyan, M.V. Novozhilova and A.V. Kartashov, Mathematical model and method of searching for a local extremum for the non-convex oriented polygons allocation problem, European J. Oper. Res., vol.92, 1996, pp. 193–210. [12] Patent, No.11-208604, Japan, 1999. [13] S. Miyamoto, Y. Endo, S. Takahara, K. Urayama, K. Terada, Metaheuristic methods and system development for automatization in freight systems, Proc. 14th Intelligent System Symposium (FAN2004), 2004, pp. 331–334.

Meta Optimization Scheme ( local search, simulated genetic algorithm,..)


Objective Functions multiobjective ( ) Selection of an Initial solution knowledge loose coupling Heuristics for object locations Greedy algorithms Constraints Preferences

Fig. 1.

Fig. 4.

Brick stacking pattern

Two stages of metaheuristic optimization system

Fig. 5.

Fig. 2.

Image of container space by cell division management

Vertical loading

Fig. 6. Three vertexes of allocatable positions of the object in vertex management

Fig. 3.

Flat loading

Fig. 7.

Adding the vertexes to the list in vertex management

TABLE II S IMULATION DATA Container Case 1 Case 2 Case 3

Cell division (random)

Cell division (sorting)




N. of shapes

Fig. 8.





47 93 42







Management Cell division (random) Cell division (sorting) Vertex management (random) Vertex management (sorting)

Vertex management (random)

N. of objects

13 33 30

Before LS/SA 76.3 79.4 71.8 73.5

After LS 91.5 97.2 91.1 89.1

After SA 92.7 92.7 91.7 90.9


Vertex management (sorting)

Management Cell division (random) Cell division (sorting) Vertex management (random) Vertex management (sorting)

Case 1 (Local search)

Before LS/SA 75.1 90.0 78.9 91.2

After LS 90.0 95.2 92.3 98.0

After SA 89.7 92.1 90.7 92.5


Cell division (random)

Cell division (sorting)


Before LS/SA

After LS

After SA

Cell division (random) Cell division (sorting) Vertex management (random) Vertex management (sorting)

72.0 78.1 69.5 76.0

84.5 88.8 87.6 92.1

89.4 87.2 86.7 88.7


Cell division

Vertex management (random) Fig. 9.

Case 1 Case 2 Case 3

Vertex management (sorting)

Case 1 (Simulated Annealing)






Vertex management







optimization and/or expert system

selection of objectives

constraints in formulation

feedback in formulation

vertical or flat loading

selection of objectives


strict regulation

stability as hard constraint

constraint or objective selection hard regulations as constraints




efficiency and/or stability

stability as soft constraint

soft regulations as objectives

explicit knowledge


preferences among objectives

stability control

soft regulations as parameters

change by expert feedback

Before LS (2/3) Before LS (1) After LS (2/3) After LS (1)

73.5 74.7 89.1 92.2

96.4 100 95.3 100

30.0 32.3 32.5 45.2

1.33 1.39 1.40 1.76

TABLE VIII explicit knowledge


Before LS (2/3) Before LS (1) After LS (2/3) After LS (1)

91.2 91.2 98.0 95.0

96.3 100 98.9 100

54.4 46.4 57.8 48.9

2.11 2.21 2.41 1.98


S 77.99 75.51

G 76.10 75.87

S-G-S 78.73 76.50

G-S-G 78.08 75.88

Suggest Documents