Optimal Path Planning of Logistics Distribution of Urban and Rural Agricultural Products From the Perspective of Supply Chain

Logistics distribution is a crucial part of the supply chain of agricultural products. This paper optimized the distribution path of agricultural products between distribution centers and customers using the adaptive genetic algorithm and conducted a simulation comparison with greedy and traditional genetic algorithms. The results showed that although the greedy algorithm obtained the path planning scheme faster, the planning path obtained by the genetic algorithm was better, and the adaptive genetic algorithm obtained a shorter distribution path, lower transportation cost, and less computation time than the traditional genetic algorithm


Introduction
Rapid economic development has improved people's standard of living, which in turn has stimulated the desire to consume and driven economic growth [1]. At the same time, the improvement of the logistics level not only enables people to choose a wider variety of goods but also enables remote shopping, free from geographical restrictions on shopping. In addition to the improvement of shopping, the improvement of logistics is also beneficial to the development of the supply chain. The supply and demand sides of products in the supply chain are linked together through specific channels, and the supply side provides the related products according to the requirements of the demand side [2]. The supply side in the supply chain can have more than one demand side, and the demand side can have more than one supply side. The supply and demand sides in the supply chain together form a supply network. The supply side needs to plan a reasonable logistics distribution path when distributing products to multiple demand sides [3]. Related studies are as follows. Xiong et al. [4] proposed to optimize the logistics distribution path using the fish swarm algorithm and found through experiments that the algorithm quickly jumped out of the locally optimal solution and converged to the shortest path. Yu et al. [5] established a threedimensional constraint model for the actual demand in ecommerce and used it to optimize the logistics distribution path algorithm. The experimental results showed that the optimized algorithm reduced the distribution mileage by more than 25% compared to the genetic algorithm, i.e., the comprehensive performance of the model was improved. Yang [6] established a hard time-window path optimization model for logistics distribution under a dynamic road network based on the distribution path optimization, considering the dynamic uncertainty of the urban road network and taking the minimum cost as the objective function. Table 1: A summary of this paper.

The purpose of this study
The objective of this paper is to optimize the logistics distribution path of agricultural products in the supply chain to improve the logistics distribution efficiency and reduce the distribution cost. The design of this study In this paper, after constructing the distribution model of agricultural logistics under the supply chain, the genetic algorithm was used to optimize the distribution path, and the fixed crossover and mutation probabilities in the genetic algorithm were improved to the adaptive probabilities. The results of this study The experimental results showed that the improved adaptive genetic algorithm obtained better logistics distribution paths and had higher planning efficiency than the traditional genetic algorithm and greedy algorithm. The contribution of this study This paper improved the crossover and mutation probabilities of the genetic algorithm to make adaptive adjustment according to the target in the process of optimization, so as to obtain a better distribution path. This work provides an effective reference for agricultural logistics distribution path planning. The limitation of this study The shortcoming of this paper is that the constraints of the model were simplified for the convenience of calculation when constructing the distribution model of agricultural logistics under the supply chain, which makes the planning scheme deviate to a certain extent. Therefore, the future research direction is to make more specific provisions for the constraints of the distribution model.

Agricultural products supply chain
A supply chain is a customer or market demand-oriented channel relationship between supply and requisitioning parties. The demand side finds the supply side based on the demand for the product, and the supply side delivers the product to the location of the demand side through logistics. Agricultural products have higher time limit requirements than other types of products [7]. Users can get the agricultural products they need faster through the supply chain. The concept of customer demand as the business direction in the supply chain can, in turn, guide the production direction of agricultural products and reduce unnecessary losses for farmers. Figure 1 shows the basic structure of the agricultural products supply chain. Firstly, agricultural products customers will communicate their demand information for agricultural products to the agricultural products distribution center, and the agricultural products distribution center will summarize the demand information from different customers and then communicate the corresponding demand information to the suppliers of the agricultural products [8]. After receiving the demand information, the suppliers of the agricultural products deliver the corresponding agricultural products to the distribution center, and finally, the distribution center carries out the logistics distribution of agricultural products according to the customer's demand information.
The agricultural product supply chain structure diagram in Figure 1 is a simplified sequence diagram. In the actual supply chain, there are plural suppliers, distribution centers, and customers, but the distribution centers play the role of aggregation and distribution of agricultural products, so the number of distribution centers is smaller; therefore, the actual structure of the supply chain is more like a net than a chain. In addition, Figure 1 also shows that the types and number of agricultural products to be distributed by the distribution center depend on the information provided by the customer, and the types and number of agricultural products sent by the supplier to the distribution center depend on the information provided by the distribution center. It is further seen that in the supply chain model, agricultural product sales are guided by the market demand and are not decided by the suppliers, which promotes market development [9].

