# Vehicle Routing Problem with Soft Time Windows Based on Improved Genetic Algorithm for Fruits and Vegetables Distribution

Authors: Peiqing Li; Jie He; Dunyong Zheng; Yongsheng Huang; Chenhao Fan
Journal: Discrete Dynamics in Nature and Society
 (2015)

---

## Abstract

Fresh fruits and vegetables, perishable by nature, are subject to additional deterioration and bruising in the distribution process due to vibration and shock caused by road irregularities. A nonlinear mathematical model was developed that considered not only the vehicle routing problem with time windows but also the effect of road irregularities on the bruising of fresh fruits and vegetables. The main objective of this work was to obtain the optimal distribution routes for fresh fruits and vegetables considering different road classes with the least amount of logistics costs. An improved genetic algorithm was used to solve the problem. A fruit delivery route among the 13 cities in Jiangsu Province was used as a real analysis case. The simulation results showed that the vehicle routing problem with time windows, considering road irregularities and different classes of toll roads, can significantly influence total delivery costs compared with traditional VRP models. The comparison between four models to predict the total cost and actual total cost in distribution showed that the improved genetic algorithm is superior to the Group-based pattern, CW pattern, and O-X type cross pattern.


---

## Body

## 1. Introduction

Food safety has received a great deal of attention lately from governments and researchers all over the world because of its significance in healthy diets, disease prevention, and public health [1, 2]. One of the most important considerations in guaranteeing food safety is the distribution of food products. It is important for commodity distribution companies to optimize the vehicle routing problem with soft time windows (VRPTW) and improve their transportation conditions not only to reduce logistics and distribution costs but to promote food safety. Hence, effective and efficient management of food product transportation and distribution is becoming increasingly important with respect to both logistics and marketing/sales for order delivery times. Perishable goods will begin to deteriorate once they are produced [3], especially fresh fruits and vegetables (FFV), due to inventory, long transit times, and frequent stops to serve customers during transportation and distribution. In addition, FFVs usually have a short shelf life and are easily subjected to vibration and shock during transportation. Therefore, it is important for distributors to make timely deliveries of perishable foods and to avoid excessive vibration and shock in transit, which significantly affects not only the delivery operator’s costs and the revenues of retailers, but also the quality and safety of the perishable foods.At present, China’s vegetable production accounts for about 60% of global production and fruit production accounts for about 30%; however, the rates of deterioration during transportation are as high as 20–30% for vegetables and 30% for fruits. Thus, the annual loss of FFV is as high as $40 billion in China [4]. In addition, the vast majority of highways are toll roads in China, with toll levels set according to road class, such as freeway, state highway, or provincial highway. Highways with higher class collect more tolls and therefore have higher quality road surfaces, resulting in a lower rate of produce deterioration caused by vibration and shock. The opposite holds true for lower-grade highways; lower tolls mean lower-quality road surfaces, which lead to more vibration and shock and a higher rate of produce deterioration. These facts necessitate the arrangement and selection of integrated and well-designed logistics distribution routes so the supplier can ensure the provision of the freshest foods and satisfy customers’ requirements in a cost-effective way. However, no work has been done to investigate the coordination of delivery routing and road class for the case of FFV distribution. Thus, this paper particularly focuses on the effect of delivery routing and road class on FFV deterioration and the quantification of costs during transportation.A brief literature review is presented in Section2. In Section 3, the delivery scheduling and vehicle routing problem with time windows and evaluation coefficient of road surface evenness for perishable FFV is formulated as an integer nonlinear programming model. In Section 4, an improved genetic algorithm is proposed. Numerical results are presented in Section 5 through analyzing the total costs obtained from the proposed model and comparing it with three other traditional methods. Section 6 contains concluding remarks.


## 2. Literature Review

