Research Article  Open Access
Vehicle Routing Problem with Soft Time Windows Based on Improved Genetic Algorithm for Fruits and Vegetables Distribution
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 Groupbased pattern, CW pattern, and OX type cross pattern.
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 lowergrade highways; lower tolls mean lowerquality 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 welldesigned logistics distribution routes so the supplier can ensure the provision of the freshest foods and satisfy customers’ requirements in a costeffective 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 Section 2. 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 ElSherbeny [6]. As proposed by Calvete et al. [7], all these combinatorial optimization problems have been proven to be NPhard, 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 timedependent 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 AlmadaLobo [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 costfreshness tradeoff.
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 has identical delivery vehicles, it is distributing goods to geographically dispersed customers, and the capacity and travel distance for a vehicle are and , respectively. The mathematical models based on the total lowest cost for optimizing target are formulated as follows:with , where is fixed cost per vehicle, is running unit cost per vehicle, and is unit penalty cost if beyond the time windows:where is demand of customer , is evaluation coefficient of road surface evenness between customer and customer , as shown in Table 1 [17, 18], is distance between customer and customer , is time windows of receiving of customer , and is travel time between customer and customer :

In (1), the first item is total fixed cost for all vehicles, the second item is total running cost, and the third is penalty cost. Constraint conditions are stated as follows:
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 can be delivered by the vehicle 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 are vehicles serving customers. The length of the chromosome is , and the chromosome structure coding is , 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 (). Following this pattern, all of the routes are generated when the th vehicle leaves and comes back at the same time. The order of service can be shown by this structure.
For example, in Figure 1(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.
(a) Delivery pattern
(b) Subroutes in the solution
Consider 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 Figure 1(b) represents the solution as shown in Figure 2.
4.2.2. Generation of Initial Population
We utilize the sweep algorithm [22] to divide the customers into 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 function :where is the optimizing target of the proposed mathematical model as shown in (1); is a penalty factor for being overweight; 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 algebra , and if the current algebra is larger than the maximum algebra , 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 chromosomes to pass on directly; then we use roulette wheel selection to produce the next generation from the remaining 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 and 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 overdistance. Finally, we can get the new chromosome 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 , we insert remaining genes similar to the generation of but with a reverse order.
For example, two paternal chromosomes are ; . Clearly, the common part of the two chromosomes is , 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 to obtain the new . We suppose that 1 is the closet element for 2 in the first part of chromosome , and the distance is five units. In the second part of chromosome , 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 , 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 OX type cross pattern is able to reserve the mating zone entirely [27]; thus, we combine this method with the traditional OX 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 OX 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 Figure 3.
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 square 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 has one time window , the amount required , and a service time , as shown in Table 4. The number of vehicles is 5, and all vehicles have an identical capacity ( tons). Both time window and capacity constraints are considered hard indicators. The maximum travel distance of each vehicle is 500 km. Penalty factors of time are and , in which and . The penalty factor for being overweight is . The overdistance penalty factor is .



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 OX type cross pattern, the Groupbased pattern, and the CW pattern was carried out. The corresponding results are shown in Figures 5, 6, and 7.
Figures 5, 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 Table 5, which lists the root mean square error (RMSE) and absolute error of the total cost for distribution. Among them, the RMSE and can be calculated by the following formulae:where is the total number of distribution for each month, which is not the same in different months due to seasons and demands, is calculated by four algorithms, and is total cost obtained from the actual distribution for each month.

Table 5 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 Groupbased pattern and CW pattern are superior to the OX 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 Groupbased pattern, CW pattern, and OX type cross pattern.
Conflict of Interests
The authors declare that there is no conflict of interests regarding the publication of this paper.
Acknowledgments
The authors would like to thank Education Department of Jiangsu Province (sponsored by Qing Lan Project) and Ministry of Education of China (sponsored by Research Fund for the Doctoral Program of Higher Education of China, Project no. 20120092110044, and by the Fundamental Research Funds for the Central Universities of China, Project no. CXLX12_0111). Their assistance is gratefully acknowledged.
References
 O. Ahumada and J. R. Villalobos, “Application of planning models in the agrifood supply chain: a review,” European Journal of Operational Research, vol. 196, no. 1, pp. 1–20, 2009. View at: Publisher Site  Google Scholar
 D. I. LeBlanc, S. Villeneuve, L. Hashemi Beni et al., “A national produce supply chain database for food safety risk analysis,” Journal of Food Engineering, vol. 147, pp. 24–38, 2015. View at: Publisher Site  Google Scholar
 H.K. Chen, C.F. Hsueh, and M.S. Chang, “Production scheduling and vehicle routing with time windows for perishable food products,” Computers & Operations Research, vol. 36, no. 7, pp. 2311–2319, 2009. View at: Publisher Site  Google Scholar
 National Development and Reform Commission of China, Agricultural Cold Chain Logistics Development Plan, National Development and Reform Commission of China, 2010.
 J.F. Cordeau, M. Gendreau, G. Laporte, J.Y. Potvin, and F. Semet, “A guide to vehicle routing heuristics,” Journal of the Operational Research Society, vol. 53, no. 5, pp. 512–522, 2002. View at: Publisher Site  Google Scholar  Zentralblatt MATH
 N. A. ElSherbeny, “Vehicle routing with time windows: an overview of exact, heuristic and metaheuristic methods,” Journal of King Saud University—Science, vol. 22, no. 3, pp. 123–131, 2010. View at: Publisher Site  Google Scholar
 H. I. Calvete, C. Galé, M.J. Oliveros, and B. SánchezValverde, “A goal programming approach to vehicle routing problems with soft time windows,” European Journal of Operational Research, vol. 177, no. 3, pp. 1720–1733, 2007. View at: Publisher Site  Google Scholar  MathSciNet
 M. M. Solomon, “Algorithms for the vehicle routing and scheduling problems with time window constraints,” Operations Research, vol. 35, no. 2, pp. 254–265, 1987. View at: Publisher Site  Google Scholar  Zentralblatt MATH  MathSciNet
 É. Taillard, P. Badeau, M. Gendreau, F. Guertin, and J.Y. Potvin, “A tabu search heuristic for the vehicle routing problem with soft time windows,” Transportation Science, vol. 31, no. 2, pp. 170–186, 1997. View at: Publisher Site  Google Scholar  Zentralblatt MATH
 G. Ioannou, M. Kritikos, and G. Prastacos, “A problem generatorsolver heuristic for vehicle routing with soft time windows,” Omega, vol. 31, no. 1, pp. 41–53, 2003. View at: Publisher Site  Google Scholar
 W.C. Chiang and R. A. Russell, “A metaheuristic for the vehiclerouteing problem with soft time windows,” Journal of the Operational Research Society, vol. 55, no. 12, pp. 1298–1310, 2004. View at: Publisher Site  Google Scholar
 M. A. Figliozzi, “An iterative route construction and improvement algorithm for the vehicle routing problem with soft time windows,” Transportation Research Part C: Emerging Technologies, vol. 18, no. 5, pp. 668–679, 2010. View at: Publisher Site  Google Scholar
 D. Taş, N. Dellaert, T. van Woensel, and T. de Kok, “The timedependent vehicle routing problem with soft time windows and stochastic travel times,” Transportation Research Part C: Emerging Technologies, vol. 48, pp. 66–83, 2014. View at: Publisher Site  Google Scholar
 C.I. Hsu, S.F. Hung, and H.C. Li, “Vehicle routing problem with timewindows for perishable food delivery,” Journal of Food Engineering, vol. 80, no. 2, pp. 465–475, 2007. View at: Publisher Site  Google Scholar
 A. Osvald and L. Z. Stirn, “A vehicle routing algorithm for the distribution of fresh vegetables and similar perishable food,” Journal of Food Engineering, vol. 85, no. 2, pp. 285–295, 2008. View at: Publisher Site  Google Scholar
 P. Amorim and B. AlmadaLobo, “The impact of food perishability issues in the vehicle routing problem,” Computers & Industrial Engineering, vol. 67, no. 1, pp. 223–233, 2014. View at: Publisher Site  Google Scholar
 Ministry of Transport of the People's Republic of China, Technical Standard of Highway Engineering JTG B012003, Ministry of Transport of the People's Republic of China, Beijing, China, 2004.
 J.H. Lin, “Variations in dynamic vehicle load on road pavement,” International Journal of Pavement Engineering, vol. 15, no. 6, pp. 558–563, 2014. View at: Publisher Site  Google Scholar
 J. H. Holland, Adaptation in Natural and Artificial Systems: An Introductory Analysis with Applications to Biology, Control, and Artificial Intelligence, University of Michigan Press, 1975.
 D. E. Goldberg, Genetic Algorithms in Search, Optimization, and Machine Learning, AddisonWesley, London, UK, 1989.
 Z. Michalewicz, Genetic Algorithms + Data Structure = Evolution Programs, Springer, New York, NY, USA, 3rd edition, 1999.
 J. Li and Y. H. Guo, Theories and Methods in Optimization of Logistics Distribution, China Material Press, 2010.
 M. R. Noraini and J. Geraghty, “Genetic algorithm performance with different selection strategies in solving TSP,” in Proceedings of the World Congress on Engineering, 2011. View at: Google Scholar
 M.X. Lang, “Study of the optimizing of physical distribution routing problem based on genetic algorithm,” China Journal of Highway and Transport, vol. 15, no. 3, pp. 76–79, 2002. View at: Google Scholar
 Y. Ding and Y. Z. Li, “Genetic algorithm for vehicle routing problem with capacity restriction,” Journal of Lanzhou Jiaotong University, vol. 24, no. 6, pp. 123–126, 2005. View at: Google Scholar
 O. Alp, E. Erkut, and Z. Drezner, “An efficient genetic algorithm for the pmedian problem,” Annals of Operations Research, vol. 122, no. 1–4, pp. 21–42, 2003. View at: Publisher Site  Google Scholar
 W. D. Yang and W. F. Wang, “Analyzing and modeling of multimodal transportation with time window,” Journal of Nanjing University of Aeronautics & Astronautics, vol. 41, no. 1, pp. 111–115, 2009. View at: Google Scholar
 P. Larrañaga, C. M. H. Kuijpers, R. H. Murga, I. Inza, and S. Dizdarevic, “Genetic algorithms for the travelling salesman problem: a review of representations and operators,” Artificial Intelligence Review, vol. 13, no. 2, pp. 129–170, 1999. View at: Publisher Site  Google Scholar
Copyright
Copyright © 2015 Peiqing Li et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.