# Warehouse Optimization Model Based on Genetic Algorithm

Authors: Guofeng Qin; Jia Li; Nan Jiang; Qiyan Li; Lisheng Wang
Journal: Mathematical Problems in Engineering
 (2013)

---

## Abstract

This paper takes Bao Steel logistics automated warehouse system as an example. The premise is to maintain the focus of the shelf below half of the height of the shelf. As a result, the cost time of getting or putting goods on the shelf is reduced, and the distance of the same kind of goods is also reduced. Construct a multiobjective optimization model, using genetic algorithm to optimize problem. At last, we get a local optimal solution. Before optimization, the average cost time of getting or putting goods is 4.52996 s, and the average distance of the same kinds of goods is 2.35318 m. After optimization, the average cost time is 4.28859 s, and the average distance is 1.97366 m. After analysis, we can draw the conclusion that this model can improve the efficiency of cargo storage.


---

## Body

## 1. Introduction

In the process of cargo storage, it requires to assign a position for each cargo. An appropriate position for each cargo is important and influent the efficiency of cargo storage. So it is very important to manage the position of warehouse automatically. The optimization of warehouse is necessary for high efficiency [1, 2].Xiangling Xu in Xi’an University of Technology has established a knowledge library based on expert system, through analysis and summary of the job schedule and the assignment of the position in automatic warehouse system. They also discussed the feasibility of the schedule of task using expert system, through simulation by computer.Xiangli Shi in Taiyuan Heavy Machinery Institute proposed a simple model of warehouse and a new algorithm of schedule for this model. Take the task of getting or putting goods as a task which is associated with the library into a car by the task number and it does the task of cargo storage by task number.H. Brynzer proposed a principle of partition. This principle divides the whole warehouse into different pieces according to different goods, different selection method, and different type of work. As a result, it will improve the efficiency of cargo storage by putting different goods in different position. Of course, the online schedule theory cannot match the current needs because these papers only discussed this problem with single row [3].A 3D model is built in this paper, in order to analyses this problem through row, column, and layer. Perhaps, different goods could be laid in different position. When goods are got and put, there are many different roadways and multi-operation to making the stacker load balance in order to improve the storage efficiency, an optimization method will be studied as follow.


## 2. 3-Dimensional Model

Generally, In order to meet the needs of the shelf stability and improve security, heavy cargo should be kept on the ground or the lower position on the shelf, and light cargo should be put in the higher position on the shelf. As a result, it can reduce the height of the whole shelf. The advantage of this mathematical model is to ensure that the focus of the whole shelf is below half  of the height of the shelf.


### 2.1. Analysis Problem

The warehouse storage totally hasN rows, each row of shelves has P layers and Q Columns, see Figure 1(a). The kth row, ith layer, and jth column position is on the shelf  with Xkij, the goods’ weight is mkij which is put on the position, the turnover is Ikij. Each position’s height is h and the width is l, k∈[1,N], i∈[1,P], j∈ [1,Q]. The closest row near to the shipping area is the first row, the closest column near to the shipping area is the first column, and the closest layer near to the shipping area is the first layer. In this paper, the lower row, the lower layer, and the lower column are encoded. As a result, the smaller number is encoding for the lower position in the warehouse.Shelf Figure. (a) Shelf Figure. (b) The focus of Shelf.
(a)
(b)


### 2.2. Build Model

A single row of shelves of warehouse can be seen in Figure1(b). For each cargo, the overall focus of the goods is in the center of the cargo. As shown above, the intersection of dotted lines is the focus of goods. For any cargo (i, j), the focus of the goods is ((i-1/2)l,(j-1/2)h).Each position’s height ish, and the width is l; the goods’ weight is Gkij, excluding the width of column between positions. The focus of the whole warehouse is as follow:
(1)Sx=∑i=1P∑k=1N∑j=1Q(Gkij*(i-1/2)l)∑i=1P∑k=1N∑j=1QGkij,Gkij⩽Gmax,Sy=∑i=1P∑k=1N∑j=1Q(Gkij*(j-1/2)h)∑i=1P∑k=1N∑j=1QGkij,Gkij⩽Gmax,
where Gmax—each shelf can bear maximum weight of cargo (kg);  Gkij—weight of goods on the cargo (kg);  Sx, Sy—the focus of the whole shelf on x and y direction position (m).In order to meet the demand for the stability of shelf, the objective function is to make the focus the smallest one. We only consider they-axis direction in the center of the shelf.Consider(2)Symin=min(Sy)=min(∑i=1P∑k=1N∑j=1Q(Gkij*(j-1/2)h)∑i=1P∑k=1N∑j=1QGkij).
It needs to meet the following condition:
(3)Symin≤12∑i=1Ph.