Most of the literature regarding VRPTW is in the fields of production scheduling, inventory control, and distribution of goods and mainly focuses on industrial products. Papers that comprehensively discuss distribution routes of FFV and the rate of deterioration and bruising due to vibration and shock are relatively rare. The following discussion reviews VRPTW in detail.VRPTW is an extension of the vehicle routing problem (VRP) and includes the vehicle routing problem with hard time windows (VRPHTW) and the vehicle routing problem with soft time windows (VRPSTW). In VRPHTW, delivering goods outside the time window is not allowed at all, while in VRPSTW, the lower and upper bounds of the time window can be violated at a penalty. Comprehensive reviews of these problems were completed by Ahumada and Villalobos [1], Cordeau et al. [5], and El-Sherbeny [6]. As proposed by Calvete et al. [7], all these combinatorial optimization problems have been proven to be NP-hard, and only relatively small problems can be solved to optimality due to their huge computational requirements. For larger problems, scholars usually focus on heuristic and metaheuristic methods, such as genetic algorithms, tabu search, and simulated annealing to derive approximate solutions of acceptable quality in reasonable computational time [8–11]. Figliozzi [12] proposed an iterative route construction and improvement algorithm to solve vehicle routing problems with soft time windows. Taş et al. [13] studied a vehicle routing problem with time-dependent and stochastic travel times.As previously mentioned, these mathematical models are mostly applied to products that are not perishable. Hsu et al. [14] considered the randomness of the perishable food delivery process and constructed a stochastic VRPTW model to minimize the fixed costs for dispatching vehicles; the costs for transportation, inventory, and energy; and the penalty costs for violating time windows. Osvald and Stirn [15] presented a model in which the impact of the perishability as part of the overall distribution cost was considered and used a heuristic approach based on the tabu search to solve the problem for the distribution of fresh vegetables. Chen et al. [3] proposed a nonlinear mathematical model that considered production scheduling and vehicle routing with time windows for perishable food products with the goal of maximizing the supplier’s expected total profit. Ahumada and Villalobos [1] reviewed the main contributions in the field of production and distribution planning for agrifoods based on agricultural crops. Amorim and Almada-Lobo [16] proposed a novel multiobjective model that decouples the minimization of the distribution costs from the maximization of the freshness state of the delivered perishable food products to examine the relationship between distribution scenarios and the cost-freshness trade-off.Some literature focuses on different distribution problems related to perishable food products but does not explicitly consider the vibration and shock during transportation due to road irregularities. Compared with other industrial goods, the significant characteristics of FFV include short shelf life and fast rate of perishability. These characteristics cause great difficulties in delivery logistics. Meanwhile, FFVs are prone to easy bruising, influenced by outside vibration and shock during transportation. Thus, FFVs often quickly suffer from damage. A model based on an improved genetic algorithm was developed to solve these issues.


## 3. Model Formulation

In this section, we propose a mathematical model of VRPSTW with a road class evaluation coefficient and different classes of toll roads, in which a supplier has to decide how many products to deliver to retailers, when to deliver them, and the kind of road class. The objective of the supplier is to maximize the expected total profit. Assume that the distribution center hasm identical delivery vehicles, it is distributing goods to n geographically dispersed customers, and the capacity and travel distance for a vehicle are L and Q, respectively. The mathematical models based on the total lowest cost for optimizing target C are formulated as follows:(1)min⁡C=a0m+∑i=0n∑j=0n∑k=1ma1δijdijxijk+∑j=1na2Tj·max⁡TEj-Tj,0+max⁡Tj-TLj,0with xijk={1,vehiclektravel  fromitoj;0,otherwise}, where a0 is fixed cost per vehicle, a1 is running unit cost per vehicle, and a2Tj is unit penalty cost if beyond the time windows:(2)a2tj=αtj<TEj0TEj≤tj≤TLjβtj>TLj,where qi is demand of customer i, δij is evaluation coefficient of road surface evenness between customer i and customer j, as shown in Table 1 [17, 18], dij is distance between customer i and customer j, TEj,TLj is time windows of receiving of customer j, and Tj is travel time between customer i and customer j:(3)Tj=dijvij.Table 1
Road class and evaluation coefficient.
Surface class
Road class
Surface materials
δ
i
j
High type
Expressway,first-class highway
(1) Asphalt concrete(2) Cement concrete
1.02
Subhigh type
Second-class highway,third-class highway
(1) Bituminous penetration(2) Asphalt macadam (3) Bituminous surface treatment
1.12
Intermediate type
Fourth-class highway
(1) Graded aggregate(2) Half tidy stones(3) Other aggregates
1.23
Low type
Fourth-class highway
(1) Aggregate strengthen soil(2) Others
1.41In (1), the first item is total fixed cost for all m vehicles, the second item is total running cost, and the third is penalty cost. Constraint conditions are stated as follows:(4)∑i=1n∑k=1mx0ik=∑j=1n∑k=1mxj0k,(5)∑i=1nyikqi≤Qk=0,1,2,…,m,(6)∑k=1myik=1i=0,1,2,…,n,(7)∑j=1n∑k=1mxijkdij≤Li=0,1,2,…,n,(8)TEi≤ti≤TLi,(9)yik=1vehicleksevers  for  customeri0otherwise.Constraint (4) makes sure all vehicles leave the distribution center and return after the work is completed. Constraint (5) limits each vehicle from being overweight. Constraint (6) guarantees each customer will be served by each vehicle. Constraint (7) ensures that the distance traveled per vehicle cannot be greater than the maximum allowed travel distance. Constraint (8) is a time window that makes sure vehicles arrive at proper times. Constraint (9) ensures that the customer i can be delivered by the vehicle k within the time window.