Logistics distribution path
optimization from a supply chain perspective

Logistics distribution path model
This paper optimizes the efficiency and cost of supply chain operation by optimizing the logistics distribution path in the supply chain. Since the distribution center initiates the demand for agricultural products to the supplier, and then the supplier delivers the agricultural products to the distribution center, the path between the supplier and the distribution center is fixed and does not need optimization, so this paper only considers the path solution between the distribution center and every user when considering the logistics distribution path optimization. In the actual supply chain, every distribution center needs to distribute agricultural products to different customers, and every distribution center needs to take itself as the starting point to design the distribution path. Planning the distribution path between distribution centers and customers is considered a multi-point logistics distribution path planning problem [10]. Realistic distribution path planning is subject to many influencing factors and involves more complicated calculations as multiple vehicles are involved in distribution within a distribution center. Therefore, some assumptions are often made to facilitate computation when constructing the multi-point logistics distribution path model. The assumptions made in this paper are: (1) the quantity of agricultural products in the distribution center can meet the demand of all customers who have contact with the distribution center; (2) there are enough vehicles in the distribution center for agricultural products distribution, and the specification of every vehicle is consistent; (3) when one vehicle is responsible for the demand of one customer, other vehicles are not responsible for that customer; (4) vehicles in the distribution process ignore the impact of loading and unloading at the distribution point on the transportation time, and because the vehicle specification and transportation speed are consistent, the transportation cost of every distribution vehicle is only related to the path length; (5) additional assignments or additions of products will be allowed while the vehicle is following the planned route for delivery; (6) the geographical relationship between the distribution center and the customer is known, and the customer's demand for agricultural products is also known.
The expression of the logistics distribution path model [11] is: The constraints are: where Z is the total transportation cost of the distribution route, k is the distribution vehicle number (there are N vehicles), i and j are the customer node number (the number of the distribution center is 0, and the customer node number is 1, 2, 3 ......R), ijk x is the decision variable (its value is 1 when distribution vehicle k drives from node i to node j and 0 else), ik y is the decision variable (its value is 1 if the demand of node i is completed by distribution vehicle k and 0 else), 1  represents other vehicles cannot be responsible for meeting the demand of a customer after one of them has been responsible for that customer, represents that the distribution vehicle will return to the distribution center after completing the distribution task, k Q represents the maximum load of the distribution vehicle [12], i q represents the demand of customer node i for agricultural products, k C is the transportation cost per unit distance of the distribution vehicle, and ijk d is the transportation distance between nodes i and j .