## 2.1. Analysis Problem

The warehouse storage totally hasN rows, each row of shelves has P layers and Q Columns, see Figure 1(a). The kth row, ith layer, and jth column position is on the shelf  with Xkij, the goods’ weight is mkij which is put on the position, the turnover is Ikij. Each position’s height is h and the width is l, k∈[1,N], i∈[1,P], j∈ [1,Q]. The closest row near to the shipping area is the first row, the closest column near to the shipping area is the first column, and the closest layer near to the shipping area is the first layer. In this paper, the lower row, the lower layer, and the lower column are encoded. As a result, the smaller number is encoding for the lower position in the warehouse.Shelf Figure. (a) Shelf Figure. (b) The focus of Shelf.
(a)
(b)


## 2.2. Build Model

A single row of shelves of warehouse can be seen in Figure1(b). For each cargo, the overall focus of the goods is in the center of the cargo. As shown above, the intersection of dotted lines is the focus of goods. For any cargo (i, j), the focus of the goods is ((i-1/2)l,(j-1/2)h).Each position’s height ish, and the width is l; the goods’ weight is Gkij, excluding the width of column between positions. The focus of the whole warehouse is as follow:
(1)Sx=∑i=1P∑k=1N∑j=1Q(Gkij*(i-1/2)l)∑i=1P∑k=1N∑j=1QGkij,Gkij⩽Gmax,Sy=∑i=1P∑k=1N∑j=1Q(Gkij*(j-1/2)h)∑i=1P∑k=1N∑j=1QGkij,Gkij⩽Gmax,
where Gmax—each shelf can bear maximum weight of cargo (kg);  Gkij—weight of goods on the cargo (kg);  Sx, Sy—the focus of the whole shelf on x and y direction position (m).In order to meet the demand for the stability of shelf, the objective function is to make the focus the smallest one. We only consider they-axis direction in the center of the shelf.Consider(2)Symin=min(Sy)=min(∑i=1P∑k=1N∑j=1Q(Gkij*(j-1/2)h)∑i=1P∑k=1N∑j=1QGkij).
It needs to meet the following condition:
(3)Symin≤12∑i=1Ph.


## 3. Object Function

For improving the efficiency of automatic warehouse system, allocation strategy for database storage includes improved FIFO, (Light underweight) LUW, (Divided Roadway Store) DRS, (Goods Relation) GR, (Cargo Partition), CP and (Shortest Route) SR. This paper uses the distance of the same goods and the cost time of cargo as the two parameters of analysis.


### 3.1. Efficiency Model