## 4. Improved Genetic Algorithm

This section describes how to solve the VRPSTW for fruits and vegetables distribution problems by using the proposed improved genetic algorithm (IGA) approach. The steps are detailed in the following sections.


### 4.1. Genetic Algorithm

Genetic algorithms (GA) were first developed by Professor Holland [19]. Genetic algorithms are adaptive heuristic search algorithms that are based on the mechanics of natural selection and genetics [20, 21]. Compared with traditional algorithms, GA has a wider coverage and is better for choosing the optimal solution. The parallelism of GA enables it to process several objects at the same time. It also reduces the risk of a local optimal solution. In terms of VRP, GA has been widely applied, and it has been demonstrated to be a promising search capability and optimization technique.


### 4.2. Improved Genetic Algorithm

#### 4.2.1. Chromosome Structure Coding

Assume that there arem vehicles serving k customers. The length of the chromosome is k+m+1, and the chromosome structure coding is (0,i1,i2,…,ik,0,i1,…,im,0), where “0” denotes distribution center. Its significance is explained as follows. The first vehicle leaves the distribution center, travels to several customers, and finally arrives back at the distribution center. The second vehicle leaves and comes back after serving customers (i1,…,im). Following this pattern, all of the K routes are generated when the kth vehicle leaves and comes back at the same time. The order of service can be shown by this structure.For example, in Figure1(a), a number 0 indicates the distribution center (Depot), and the number written on each line corresponds to the distance between depot and customers and between customers. The numbers 1, 2, 3, 4, 5, 6, and 7 correspond to customers. Moreover, the portion of the visited route is called a subroute: for example, route (0, 1, 2, 0) in Figure 1(b) is a subroute of all the feasible routes. Besides, the numbers in brackets correspond to the quantities required by each customer.Figure 1
The example VRP.
(a)
Delivery pattern
(b)
Subroutes in the solutionConsider that we have the following solution:route number 1 is 0 → 1 → 2 → 0,route number 2 is 0 → 3 → 4 → 5 → 0,route number 3 is 0 → 6 → 7 → 0.The chromosome string of Figure1(b) represents the solution as shown in Figure 2.Figure 2
A chromosome representation.


#### 4.2.2. Generation of Initial Population

We utilize the sweep algorithm [22] to divide the customers into m different groups and ensure each group meets all of the constraint conditions. We then add “0” into each group’s head and tail, which forms a chromosome encoding. For instance, if we divide nine customers into three groups (i.e., [1–9]), the chromosome is 0261089705340.


#### 4.2.3. Fitness Function

Considering the possibility of an infeasible solution, we introduce a penalty strategy to define fitness functionZ:(10)Z=C+M1∑k=1mmax⁡∑i=1i=k∑j=1j=kxijkqi-Q,0+M2∑k=1mmax⁡∑i=1i=k∑j=1j=kxijkdi-L,0=a0m+∑i=0n∑j=0n∑k=1ma1δijdijxijk+∑j=1na2Tj·max⁡TEj-Tj,0+max⁡Tj-TLj,0+M1∑k=1mmax⁡∑i=1i=k∑j=1j=kxijkqi-Q,0+M2∑k=1mmax⁡∑i=1i=k∑j=1j=kxijkdi-L,0,where C is the optimizing target of the proposed mathematical model as shown in (1); M1 is a penalty factor for being overweight; M2 is the penalty factor for being over the maximum travel distance; and the other symbols are the same as shown in (1).


#### 4.2.4. Termination Condition

The termination condition of the optimization algorithm is the biggest genetic algebraic system setting. First, we set a maximum algebraN, and if the current algebra N′ is larger than the maximum algebra N, the algorithm ends. Then the evolution is stopped, and the chromosome that performs best corresponding to the path setout as a question of optimal solution is selected.


#### 4.2.5. Natural Selection

The natural selection method used in this paper is a combination of elitist selection and fitness proportion selection [23]. We first choose the most optimal of all n chromosomes to pass on directly; then we use roulette wheel selection to produce the next generation from the remaining n-1 chromosomes.


#### 4.2.6. Crossover and Recombination