Distribution path optimization based on the adaptive genetic algorithm
A genetic algorithm is used to optimize the logistics distribution path from a supply chain perspective. The basic principle of the genetic algorithm for route optimization is to consider nodes as genes in a chromosome, i.e., the sequence of genes as the distribution path of vehicles. When using the genetic algorithm to optimize the logistics distribution path, the initial population is first randomly generated according to specific steps, and then the transportation cost is calculated for the distribution path scheme represented by every chromosome in the population using the formula of the distribution path model. The transportation cost is the adaptive value of the genetic algorithm. If the algorithm does not reach the termination condition, the iteration is repeated according to the preset crossover and mutation probabilities until the termination condition is satisfied.
The traditional genetic algorithm keeps the good gene fragments under the guidance of the adaptive value, integrates them by crossover operation [13], and generates new gene fragments by mutation operation; eventually, the adaptive value of the population is converged. The key lies in the crossover and mutation operations in the genetic operation. The probabilities of the two operations will directly affect the convergence speed and quality of the algorithm, but the crossover and mutation probabilities in the traditional genetic algorithm are usually fixed parameters set empirically. Large probabilities may lead to difficulty in convergence or make the solution fall into locally optimal in the late iteration. Therefore, the genetic algorithm was optimized by adaptive crossover and mutation probabilities [14]. The optimized path optimization flow is shown in Figure 2.
① A customer node is randomly selected from the set of customer nodes that have not been assigned a distribution vehicle.
② A distribution vehicle is selected randomly from the set of distribution vehicles.
③ If the remaining load of the selected distribution vehicle can meet the demand quantity of the selected customer node, then the customer node is assigned to that distribution vehicle, and if it cannot meet, then it returns to step ②.
④ Whether all the customer nodes are allocated is determined. If not, it returns to step ①; if they are, the allocation scheme of customer nodes is encoded to generate chromosomes. The structure is shown in Figure  3. The large gene fragment in the chromosome is the distribution path scheme of a distribution vehicle. The number of distribution centers is at the beginning and the end, and the allocation order of customer nodes in the middle is the distribution order. ⑤ The chromosomes are stored in the population to judge whether the number of chromosomes in the population reaches the preset value. If not, it returns to step ①; if it does, it goes to the next step.
⑥ The formula of the logistics distribution path model is used to calculate the transportation cost of the distribution path scheme corresponding to every chromosome, i.e., the adaptive value of the chromosome.
⑦ Whether the genetic algorithm reaches the termination condition is determined. If it does, the optimal chromosome distribution path scheme is output; if not, the crossover and mutation probabilities are adjusted according to the adaptive value of the chromosome. The adaptive adjustment formula is: ⑧ Genetic operations are performed on the population chromosomes, including selection, crossover, and mutation. The selection operation is to keep the 10% of chromosomes with the lowest transportation cost in the population directly as the offspring chromosomes. The crossover operation is to exchange all distribution point genes within the daughter chromosomes with the same vehicle number in two chromosomes, delete duplicate genes, and supplement the missing distribution point genes to ensure complete and non-duplicate distribution points in the whole chromosome. The mutation operation is to exchange the distribution point gene to be mutated in the daughter chromosome with the distribution point gene at the same gene position in another daughter chromosome. A population composed of offspring chromosomes is obtained after selection, crossover, and mutation operations. Then, it returns to step ⑥.  [15]. The experiment was conducted on a server in a lab.

Experimental setup
To facilitate calculation, the agricultural products were considered as one kind, and the total weight was used as the demand of customer nodes. Among the node numbers, 0 was the distribution center, and 1~10 was the customer node numbers. The demand of the customer nodes for agricultural products and the distance between different nodes are shown in Table 2. In addition, the distribution center had four trucks with the same specifications, the maximum weight of the trucks was 1.5 tons, and the transportation cost was 15 yuan/km. In order to verify the effectiveness of the adaptive genetic algorithm, this paper also conducted simulation experiments on the traditional genetic and greedy algorithms for comparison. When the greedy algorithm planned the distribution path, it first scanned counterclockwise with the distribution center as the origin and assigned the customer nodes to the distribution vehicles from near to far. The vehicle was changed by another one when the remaining load of the vehicle was not able to bear the demand. After the customer nodes were assigned, every vehicle selected the nearest distribution node as the next node.
The parameters of the traditional genetic algorithm for planning the distribution path are as follows. The population size was 30, c P was 0.07, m P was 0.01, and the maximum number of iterations was 1000.
The relevant parameters of the adaptive genetic algorithm for planning the distribution path are as follows. The population scale was 30, 1 c P was 0.07, 2 c P was 0.05, 1 m P was 0.01, 2 m P was 0.005, and the maximum number of iterations was 1000. Figure 4 shows the logistics distribution paths obtained using the greedy, traditional genetic, and adaptive genetic algorithms, respectively. Every color in Figure 4 represents the distribution path of one distribution vehicle. Since the specifications of the distribution vehicles were consistent, no additional path attribution was marked. It was seen from Figure 4 that the path scheme obtained by every algorithm required three distribution vehicles for distributing agricultural products. The distribution paths under the greedy algorithm were 0-7-1-2-4-0, 0-5-6-8-10-9-0, and 0-3-0; the distribution paths under the traditional genetic algorithm were 0-4-1-2-3-5-0, 0-7-9-10-8-0, and 0-6-0; the distribution paths under the adaptive genetic algorithm were 0-1-2-3-4-0, 0-5-6-10-8-0, and 0-7-9-0.   Table 3 shows the total transportation length and cost of the distribution paths under the three-logistics distribution path planning algorithms and the corresponding time consumed for calculating the three path schemes shown in Figure 4. The total length of the distribution path obtained by the greedy algorithm was 34.57 km, the total transportation cost was 518.55, and the time taken to calculate this path scheme was 13.56 s; the total length of the distribution path obtained by the traditional genetic algorithm was 33.93 km, the total transportation cost was 508.95, and the time taken to calculate this path scheme was 25.67 s; the distribution path obtained by the adaptive genetic algorithm was 29.54 km, the total transportation cost was 443.10, and the time taken to calculate this path scheme was 19.65 s.