The operation cycle of stacker is a main impact factor to decide efficiency of warehouse. It is the main cost time of warehouse. Stacker moves from the shipping area to the specified location; it gets goods on the shelf and comes back to the shipping area. After running these tasks, it finishes shipping goods once. This paper only discusses the stacker moves from the shipping area to the specified location as it costs time. The speed of stacker on thex-axis and y-axis direction can be seen in Figure 2. Vmax is stacker’s max speed.Figure 2
Relation between speed and time.For a given distanceSx on the x-axis direction, the running time on the horizon is as follows:
(4)tx={2sxaxSx≤Sxmax,2vxmaxax+(sx-vxmax2/ax)vxmax,Sx≥Sxmax,Sxmax=vxmax22ax.The same for a given distanceSy, the cost time is as follows:
(5)ty={2syaySy≤Symax,2vymaxay+(sy-vymax2/ay)vymax,Sy≥Symax,Symax=vymax22ay.
The total cost time is tkij=max(tx,ty).The efficiency of the warehouse is calculated, including the cost time of a stacker, it also has relationship with the frequency of goods. Inventory turnover is also called inventory turnover. It is a measure of acquired inventory and evaluation of business, production, marketing, and other aspects of management to recover the status of a comprehensive index. The optimization of cargo within the warehouse can be used to measure the speed of movement of a product. It is the cost of goods sold by average inventory ratio obtained by the addition.(6)Ratio=(inventoryfrequencyinventorytime)*100A formula of efficiency is built as follows:(7)Emin=minE=min∑i=1P∑k=1N∑j=1Q(fkij*tkij)


### 3.2. Classification Model

When goods are put on the shelf, the relevance of the goods needs to be considered. According to this, an object function is built. At first, the average distance should be calculated between the same kinds of goods on one shelf. In Figure2, every black point expresses the focus of every good. It is assumed that these goods belong to the same type. We need to calculate the distance between every two goods compute the sum of these distances.Consider(8)dij=(dxi-dxj)2+(dyi-dyj)22.The sum of these distances is as follows:(9)Dsum=∑i=1T-1∑j=i+1Tdij.T—count of same kinds of goods.T
(
T
+
1
)
/
2 numbers are added. The average value is as follows:
(10)De=2DsumT(T+1)=2∑i=1T-1∑j=i+1TdijT(T=1).
The min goal distance is as follows:
(11)Dmin=minDe=min(2∑i=1T-1∑j=i+1TdijT(T=1)).
For object Function, we need to discuss the two models: efficient model and classification model. Deal with these two models into one, so we use weight distribution. Finally, the objective function is f=qEmin+(1-q)Dmin.So the assignment of the position on shelves should be considered in both efficiency and classification models. This is a combination of multiobjective optimization problem. For multiobjective optimization problem, the goal is conflicting in many cases. Generally, there is no unique global optimal solution, but there is an optimal solution set. Concentration of elements in the set of optimal solutions is not comparable. The optimal performance of a target solution is likely to mean poor performance of other objectives. Only one pursuit of one objective optimization has not much practical significance. It has great importance to seek a solution which makes the objective function of each dimension in good performance [4].


## 3.1. Efficiency Model

The operation cycle of stacker is a main impact factor to decide efficiency of warehouse. It is the main cost time of warehouse. Stacker moves from the shipping area to the specified location; it gets goods on the shelf and comes back to the shipping area. After running these tasks, it finishes shipping goods once. This paper only discusses the stacker moves from the shipping area to the specified location as it costs time. The speed of stacker on thex-axis and y-axis direction can be seen in Figure 2. Vmax is stacker’s max speed.Figure 2
Relation between speed and time.For a given distanceSx on the x-axis direction, the running time on the horizon is as follows:
(4)tx={2sxaxSx≤Sxmax,2vxmaxax+(sx-vxmax2/ax)vxmax,Sx≥Sxmax,Sxmax=vxmax22ax.The same for a given distanceSy, the cost time is as follows:
(5)ty={2syaySy≤Symax,2vymaxay+(sy-vymax2/ay)vymax,Sy≥Symax,Symax=vymax22ay.
The total cost time is tkij=max(tx,ty).The efficiency of the warehouse is calculated, including the cost time of a stacker, it also has relationship with the frequency of goods. Inventory turnover is also called inventory turnover. It is a measure of acquired inventory and evaluation of business, production, marketing, and other aspects of management to recover the status of a comprehensive index. The optimization of cargo within the warehouse can be used to measure the speed of movement of a product. It is the cost of goods sold by average inventory ratio obtained by the addition.(6)Ratio=(inventoryfrequencyinventorytime)*100A formula of efficiency is built as follows:(7)Emin=minE=min∑i=1P∑k=1N∑j=1Q(fkij*tkij)


## 3.2. Classification Model

When goods are put on the shelf, the relevance of the goods needs to be considered. According to this, an object function is built. At first, the average distance should be calculated between the same kinds of goods on one shelf. In Figure2, every black point expresses the focus of every good. It is assumed that these goods belong to the same type. We need to calculate the distance between every two goods compute the sum of these distances.Consider(8)dij=(dxi-dxj)2+(dyi-dyj)22.The sum of these distances is as follows:(9)Dsum=∑i=1T-1∑j=i+1Tdij.T—count of same kinds of goods.T
(
T
+
1
)
/
2 numbers are added. The average value is as follows:
(10)De=2DsumT(T+1)=2∑i=1T-1∑j=i+1TdijT(T=1).
The min goal distance is as follows:
(11)Dmin=minDe=min(2∑i=1T-1∑j=i+1TdijT(T=1)).
For object Function, we need to discuss the two models: efficient model and classification model. Deal with these two models into one, so we use weight distribution. Finally, the objective function is f=qEmin+(1-q)Dmin.So the assignment of the position on shelves should be considered in both efficiency and classification models. This is a combination of multiobjective optimization problem. For multiobjective optimization problem, the goal is conflicting in many cases. Generally, there is no unique global optimal solution, but there is an optimal solution set. Concentration of elements in the set of optimal solutions is not comparable. The optimal performance of a target solution is likely to mean poor performance of other objectives. Only one pursuit of one objective optimization has not much practical significance. It has great importance to seek a solution which makes the objective function of each dimension in good performance [4].


## 4. Warehouse Optimization Genetic Algorithm

Warehouse optimization genetic algorithm is complex combinatorial optimization problem of data. Genetic algorithm is based on evolutionary theory which has good adaptive performance and whose condition is not strict. It is suitable for solving complex combinatorial optimization problems.


### 4.1. Algorithm Analysis

Adaptor function value can be known as an ability which measures an individuation to survive in a set. It determines the degree to understand the pros and cons. It determines an individuation to survive or to die.Because the goal is to find the min value of the objective function and the two models above is to find max value, so we take the following measures. A suitable degree function is as follows:(12)fe={fmax-ffmax-f>00other.Because the optimization problem of cargo storage is complexity and the scale of the solution is large, it is hard to encode the position using 0 and 1. As a result, we encode positions usingN×P×Q matrix. xkij  is number of goods in the matrix. Information of goods is defined with weight, count, and time of turnover. The general matrix corresponding is in Figure 3. An example matrix in experience is in Figure 4.Figure 3
The general matrix.Figure 4
Relationship between shelf and matrix.The individuals in GA group are randomly generated when initialized. It is very important to determine the initialization group. If the difference between every two individuals is too small, it will make the group loss diverse and lead this algorithm to early convergence. As a result, it cannot lead this genetic algorithm to get the global optimization.Firstly, a certain number of individuals are generated randomly. Secondly, the best one is picked and added to the initial group. Lastly, this process is continue to iterate until the count of individuals in initial population is big enough.Consider(13)ds=∥Smi-Sni∥=∑j=1n(Smij-Snij),2de=∥Emi-Eni∥=∑j=1n(Emij-Enij).2The differences between individuals are used to determine which individual should be chosen.


### 4.2. Genetic Operators

Genetic operators decide which parents should be chosen into the next generation to continue this algorithm. The method of gamble selection is used, including three steps. Firstly, some locations are selected randomly from the first parent individual and the elements corresponding to these locations are stored. Secondly, these elements are deleted from the second parent individual. Lastly, the other elements of the second parent individual are copied to an empty string.The elements are exchanged in the first parent individual with the same order. According to crossover the two individuals, the corresponding gene mapping is determined to exchange 7 with 2 and 15 with 1. The details can be seen in Figure5. The matrix is legitimized with the corresponding gene mapping. The crossover result can be seen in Figure 6.Figure 5
Crossover.Figure 6
Crossover result.


### 4.3. Mutation

Mutation is randomly changing the value of some elements in one individual in a small probability. The goal is to increase the diversity of the group.In probability, some individual mutation with experience is used. The individuals are chosen to mutate in Figure7. Two positions are exchanged in the matrix with the probability of Pm, which is to exchange the two goods. If this mutation happens in a small range, Pm is always between 0.1–0.4.Figure 7
Mutation.Only the goods are adjusted on the shelf; they might be allocated on the position which is far away from the shipping area. The optimized result is to put goods to the empty position which is near the shipping area. The repair result can be seen in Figure8.Figure 8
Repair result.


### 4.4. Termination Condition

Some randomly individuals are selected to initial population for the crossover and mutation. What is the termination condition? As the algorithm runs until it reachs a certain extent, the structure of individual between every two individuals is very similar. It will be difficult to find a better individual if the algorithm still runs. Under this condition, we think this algorithm is convergent. In this paper, we think the population is convergent if the standard deviation of this population is little, less than certain values, which is usually small.Consider(14)D=∑i=1n(fi-f¯)2.In the formula,i is the ith individual in the population, n is  the count of the population, fi is the adaptor function value of the ith individual, and f is the average adaptor function value.In the process of calculation, if the value ofD is less than 0.001, this population is convergent. Algorithm flowchart can be seen in Figure 9.Figure 9
Algorithm flowchart.


## 4.1. Algorithm Analysis

Adaptor function value can be known as an ability which measures an individuation to survive in a set. It determines the degree to understand the pros and cons. It determines an individuation to survive or to die.Because the goal is to find the min value of the objective function and the two models above is to find max value, so we take the following measures. A suitable degree function is as follows:(12)fe={fmax-ffmax-f>00other.Because the optimization problem of cargo storage is complexity and the scale of the solution is large, it is hard to encode the position using 0 and 1. As a result, we encode positions usingN×P×Q matrix. xkij  is number of goods in the matrix. Information of goods is defined with weight, count, and time of turnover. The general matrix corresponding is in Figure 3. An example matrix in experience is in Figure 4.Figure 3
The general matrix.Figure 4
Relationship between shelf and matrix.The individuals in GA group are randomly generated when initialized. It is very important to determine the initialization group. If the difference between every two individuals is too small, it will make the group loss diverse and lead this algorithm to early convergence. As a result, it cannot lead this genetic algorithm to get the global optimization.Firstly, a certain number of individuals are generated randomly. Secondly, the best one is picked and added to the initial group. Lastly, this process is continue to iterate until the count of individuals in initial population is big enough.Consider(13)ds=∥Smi-Sni∥=∑j=1n(Smij-Snij),2de=∥Emi-Eni∥=∑j=1n(Emij-Enij).2The differences between individuals are used to determine which individual should be chosen.


## 4.2. Genetic Operators

Genetic operators decide which parents should be chosen into the next generation to continue this algorithm. The method of gamble selection is used, including three steps. Firstly, some locations are selected randomly from the first parent individual and the elements corresponding to these locations are stored. Secondly, these elements are deleted from the second parent individual. Lastly, the other elements of the second parent individual are copied to an empty string.The elements are exchanged in the first parent individual with the same order. According to crossover the two individuals, the corresponding gene mapping is determined to exchange 7 with 2 and 15 with 1. The details can be seen in Figure5. The matrix is legitimized with the corresponding gene mapping. The crossover result can be seen in Figure 6.Figure 5
Crossover.Figure 6
Crossover result.


## 4.3. Mutation

Mutation is randomly changing the value of some elements in one individual in a small probability. The goal is to increase the diversity of the group.In probability, some individual mutation with experience is used. The individuals are chosen to mutate in Figure7. Two positions are exchanged in the matrix with the probability of Pm, which is to exchange the two goods. If this mutation happens in a small range, Pm is always between 0.1–0.4.Figure 7
Mutation.Only the goods are adjusted on the shelf; they might be allocated on the position which is far away from the shipping area. The optimized result is to put goods to the empty position which is near the shipping area. The repair result can be seen in Figure8.Figure 8
Repair result.


## 4.4. Termination Condition

Some randomly individuals are selected to initial population for the crossover and mutation. What is the termination condition? As the algorithm runs until it reachs a certain extent, the structure of individual between every two individuals is very similar. It will be difficult to find a better individual if the algorithm still runs. Under this condition, we think this algorithm is convergent. In this paper, we think the population is convergent if the standard deviation of this population is little, less than certain values, which is usually small.Consider(14)D=∑i=1n(fi-f¯)2.In the formula,i is the ith individual in the population, n is  the count of the population, fi is the adaptor function value of the ith individual, and f is the average adaptor function value.In the process of calculation, if the value ofD is less than 0.001, this population is convergent. Algorithm flowchart can be seen in Figure 9.Figure 9
Algorithm flowchart.


## 5. Results on Simulation

A class of GA algorithm is setup, which is the main class of the program. In this class, Firstly, it will createHW_COUNT=125 goods then save all these information of goods into a list m_hw. Then allocate all these goods on the shelf randomly to simulate the work of cargo storage. Before optimization, cost time is 4.52996 s and distance of same good is 2.35318 m. In order to make the test more accurately, the parameters are defined in Table 1.Table 1
Some parameters in optimization.
Shelf
Skater
GA
Row: 4Layer: 6Column: 8Length: 1 mHeight: 0.8 m
Horizon speed:Vxmax = 1.2 m/sHorizon acceleration:ax = 0.4 m/s2 Vertical speed:Vy = 0.4 m/sVertical acceleration:ay = 0.25 m/s2
Populationcount: 30Gene count: 192Crossover: 0.4Mutation: 0.1The results on simulation can be seen in Table2.Table 2
Simulation data.
ind
F
(
x
)
Rate (s)
Dis (m)
Total
Foc (m)
1
0.291076
4.52996
2.35318
3.87693
2.33338
2
0.352275
4.536
2.36011
3.88323
2.29361
3
0.358204
4.62787
2.27533
3.92211
2.40088
4
0.367442
4.60357
2.30125
3.91287
2.20633
5
0.397199
4.64631
2.12435
3.88972
2.20108
6
0.409661
4.54302
2.32383
3.87726
2.1698
7
0.452732
4.39787
2.51894
3.83419
2.18738
8
0.506566
4.41311
2.41126
3.81256
2.1628
9
0.5593
4.53966
2.03329
3.78775
2.20494
10
0.585234
4.46537
2.1202
3.76182
2.09798
11
0.597896
4.4522
2.10872
3.74915
2.11846
12
0.600551
4.38193
2.26382
3.7465
2.15979
13
0.631733
4.36109
2.20852
3.71532
2.22436
14
0.647764
4.32488
2.23957
3.69929
2.14683
15
0.668034
4.37444
2.05635
3.67902
2.09141
16
0.726188
4.32223
2.31069
3.71876
2.08546
17
0.739863
4.29818
2.34995
3.71371
1.97941
18
0.749038
4.36351
2.16693
3.70454
2.05676
19
0.764096
4.25177
2.37747
3.68948
1.93628
20
0.813277
4.2236
2.27926
3.6403
1.93039
21
0.865533
4.27263
1.99067
3.58804
1.97837
22
0.86788
4.28859
1.97366
3.59411
2.07889In global, the cost time and the distance are reduced. Before optimization, the cost time of cargo storage is 4.52996 s and the distance between same kinds of goods is 2.35318 m; after optimization, the cost time of cargo storage is 4.28859 s and the distance between same kinds of goods is 1.97366 m. In the process of optimization, the focus of shelves is always under half of the height of shelves. But in this process, some point is higher than previous one, the reason is that the objective function usefmax to calculate fmax has changed in this process. As a result, the optimize solution is worse than the previous one. After optimize again, the result is getting better and better globally. The curves of the results can be seen in Figure 10.Figure 10
Result curves.


## 6. Discussion

This paper discusses the problem on how to assign a position for goods on shelf in the automated warehouse system and bring out two models: efficiency model and classification model. A genetic algorithm is used to solve and optimize the multiobjective problem. A location optimal solution should be studied and improved in the global scalability in the future.



---

*Source: 619029-2013-12-10.xml*