Lang and Hu and Ding and Li [24, 25] proposed a new crossover operator whose main characteristic is crossing according to the order of the group. Based on this theory, an improved multiple population crossover method is developed in this paper. First, we randomly choose the parent chromosomes A and B to cross. From that, we can get a core gene sequence, which guarantees that genes can be passed to the next generation with fixed relative location that will help avoid over-distance. Finally, we can get the new chromosome A′ by using greedy heuristics [26] to insert the remaining genes into locations that are close to the nearest gene in order. As for the new chromosome B′, we insert remaining genes similar to the generation of A′ but with a reverse order.For example, two paternal chromosomes areO1={(0,1,3,7,8),(0,2,6,4,5)}; O2={(0,1,2,3,6),(0,4,5,7,8)}. Clearly, the common part of the two chromosomes is O={(0,1,3),(0,4,5)}, and the pending elements are 2, 6, 7, and 8. First, we insert these four pending elements with an order of 2 → 6 → 7 → 8 into O to obtain the new A′. We suppose that 1 is the closet element for 2 in the first part of chromosome O, and the distance is five units. In the second part of chromosome O, 4 is the nearest element with a distance of eight units. Then we put 2 into the first part just following element 1. After that, we will check to ensure that this arrangement can conform to all constraint conditions, and other elements will be inserted with the same method. It is noted, however, that if the addition of any element cannot meet all constraint conditions, we should arrange it into the other part of the chromosome. As for B′, it is inserted following the order of 8 → 7 → 6 → 2.Although this method ensures that the relative location for the core part of the chromosome remains the same and that the population is diverse, it will destroy the former chromosomes. The O-X type cross pattern is able to reserve the mating zone entirely [27]; thus, we combine this method with the traditional O-X type cross pattern. In the process of crossover and recombination, we can divide chromosomes into two groups. One group adopts the method proposed in this paper and the other utilizes the O-X type cross pattern. After several generations, we exchange the method used in the two groups.


#### 4.2.7. Mutation

The mutation method used in this paper is a combination of inversion mutation and exchange mutation [28]. The two methods are used generationally and alternated during the evolution. Inversion mutation is a process to reverse a chromosome. For example, 0630189025740 will vary to 0630981025740 by reversing “189.” Crossover is the exchange of positions of two elements. For example, 0630189025740 becomes 0230189065740 by exchanging “6” and “2.”


### 4.3. The Basic Procedure of Improved Genetic Algorithm

The flowchart of improved genetic algorithm is as shown in Figure3.Figure 3
Flowchart of genetic algorithm.


## 4.1. Genetic Algorithm

Genetic algorithms (GA) were first developed by Professor Holland [19]. Genetic algorithms are adaptive heuristic search algorithms that are based on the mechanics of natural selection and genetics [20, 21]. Compared with traditional algorithms, GA has a wider coverage and is better for choosing the optimal solution. The parallelism of GA enables it to process several objects at the same time. It also reduces the risk of a local optimal solution. In terms of VRP, GA has been widely applied, and it has been demonstrated to be a promising search capability and optimization technique.


## 4.2. Improved Genetic Algorithm

### 4.2.1. Chromosome Structure Coding

Assume that there arem vehicles serving k customers. The length of the chromosome is k+m+1, and the chromosome structure coding is (0,i1,i2,…,ik,0,i1,…,im,0), where “0” denotes distribution center. Its significance is explained as follows. The first vehicle leaves the distribution center, travels to several customers, and finally arrives back at the distribution center. The second vehicle leaves and comes back after serving customers (i1,…,im). Following this pattern, all of the K routes are generated when the kth vehicle leaves and comes back at the same time. The order of service can be shown by this structure.For example, in Figure1(a), a number 0 indicates the distribution center (Depot), and the number written on each line corresponds to the distance between depot and customers and between customers. The numbers 1, 2, 3, 4, 5, 6, and 7 correspond to customers. Moreover, the portion of the visited route is called a subroute: for example, route (0, 1, 2, 0) in Figure 1(b) is a subroute of all the feasible routes. Besides, the numbers in brackets correspond to the quantities required by each customer.Figure 1
The example VRP.
(a)
Delivery pattern
(b)
Subroutes in the solutionConsider that we have the following solution:route number 1 is 0 → 1 → 2 → 0,route number 2 is 0 → 3 → 4 → 5 → 0,route number 3 is 0 → 6 → 7 → 0.The chromosome string of Figure1(b) represents the solution as shown in Figure 2.Figure 2
A chromosome representation.


### 4.2.2. Generation of Initial Population