Experimental results
The comparison of the data in Table 2 showed that the greedy algorithm obtained the longest distribution path and the highest transportation cost, the traditional genetic algorithm obtained the second longest distribution path and the second lowest transportation cost, and the adaptive genetic algorithm obtained the shortest distribution path and the lowest transportation cost.
The greedy algorithm spent the shortest time calculating the path scheme, while the traditional genetic algorithm spent the longest time.

Discussion
The supply chain is a customer or market demand-oriented channel relationship between supply and demand. The demand side seeks out the supply side according to the demand for products, and the supply side delivers the products to the demand side through logistics according to the demand side's product demand. With the supply chain, customers can get the goods they need more quickly. Especially for agricultural products with a short shelf life, the faster the transportation and delivery, the higher the sale value can be retained. In the process of logistics distribution of agricultural products supply chain, the planning of the distribution route is an important part. After constructing the logistics distribution model of agricultural products under the supply chain, this paper used the genetic algorithm to optimize the logistics distribution path plan. In order to improve the performance of the genetic algorithm, this paper improved the fixed crossover and mutation probabilities of the traditional genetic algorithm into probabilities that can be adjusted according to the adaptive value of the distribution plan. Finally, the improved genetic algorithm was compared with the traditional genetic algorithm and greedy algorithm in the simulation experiment. The final experimental results are shown in the previous section. The experimental results show that the proposed adaptive genetic algorithm yielded the best distribution path solution and took the least amount of time to compute the distribution solution. The reason is as follows. The greedy algorithm only considered the nearest node, i.e., the locally shortest path, when selecting the next node, but the combination of the local shortest path might not be the globally shortest. Moreover, the assignment results of the scanning method adopted by the greedy algorithm were contingent, and the customer nodes assigned to the distribution vehicles also affected the subsequent path planning. The genetic algorithm randomly generated the chromosomes representing the path scheme, reducing the contingency of node assignment as much as possible. The adaptive values afterward guided the crossover and mutation from the global perspective; thus, its planning result was better than the greedy algorithm. In terms of computing time, the greedy algorithm selected the next node according to the principle of being closest to the current node, i.e., it only compared the path length. The genetic algorithm iterated the population repeatedly until the adaptive population value converged and stabilized, and the adaptive value of all chromosomes was calculated in every iteration. Therefore, the traditional genetic and adaptive genetic algorithms both took more time than the greedy algorithm. The adaptive genetic algorithm autonomously adjusted the crossover and mutation probabilities so that it did not fluctuate up and down around the optimal adaptive value after iteration due to excessively large probability but stably converged to the optimal solution, so it consumed the shortest time.

Conclusion
This paper briefly introduced the basic structure of the agricultural product supply chain, used the adaptive genetic algorithm to optimize the logistics distribution path in the agricultural product supply chain, and finally compared it with greedy and traditional genetic algorithms in the simulation experiment. The obtained results are as follows. (1) The path schemes obtained by the three algorithms all needed three vehicles; the scheme of the greedy algorithm was 0-7-1-2-4-0, 0-5-6-8-10-9-0, and 0-3-0, the scheme of the traditional genetic algorithm was 0-4-1-2-3-5-0, 0-7-9-10-8-0, and 0-6-0, and the scheme of the adaptive genetic algorithm was 0-1-2-3-4-0, 0-5-6-10-8-0, and 0-7-9-0. (2) The total length and transportation cost of the distribution path obtained by the greedy algorithm were 34.57 km and 518.55 yuan, those of the traditional genetic algorithm were 33.93 km and 508.95 yuan, and those of the adaptive genetic algorithm were 29.54 km and 443.10 yuan. (3) The time consumed by greedy, traditional genetic, and adaptive genetic algorithms to calculate the path scheme was 13.56 s, 25.67 s, and 19.65 s, respectively.