We utilize the sweep algorithm [22] to divide the customers into m different groups and ensure each group meets all of the constraint conditions. We then add “0” into each group’s head and tail, which forms a chromosome encoding. For instance, if we divide nine customers into three groups (i.e., [1–9]), the chromosome is 0261089705340.


### 4.2.3. Fitness Function

Considering the possibility of an infeasible solution, we introduce a penalty strategy to define fitness functionZ:(10)Z=C+M1∑k=1mmax⁡∑i=1i=k∑j=1j=kxijkqi-Q,0+M2∑k=1mmax⁡∑i=1i=k∑j=1j=kxijkdi-L,0=a0m+∑i=0n∑j=0n∑k=1ma1δijdijxijk+∑j=1na2Tj·max⁡TEj-Tj,0+max⁡Tj-TLj,0+M1∑k=1mmax⁡∑i=1i=k∑j=1j=kxijkqi-Q,0+M2∑k=1mmax⁡∑i=1i=k∑j=1j=kxijkdi-L,0,where C is the optimizing target of the proposed mathematical model as shown in (1); M1 is a penalty factor for being overweight; M2 is the penalty factor for being over the maximum travel distance; and the other symbols are the same as shown in (1).


### 4.2.4. Termination Condition

The termination condition of the optimization algorithm is the biggest genetic algebraic system setting. First, we set a maximum algebraN, and if the current algebra N′ is larger than the maximum algebra N, the algorithm ends. Then the evolution is stopped, and the chromosome that performs best corresponding to the path setout as a question of optimal solution is selected.


### 4.2.5. Natural Selection

The natural selection method used in this paper is a combination of elitist selection and fitness proportion selection [23]. We first choose the most optimal of all n chromosomes to pass on directly; then we use roulette wheel selection to produce the next generation from the remaining n-1 chromosomes.


### 4.2.6. Crossover and Recombination

Lang and Hu and Ding and Li [24, 25] proposed a new crossover operator whose main characteristic is crossing according to the order of the group. Based on this theory, an improved multiple population crossover method is developed in this paper. First, we randomly choose the parent chromosomes A and B to cross. From that, we can get a core gene sequence, which guarantees that genes can be passed to the next generation with fixed relative location that will help avoid over-distance. Finally, we can get the new chromosome A′ by using greedy heuristics [26] to insert the remaining genes into locations that are close to the nearest gene in order. As for the new chromosome B′, we insert remaining genes similar to the generation of A′ but with a reverse order.For example, two paternal chromosomes areO1={(0,1,3,7,8),(0,2,6,4,5)}; O2={(0,1,2,3,6),(0,4,5,7,8)}. Clearly, the common part of the two chromosomes is O={(0,1,3),(0,4,5)}, and the pending elements are 2, 6, 7, and 8. First, we insert these four pending elements with an order of 2 → 6 → 7 → 8 into O to obtain the new A′. We suppose that 1 is the closet element for 2 in the first part of chromosome O, and the distance is five units. In the second part of chromosome O, 4 is the nearest element with a distance of eight units. Then we put 2 into the first part just following element 1. After that, we will check to ensure that this arrangement can conform to all constraint conditions, and other elements will be inserted with the same method. It is noted, however, that if the addition of any element cannot meet all constraint conditions, we should arrange it into the other part of the chromosome. As for B′, it is inserted following the order of 8 → 7 → 6 → 2.Although this method ensures that the relative location for the core part of the chromosome remains the same and that the population is diverse, it will destroy the former chromosomes. The O-X type cross pattern is able to reserve the mating zone entirely [27]; thus, we combine this method with the traditional O-X type cross pattern. In the process of crossover and recombination, we can divide chromosomes into two groups. One group adopts the method proposed in this paper and the other utilizes the O-X type cross pattern. After several generations, we exchange the method used in the two groups.


### 4.2.7. Mutation

The mutation method used in this paper is a combination of inversion mutation and exchange mutation [28]. The two methods are used generationally and alternated during the evolution. Inversion mutation is a process to reverse a chromosome. For example, 0630189025740 will vary to 0630981025740 by reversing “189.” Crossover is the exchange of positions of two elements. For example, 0630189025740 becomes 0230189065740 by exchanging “6” and “2.”


## 4.2.1. Chromosome Structure Coding

Assume that there arem vehicles serving k customers. The length of the chromosome is k+m+1, and the chromosome structure coding is (0,i1,i2,…,ik,0,i1,…,im,0), where “0” denotes distribution center. Its significance is explained as follows. The first vehicle leaves the distribution center, travels to several customers, and finally arrives back at the distribution center. The second vehicle leaves and comes back after serving customers (i1,…,im). Following this pattern, all of the K routes are generated when the kth vehicle leaves and comes back at the same time. The order of service can be shown by this structure.For example, in Figure1(a), a number 0 indicates the distribution center (Depot), and the number written on each line corresponds to the distance between depot and customers and between customers. The numbers 1, 2, 3, 4, 5, 6, and 7 correspond to customers. Moreover, the portion of the visited route is called a subroute: for example, route (0, 1, 2, 0) in Figure 1(b) is a subroute of all the feasible routes. Besides, the numbers in brackets correspond to the quantities required by each customer.Figure 1
The example VRP.
(a)
Delivery pattern
(b)
Subroutes in the solutionConsider that we have the following solution:route number 1 is 0 → 1 → 2 → 0,route number 2 is 0 → 3 → 4 → 5 → 0,route number 3 is 0 → 6 → 7 → 0.The chromosome string of Figure1(b) represents the solution as shown in Figure 2.Figure 2
A chromosome representation.


## 4.2.2. Generation of Initial Population

We utilize the sweep algorithm [22] to divide the customers into m different groups and ensure each group meets all of the constraint conditions. We then add “0” into each group’s head and tail, which forms a chromosome encoding. For instance, if we divide nine customers into three groups (i.e., [1–9]), the chromosome is 0261089705340.


## 4.2.3. Fitness Function

Considering the possibility of an infeasible solution, we introduce a penalty strategy to define fitness functionZ:(10)Z=C+M1∑k=1mmax⁡∑i=1i=k∑j=1j=kxijkqi-Q,0+M2∑k=1mmax⁡∑i=1i=k∑j=1j=kxijkdi-L,0=a0m+∑i=0n∑j=0n∑k=1ma1δijdijxijk+∑j=1na2Tj·max⁡TEj-Tj,0+max⁡Tj-TLj,0+M1∑k=1mmax⁡∑i=1i=k∑j=1j=kxijkqi-Q,0+M2∑k=1mmax⁡∑i=1i=k∑j=1j=kxijkdi-L,0,where C is the optimizing target of the proposed mathematical model as shown in (1); M1 is a penalty factor for being overweight; M2 is the penalty factor for being over the maximum travel distance; and the other symbols are the same as shown in (1).


## 4.2.4. Termination Condition

The termination condition of the optimization algorithm is the biggest genetic algebraic system setting. First, we set a maximum algebraN, and if the current algebra N′ is larger than the maximum algebra N, the algorithm ends. Then the evolution is stopped, and the chromosome that performs best corresponding to the path setout as a question of optimal solution is selected.


## 4.2.5. Natural Selection

The natural selection method used in this paper is a combination of elitist selection and fitness proportion selection [23]. We first choose the most optimal of all n chromosomes to pass on directly; then we use roulette wheel selection to produce the next generation from the remaining n-1 chromosomes.


## 4.2.6. Crossover and Recombination

Lang and Hu and Ding and Li [24, 25] proposed a new crossover operator whose main characteristic is crossing according to the order of the group. Based on this theory, an improved multiple population crossover method is developed in this paper. First, we randomly choose the parent chromosomes A and B to cross. From that, we can get a core gene sequence, which guarantees that genes can be passed to the next generation with fixed relative location that will help avoid over-distance. Finally, we can get the new chromosome A′ by using greedy heuristics [26] to insert the remaining genes into locations that are close to the nearest gene in order. As for the new chromosome B′, we insert remaining genes similar to the generation of A′ but with a reverse order.For example, two paternal chromosomes areO1={(0,1,3,7,8),(0,2,6,4,5)}; O2={(0,1,2,3,6),(0,4,5,7,8)}. Clearly, the common part of the two chromosomes is O={(0,1,3),(0,4,5)}, and the pending elements are 2, 6, 7, and 8. First, we insert these four pending elements with an order of 2 → 6 → 7 → 8 into O to obtain the new A′. We suppose that 1 is the closet element for 2 in the first part of chromosome O, and the distance is five units. In the second part of chromosome O, 4 is the nearest element with a distance of eight units. Then we put 2 into the first part just following element 1. After that, we will check to ensure that this arrangement can conform to all constraint conditions, and other elements will be inserted with the same method. It is noted, however, that if the addition of any element cannot meet all constraint conditions, we should arrange it into the other part of the chromosome. As for B′, it is inserted following the order of 8 → 7 → 6 → 2.Although this method ensures that the relative location for the core part of the chromosome remains the same and that the population is diverse, it will destroy the former chromosomes. The O-X type cross pattern is able to reserve the mating zone entirely [27]; thus, we combine this method with the traditional O-X type cross pattern. In the process of crossover and recombination, we can divide chromosomes into two groups. One group adopts the method proposed in this paper and the other utilizes the O-X type cross pattern. After several generations, we exchange the method used in the two groups.


## 4.2.7. Mutation

The mutation method used in this paper is a combination of inversion mutation and exchange mutation [28]. The two methods are used generationally and alternated during the evolution. Inversion mutation is a process to reverse a chromosome. For example, 0630189025740 will vary to 0630981025740 by reversing “189.” Crossover is the exchange of positions of two elements. For example, 0630189025740 becomes 0230189065740 by exchanging “6” and “2.”


## 4.3. The Basic Procedure of Improved Genetic Algorithm

The flowchart of improved genetic algorithm is as shown in Figure3.Figure 3
Flowchart of genetic algorithm.


## 5. Example

We conducted computational experiments to evaluate the proposed algorithm. The algorithm was coded in MATLAB and run on a PC (Intel Pentium 4, 2.8 GHz, 2 GB memory).There is a batch of bananas from southern China that will be distributed to 12 cities through the Nanjing distribution center in Jiangsu Province (Nanjing is the capital of Jiangsu Province), and their locations are distributed in the square0,1002 in the plane, as shown in Figure 4. The distances between customers are measured by Euclidean distance (in double precision) as shown in Table 2. The road class between different cities is shown in Table 3, and the traveling times are the same as the corresponding distances. Each customer i has one time window TEi,TLi, the amount required qi, and a service time ti, as shown in Table 4. The number of vehicles is 5, and all vehicles have an identical capacity Q (Q=15 tons). Both time window and capacity constraints are considered hard indicators. The maximum travel distance L of each vehicle is 500 km. Penalty factors of time are α and β, in which α=2000 and β=3000. The penalty factor for being overweight is M1=5000. The over-distance penalty factor is M2=2000.Table 2
Distance between different cities.
D
0
1
2
3
4
5
6
7
8
9
10
11
12
0
0
/
/
132
87
/
94
/
/
195
254
/
/
1
/
0
53
/
/
110
/
/
/
/
/
/
/
2
/
53
0
54
/
150
/
/
/
/
/
/
/
3
132
/
54
0
77
/
/
/
/
/
/
/
4
87
/
/
77
0
224
39
/
/
/
/
/
5
/
110
150
/
224
0
165
140
196
/
/
/
/
6
94
/
/
/
39
165
0
75
/
177
/
/
/
7
/
/
/
/
/
140
75
0
122
198
/
/
/
8
/
/
/
/
/
196
/
122
0
133
/
199
/
9
195
/
/
/
/
/
177
198
133
0
96
132
/
10
254
/
/
/
/
/
/
96
0
145
110
11
/
/
/
/
/
/
/
199
132
145
0
202
12
/
/
/
/
/
/
/
/
/
/
110
202
0Table 3
Road class between different cities.
L
0
1
2
3
4
5
6
7
8
9
10
11
12
0
/
/
/
2
1
/
2
/
/
1
2
/
/
1
/
/
1
/
/
1
/
/
/
/
/
/
/
2
/
2
/
1
/
2
/
/
/
/
/
/
/
3
1
/
2
/
4
/
/
/
/
/
/
/
4
1
/
/
2
/
3
1
/
/
/
/
/
5
/
1
3
/
1
/
1
2
3
/
/
/
/
6
2
/
/
/
2
1
/
1
/
3
/
/
/
7
/
/
/
/
/
2
1
/
2
1
/
/
/
8
/
/
/
/
/
4
/
1
/
2
/
1
/
9
1
/
/
/
/
/
2
1
3
/
1
1
/
10
2
/
/
/
/
/
/
1
/
4
1
11
/
/
/
/
/
/
/
1
2
4
/
1
12
/
/
/
/
/
/
/
/
/
/
1
2
/Table 4
Demand for cities and time window request.
Cities(customers)
1
2
3
4
5
6
7
8
9
10
11
12
q
i
/t
3
4
2
3
2
4
5
3
4
2
4
5
T
E
i/h
3
2.5
2.5
2
3
1.5
2
3
4
5
4.5
5
T
L
i/h
4.5
3
3.5
3
4.5
2.5
2.5
4.5
4.5
6.5
6
7Figure 4
Geographical distribution for distributed cities and distribution center in Jiangsu Province.In the simulation process, we used MATLAB to realize the proposed algorithm, in which the variable dimension is 40, the crossover rate is 0.9, the maximum generation is 200, and the mutation rate is 0.1. Meanwhile, a comparison between the total costs obtained from the proposed algorithm and the total costs from the traditional O-X type cross pattern, the Group-based pattern, and the CW pattern was carried out. The corresponding results are shown in Figures5, 6, and 7.Figure 5
Population mean change contrasts of O-X type cross pattern.Figure 6
Population mean change contrasts of Group-based pattern.Figure 7
Population mean change contrasts of CW pattern.Figures5, 6, and 7 show that the proposed algorithm achieves convergence within 20 generations, but the other three methods need more generations to achieve convergence. In addition, compared to the other three methods, less computing time is required for achieving convergence in the proposed algorithm. Therefore, the proposed algorithm demonstrated higher efficiency in obtaining the optimum solution.In order to further illustrate the performance of the proposed algorithm, the maximum generation was considered to be 200. As a result, we learned that once the proposed method achieves convergence, it will not change much with increasing generations. In contrast, the other three methods were relatively unstable after convergence. This phenomenon further shows that the performance of the proposed algorithm is superior to the conventional methods.Finally, according to repeated experiments in MATLAB, we get the final optimal scheme, which is 0 → 9 → 11 → 12 → 0 → 3 → 7 → 6 → 0 → 4 → 5 → 8 → 0 → 10 → 2 → 1 → 0, and the total cost is 45,412.To further demonstrate the performance of the proposed algorithm, a comparison is made between actual total cost from randomly distribution during twelve months and total cost from the above four algorithms. The comparison is shown in Table5, which lists the root mean square error (RMSE) and absolute error (Eabs) of the total cost for distribution. Among them, the RMSE and Eabs can be calculated by the following formulae:(11)RMSE=1N∑i=1nypred-ytrue2,Eabs=1N∑i=1Nytrue-ypred,where N is the total number of distribution for each month, which is not the same in different months due to seasons and demands, ypred is calculated by four algorithms, and ytrue is total cost obtained from the actual distribution for each month.Table 5
Prediction errors of total cost between actual distribution values and predicted values derived from four models during five months.
Twelve months(times)
Model types
Improved genetic algorithm
O-X type cross pattern
Group-based pattern
CW pattern
RMSE
E
abs
RMSE
E
abs
RMSE
E
abs
RMSE
E
abs
January (25)
0.4838
0.4188
1.7398
1.6216
1.3422
1.2986
1.3652
1.3056
February (26)
0.4759
0.3963
1.7136
1.6163
1.3233
1.2832
1.3469
1.3125
March (15)
0.6563
0.5728
2.0126
1.9023
1.6503
1.3389
1.7027
1.6391
April (13)
0.7229
0.6985
2.2359
2.1362
1.7222
1.6261
1.6918
1.7632
May (11)
0.7935
0.7065
2.4129
2.3061
1.9213
1.8163
2.1356
2.0522
June (12)
0.7368
0.6986
2.3236
2.2346
1.8422
1.7934
1.9589
1.8482
July (10)
0.8159
0.7312
2.6356
2.4995
2.0231
1.9124
2.2677
2.1343
August (12)
0.7263
0.6802
2.2689
2.1693
1.7546
1.5376
1.7703
1.6653
September (17)
0.5421
0.5063
2.0875
1.9574
1.5263
1.4513
1.6896
1.5122
October (21)
0.5116
0.4323
1.8985
1.7023
1.6227
1.5552
1.7263
1.6373
November (22)
0.5032
0.4213
1.8635
1.6986
1.5221
1.4496
1.5894
1.4924
December (23)
0.4978
0.4123
1.7974
1.6629
1.4819
1.3928
1.5431
1.4623Table5 shows that the performance of the improved genetic algorithm is better than the other three algorithms for the distribution of twelve months, and both the models Group-based pattern and CW pattern are superior to the O-X type cross pattern. It is observed that the more monthly distribution times, the more accurate predicted total cost.


## 6. Conclusions

The VRPSTW problem for FFV is a large combinatorial problem whose optimal solution is difficult to find. Therefore, a nonlinear mathematical model based on an improved genetic algorithm was developed to solve this problem. In this paper, we considered not only the vehicle routing problem with time windows, but also the effect of road irregularities on fruit and vegetable bruising to reduce logistics and distribution costs. In addition, the feasibility, high efficiency, and rationality of the proposed algorithm were verified by numerical simulations. The comparison between four models to predict the total cost and actual total cost in distribution showed that the improved genetic algorithm is superior to the Group-based pattern, CW pattern, and O-X type cross pattern.



---

*Source: 483830-2015-08-13.xml*