# The Construction of Intelligent Supply Chain System for Agricultural Products Based on Improved Ant Colony Algorithm

Authors: Xueyong Bian; Jie Tian
Journal: Mobile Information Systems
 (2022)

---

## Abstract

With the rapid development of China itself, the supply chain system has become an effective tool to enhance economic competitiveness, and the intelligent supply chain system integrates innovative technologies such as the Internet, the Internet of Things, cloud computing, and big data into the industrial supply chain management. The ant colony algorithm shows super flexibility and robustness at the level of optimizing many combination problems; the intelligent supply chain architecture of agricultural products is essentially the rational allocation of resources, which is a dynamic combination of resources and tasks that combines a variety of combinations to select the most appropriate and optimal performance. In this paper, the architecture of the intelligent supply chain of agricultural products is studied in combination with the improved ant colony algorithm, and some improvement strategies are adopted to avoid falling into local optimization or local convergence in order to avoid falling into local optimization or local convergence. The improvements of the algorithm mainly include the following: improving the path search of individual ants, improving the pheromone update strategy, improving the selection probability, and improving the dynamic growth mechanism of ants. In this paper, the VRPTW mathematical model, the dataset TSPLIB, and the operation data of the intelligent supply chain of agricultural products are used for test verification; the results can be obtained by verifying the results of the experiment closer to the optimal solution, and the efficiency of the algorithm is significantly improved. Therefore, through the improvement and optimization of the ant colony algorithm, it is very suitable for solving and optimizing the intelligent supply chain system of agricultural products.


---

## Body

## 1. Introduction

In this paper, based on the construction of the intelligent supply chain system for agricultural products with the improved ant colony algorithm, the intelligent supply chain system construction of agricultural products is optimized by using the improved ant colony algorithm. The ant colony algorithm is a new simulated evolutionary algorithm, which is an important algorithm for swarm intelligence in the field of intelligence theory [1]. It is an intelligent algorithm based on multiple agents with a hypothetical balancing mechanism; in fact, it is a random probability algorithm that is a global search algorithm that can effectively avoid optimization in local areas. The swarm intelligence mentioned in the text is not a group of many individuals but is composed of individuals with simple intelligence working together to exhibit a complex intelligent behavioral characteristic [2]. The origin of this concept is related to nature, mainly through the observation of insects in nature, such as ants, bees, etc. [3]. The action behavior of an ant is extremely brief, and the number of behaviors is within 10 kinds, but hundreds or even tens of thousands of ants can get great wisdom by cooperating into a swarm of ants. The formation of a wisdom is inseparable from the transfer of information between them through pheromones [4]. A pheromone is a substance released by ants, and the main role of a pheromone is to identify where and where ants go. Let the latecomers choose the direction of walking according to the depth of the concentration of the pheromones according to their own pheromone identification and eventually reach the place where the food is [5]. When they first forage, there are no pheromones in the place where they are foraging, so as ants forage, they constantly coat their direction and route with a pheromone [6]. There will be some ants to find food, and at this time, there are many paths from the cave to the food marked by pheromones, so know that the route of the ants is randomly distributed [7]. Hence, in a certain period of time, most ants have more ants than those who take a long road, so they leave behind a higher concentration of pheromones. On this basis, all ants have a strong direction indication, and more and more ants will converge on the shortest path between the two points [8]. They have a clear organizational division of labor and mutual communication and information transmission; they can always find the shortest path between nests and food in complex environments; they interpret pheromones without vision to judge where they go and stay, and choose the direction where the pheromone concentration is strongest [9]; the pheromones they produce will become fainter and weaker with time. However, they can still make the right choices through judgments about pheromones. That is, they have a high degree of structure, automatic optimization, feedback of information, and autocatalytic behavior [10]. Many of the businesses and individuals we come into contact with, and between businesses, support e-commerce technologies, while some are emerging companies that learn e-commerce process technologies and use the supply chain system between restructuring [11]. In the transactions between companies and companies, which include online transactions, online markets, and electronic markets, they were once called to follow the trend of the times, and they were all dominated by them at the level of world trade, and many companies were not profitable, but lost money [12]. However, in this case, many companies have learned e-commerce processes and networks to reorganize their supply chains and have succeeded, and these successful companies have never been sluggish in doing e-commerce, although they are very economical [13]. Therefore, in the successful enterprise cases, it can be seen that the relationship between supply chain and e-commerce development also has great value and potential. In the process of competition between companies and companies, companies and individuals, individuals and individuals, online and offline, “intelligence” is also something that makes it more powerful, and the transition of all e-commerce to intelligence is also a very important step, that is, the intelligent supply chain [14]. Its intelligent dynamic supply chain network is based on the current trend of economy, industry, consumer market, etc., which has emerged and is about to occur a new type of logistics model, and some leading enterprises in China have entered this new model. For example, oTMS is based on the logic of “smart supply chain management network” [15], which has made the transportation management, procurement, and operation of some enterprises more flexible and transparent. For example, it can better deal with abnormal problems in the entire transportation process; it can cross some intermediaries to directly contact with more downstream transportation capacity, avoid the impact of transportation efficiency due to human or cooperative reasons, and so on. In a nutshell, it is the sinking of transportation capacity and the improvement of overall transportation efficiency and effectiveness [16]. All the improvements and optimizations based on technical algorithms are of great help to the architectural research of the intelligent supply chain of agricultural products.


## 2. Awareness of the Content of the Study

### 2.1. Ideological Background of Ant Colony Algorithm

From 1990 to 1999, Italian scholars in the process of studying ant foraging found that an ant’s behavior was simple, but it reflected intelligent behavior in group performance [17]. They can quickly find the closest passage to food in complex environments. The emergence of this phenomenon has led scholars to further study the foraging process of ants and found that they produce a pheromone substance in the process of foraging, and they can reach the food site through the nearest route through the interpretation and analysis of this substance. The walking route of the ant foraging indicates the best way and the best solution to the problem, and where they pass, the route formed constitutes the spatial route from the nest to the food, and the solution space to solve the problem [18]. The shorter the road, the higher the concentration of pheromones, so the longer the concentration of pheromones will be higher and higher, and later ants will choose this route to forage forward, and the walking route at this time is the optimal solution to the problem.


### 2.2. Theoretical Basis of Intelligent Supply Chain for Agricultural Products

Agricultural products mainly refer to crops, animal husbandry, fisheries, and other products, mainly tobacco, tea, edible mushrooms, melons, fruits, vegetables, flowers, seedlings, and so on. Tobacco: A product made from a variety of tobacco leaf processing. Mao tea: Tea made by processing young shoots plucked from tea trees. Edible mushrooms: Natural or artificially cultivated edible mushrooms. Melons, fruits, and green foods: Such as watermelon, cabbage, sweet potatoes, and so on.The supply chain is a functional chain that connects suppliers, manufacturers, distributors, and end users, from supporting the production of components to end products to shipping products to consumers through distribution networks [17]. The business philosophy of support chain management is to look for an overall optimization of the supply chain from the perspective of the consumer and from the perspective of the company. Successful supply chain management can coordinate and integrate all supply chain activities, resulting in a seamless integration process. Then, the so-called intelligent supply chain is to use the Internet, the Internet of Things, cloud computing, big data, and other innovative technologies into the industrial supply chain management so that enterprises can achieve intelligent, digital, networked, and automated management [19]. The intelligent supply chain empowers the logistics industry, can reduce the cost of logistics enterprises, and is conducive to the establishment of their own core competitiveness to cross the express transport as an example: Across the express transport, this logistics company has long begun to lay out the intelligent supply chain, across the express transport through the role of technology and data, people, vehicles, and goods; after strict management and control and careful operation, we finally found the best punctuality, service, and cost standards greatly improve the transportation efficiency so that the majority of users have the ultimate experience.The intelligent supply chain mainly includes three structures: decision-making level, management level, and application layer. Among them, the intelligent supply chain center interacts with the console data, and the data of the intelligent supply chain center will also enter the sales intelligence application, analyze the operation data, form an auxiliary decision-making basis, and provide feedback layer by layer for auxiliary decision-making, and finally return to the console. The decision-making layer makes the final decision based on the information received, as shown in Figure1.Figure 1
Overall framework of the intelligent supply chain.


#### 2.2.1. Decision-Making Layer

From the receipt of the first order, to the analysis and forecasting, to the coordination of the supply chain (that is, the console controls all the links in the supply chain), the console is the best choice.


#### 2.2.2. Management

Manage and coordinate the intelligent supply chain architecture to provide effective support for the operation of the supply chain.


#### 2.2.3. Application layer

The data generated by the intelligent supply chain during operation will be submitted to the sales intelligent application system for data processing, and feedback will be put forward to the supply chain center according to the analysis of user characteristics and marketing data and then submitted to the console.


## 2.1. Ideological Background of Ant Colony Algorithm

From 1990 to 1999, Italian scholars in the process of studying ant foraging found that an ant’s behavior was simple, but it reflected intelligent behavior in group performance [17]. They can quickly find the closest passage to food in complex environments. The emergence of this phenomenon has led scholars to further study the foraging process of ants and found that they produce a pheromone substance in the process of foraging, and they can reach the food site through the nearest route through the interpretation and analysis of this substance. The walking route of the ant foraging indicates the best way and the best solution to the problem, and where they pass, the route formed constitutes the spatial route from the nest to the food, and the solution space to solve the problem [18]. The shorter the road, the higher the concentration of pheromones, so the longer the concentration of pheromones will be higher and higher, and later ants will choose this route to forage forward, and the walking route at this time is the optimal solution to the problem.


## 2.2. Theoretical Basis of Intelligent Supply Chain for Agricultural Products

Agricultural products mainly refer to crops, animal husbandry, fisheries, and other products, mainly tobacco, tea, edible mushrooms, melons, fruits, vegetables, flowers, seedlings, and so on. Tobacco: A product made from a variety of tobacco leaf processing. Mao tea: Tea made by processing young shoots plucked from tea trees. Edible mushrooms: Natural or artificially cultivated edible mushrooms. Melons, fruits, and green foods: Such as watermelon, cabbage, sweet potatoes, and so on.The supply chain is a functional chain that connects suppliers, manufacturers, distributors, and end users, from supporting the production of components to end products to shipping products to consumers through distribution networks [17]. The business philosophy of support chain management is to look for an overall optimization of the supply chain from the perspective of the consumer and from the perspective of the company. Successful supply chain management can coordinate and integrate all supply chain activities, resulting in a seamless integration process. Then, the so-called intelligent supply chain is to use the Internet, the Internet of Things, cloud computing, big data, and other innovative technologies into the industrial supply chain management so that enterprises can achieve intelligent, digital, networked, and automated management [19]. The intelligent supply chain empowers the logistics industry, can reduce the cost of logistics enterprises, and is conducive to the establishment of their own core competitiveness to cross the express transport as an example: Across the express transport, this logistics company has long begun to lay out the intelligent supply chain, across the express transport through the role of technology and data, people, vehicles, and goods; after strict management and control and careful operation, we finally found the best punctuality, service, and cost standards greatly improve the transportation efficiency so that the majority of users have the ultimate experience.The intelligent supply chain mainly includes three structures: decision-making level, management level, and application layer. Among them, the intelligent supply chain center interacts with the console data, and the data of the intelligent supply chain center will also enter the sales intelligence application, analyze the operation data, form an auxiliary decision-making basis, and provide feedback layer by layer for auxiliary decision-making, and finally return to the console. The decision-making layer makes the final decision based on the information received, as shown in Figure1.Figure 1
Overall framework of the intelligent supply chain.


### 2.2.1. Decision-Making Layer

From the receipt of the first order, to the analysis and forecasting, to the coordination of the supply chain (that is, the console controls all the links in the supply chain), the console is the best choice.


### 2.2.2. Management

Manage and coordinate the intelligent supply chain architecture to provide effective support for the operation of the supply chain.


### 2.2.3. Application layer

The data generated by the intelligent supply chain during operation will be submitted to the sales intelligent application system for data processing, and feedback will be put forward to the supply chain center according to the analysis of user characteristics and marketing data and then submitted to the console.


## 2.2.1. Decision-Making Layer

From the receipt of the first order, to the analysis and forecasting, to the coordination of the supply chain (that is, the console controls all the links in the supply chain), the console is the best choice.


## 2.2.2. Management

Manage and coordinate the intelligent supply chain architecture to provide effective support for the operation of the supply chain.


## 2.2.3. Application layer

The data generated by the intelligent supply chain during operation will be submitted to the sales intelligent application system for data processing, and feedback will be put forward to the supply chain center according to the analysis of user characteristics and marketing data and then submitted to the console.


## 3. Optimization and Design of Supply Chain Paths

### 3.1. Standard Ant Colony Algorithm

Assume more ants, study related problems, and then have them parallel. After each ant completes a journey, it releases pheromones during the journey, and the pheromone content is proportional to the quality of the solution [20]. Ant paths choose a random local search strategy based on the initial pheromone amount (provided the initial pheromone amount is equal) after considering the distance between two points. This improves the pheromone of the periphery and makes it easier to choose follow-up actions. Each ant can only take the legal route when all the ants run out to find them and they will start to have the autonomy to update all the pheromones. New ant colonies conduct new searches for updated pheromones that include alternatives to the original pheromones and improved their methods. If the predetermined steps are happening or stalling (all the ants have chosen the same path and the answer has not changed), then the algorithm succeeds, and the current best solution is considered the best solution to the problem. The flowchart of the ant colony algorithm is summarized in Figure 2. It looks like this:Figure 2
Flowchart of the ant colony algorithm.


### 3.2. Analyze the Supply Chain Path

The logistics characteristics of the intelligent supply chain of agricultural products include a variety of models, unfilled, multi-target, vehicle path problems, time windows, and other characteristics. VRP (VRPTW) with a time window is more suitable for the actual situation of intelligent supply chains for agricultural products [21]. The mathematical model of VRPTW is as follows:Objective function:(1)minΖ=∑i=0n∑j=0n∑k=1kCijXijk,represents its lowest cost.The actual cargo capacity of vehiclek is less than the vehicle’s limit cargo capacity:(2)∑j=1nqyjk≤D,K=1,2,…,K.For each vehicle departing from the supply center:(3)∑k=1kyok=K.The vehicle serves and completes the delivery of the designated user:(4)∑j=1kyjk=1,j=1,2,⋯,n.All vehicles complete the mission and return to the starting point:(5)∑i=1nXiok=1,K=1,2,⋯,K.The relationships between the variables are(6)∑i=0nXijk=yjk,j=1,2,⋯,n;k=1,2,⋯,K,∑j=0nXijk=yik,i=1,2,⋯,n;k=1,2,⋯,K.Equation (7) is the time window that satisfies the user’s requirements:(7)STi≤ti+wi≤ETi,i=1,2,⋯,n;k=1,2,⋯,K,Xijk=1,VehicleKstarts from merchantviand goes back to merchantvj,0,otherwise,,yjk=1,The task of merchantvjis completed by vehicleK,0,otherwise..Formula V represents vertex set;v1,v2,⋯,vn represent user;v0 represents intelligent supply chain supply center for agricultural products;E represents side set;K represents the total number of cars;Cij represents the cost of transportation from user to user, vivj;qi------------------vi;q represents the weight of what the vehicle can hold;STi,ETi represents the user’s time window, vi;STi represents the starting point of the delivery time of individual users;ETi represents the end of the delivery period for individual users;ti represents the vi time when the vehicle arrives at the user;wi represents the time that the vehicle vi stays in the user.


### 3.3. Improve the Ant Colony Algorithm

#### 3.3.1. Ant Colony Systems

(1)
Set to a new constant; a random number is generated before antk chooses a path; and if the q0q0∈0,1qq0∈0,1 node of the current k is i, then k moves from node to node, following ij the PP formula; the PP formula is as follows:∗(8)PP=argmaxj∈ALkτijaηijβ,q≤q0,Pijk,q>q0..(2)
Global pheromone update for the shortest route is as the following formulas:(9)τij=1−p∗τijt−1+p∗Δτij,(10)Δτij=1Lbest,If the global optimal path includes pathi,j,0,Otherwise..In formula (9), p represents a pheromone evaporation parameter, pp∈0,1. In Equation (10), Δτij indicates that the pheromone of the current route(i,j) increases through the loop; Lbest indicates that the best global route is found, ΔτijLbest.(3)
In addition, local pheromones are also being upgraded and improved, and ants move from nodei to node j, and the route they pass, representing constants, refers to the concentration of pheromones on the initial path, adjustable. The formula is as follows: i,jτ0ξξ∈0,1,(11)τijt=1−ξ∗τijt−1+ξ∗t0.


#### 3.3.2. Maximum and Minimum Ant Colony System

(1) Improvements to the Search Path of Individual Ants. Set O, P, Q, W, and N as the user address because the, is OW<DsOP<DSON<DsOQ>DSDs. O, P, Q, and W and N are the radius formed by the user’s address. O is the starting point, and then, the selectable end points are P, N, and W, and Q cannot be used as the end point. Then, the probability of choosing O point to P, W, N, and other points is inversely proportional to the distance, and the closer the distance, the easier it is to choose the next one, as shown in Figure 3, starting from O, P may be preferred as the next point.Figure 3
User-point selection strategy.Taking a one-day agricultural product order in a certain area as the sample data, the number of users is about 2270, the number of ants in the population is 26, and the number of iterations is 360. The sample data were performed 40 times, and the time and path length of the first 20 improvements and the last 20 improvements of the experiment were averaged, respectively. The results are shown in Table1.Table 1
Improved search comparison of stocks before and after.
Compare itemsMean time to complete (s)Draw path length (km)Before improvements1237.517681.6After improvements213.34218.8Hence, from Table1, we can see that the improved ant colony algorithm is converging at a faster rate.(2) Improve Pheromones. In order to get a better and better solution, add a penalty function to improve pheromone updates based on (delivery time) ti.Maximum time difference TM:(12)TM=ETi−STi×15%,where ETi is the end time and STi is the start time ETiSTiPenalty function formula:(13)PF=ti−STiTM+1,STi−TM<ti<STi,1,STi<ti<ETi,ti−ETiTM+1,ETi<ti<ETi+TM,,where STi is the starting point of the delivery time period in the intelligent supply chain center, ETi is the end point of the delivery time period in the intelligent supply chain center, and ti is the time at which the vehicle arrives at the user, vi.The purpose of the penalty function formula is to accelerate the convergence of the ant colony without affecting the optimization ability of the pheromone.Pheromone calculation formula:(14)τijnew¯=τij+ΔτijnewPF.It indicates that the longer it exceeds the window, the smaller the cumulative value of this path, the lower the chance of choosing it.(3) Improve the Selection Probability. The ant colony iteration is divided into three stages, and the calculation formula is distributed in different stages, the formula is as follows:(15)P=c1,0<ni<nj,c2,nj<ni<nk,c1,nk<ni<nmax,,where ni is the current iteration position, ni and nkare the number of iterations, and nmax is the maximum number of iterations. P is the probability, 0.8 << c1 1.0< < 0.4 c2. The larger the P value, the more the ants are acting on the same path, resulting in a very similar path; the optimal solution cannot be found; and the smaller the P value, the smaller the P value, indicating that the ants do not walk on one path but spread out to expand the walking range, but the disadvantage is that the convergence rate is slower.(4) Growth Mechanism. When the ant colony algorithm is applied to the intelligent supply chain architecture of agricultural products, it will be limited by the impact of intelligent supply chain logistics of agricultural products, and the calculation formula is as follows:(16)K=DQ,where D represents the total amount of agricultural goods waiting for distribution, Q is the load capacity of a single distribution vehicle in the intelligent supply chain center for agricultural products, K is the total number of theoretical distribution vehicles in the intelligent supply chain center of agricultural products. The flow of the improved ant colony algorithm is shown in Figure 4.Figure 4
Improved ant colony algorithm flowchart.(5) The Improved Ant Colony Algorithm Flow and the Algorithm Flow. (1)
Start:(1)
Read the set of orders to be issued, and get the basic information of the associated users, such as quantity, longitude and latitude. In the ant colony algorithm, user location is equated with city.(2)
Initializes the taboo access table (list of allowed nodes and list of accessed nodes).(3)
Calculate the ideal number of delivery vehicles (ant number).(4)
Calculate the maximum number of vehicles allowed.(5)
Set the global optimal vehicle load ratio, the global optimal single load ratio, and the default single load ratio.(2)
Loop iterations until the maximum number of iterations is reached:(1)
Initialize the basic parameters of this iteration.(2)
Start traversing addresses until you traverse all addresses.(a)
Select the next appropriate location in turn. Selection principle: The appropriate place is one of the sets of the next location that the ant’s current node can reach, and the amount of goods in that location is less than the remaining load of the ant. There may be multiple ants that meet the criteria. The roulette algorithm is used for selection. The more pheromones, the easier it is to choose.(b)
When the ant finds the next suitable place, update the relevant information of the ant, record the information of the place, increase the load of the ants, and mark the place as a place that has been visited.(c)
If no ants find the next place to visit in consecutive P times, add an ant and traverse the remainingm times where there is no visit.(3)
Iterate through all user locations and all ants reach their distribution destinations.(4)
Calculate objective function value:(a)
The total stroke of all ants is locally optimal.(b)
Calculate the total stroke of all ants.(c)
Determine whether it is the global optimal ant colony, and record the optimal ant colony and the shortest total distance.


#### 3.3.3. Parallel Ant Colony Algorithm

Each colony uses a parallel algorithm to match their best solution. After the colony obtains the optimal solution, the other ants plot the resolution information on the receiver [22]. In the queue, regularly extract information from the queue, compare them with the most feasible local solutions, analyze the saved path information, and update the local information system. When the optimal path of other colonies deviates from the current colony path, other colonies are considered “filter paths” [23], as shown in Figure 5.Figure 5
Filter path schematic.As can be seen from Figure5, the colony has gone through the class A (A-B-C-D-E route). According to the best solutions and rules of other ant colonies, all pheromones on the road section are optimized for FB and DN roads to increase the possibility of choosing other roads. Then, the current information cable is updated as follows:(17)τi′=LnL0⋅τi,where τi′ is the pheromone value of the path for the current colony, τi is the pheromone value propagated by other ants on the road they are walking, Ln is the optimal solution of the filter path of the ant colony i corresponding to the sub-colony n, and L0 indicates the optimal solution for the current ant colony.The algorithm steps are shown in Figure6, and the algorithm steps are as follows:(1)
Initialize the system and generatex independent sub-ant colonies with the same basic information.(2)
X sub-colonies operate independently in parallel, and the number of iterations of each sub-colony isn, d = 0, C = 0. The specific steps are as follows:(1)
For sub-ant colonies I, the number of iterationsC = C + 1, each ant in the colony in turn enters the search path on the network and updates the pheromones. Record the optimal solution of the colony and the ants with the shortest path of the optimal ant (row).(2)
The number of iterations of sub-colony I satisfies the condition of dividingn by M = 0, and then the number of iterations is passed to the optimal ant information artificial intelligence (including its optimal path and attached pheromones) in other colony m-order operations.(3)
Repeat steps (1)-(2) untilC = n, exit the cycle, and wait for the other sub-colonies.(3)
At the same time, sub-colony I is responsible for receiving and processing the optimal colony spread by other sub-colonies, as follows:(1)
Write the optimal ant AK that receives the ant colony broadcast K to the ant queue Li.(2)
Take the earliest ant AK from the ant queue Li, calculate the differential path according to the calculation method, and update the pheromone matrix of sub-colony I.(3)
Repeat (1)-(2), repeatedly executed.(4)
After all sub-ant colonies completen iterations, the global optimal ant colony is output.(5)
End.Figure 6
Parallel ant colony algorithm flowchart.


#### 3.3.4. Parallel Ant Colony Algorithm Experiment

The parallel ant colony algorithm was experimented with to test its performance, and the data set was selected TSPLIB [24]. Set parameters: a = 1, b = 2, c = 0.95, G = 3, 4, 5, 6, 7, and M = 250. The experimental data are shown in Tables 2 and 3.Table 2
Test question examples.
IssueNumber of citiesSolution time (s)A22922912.40B43943973.62C57557570.30D74272473.78Table 3
Experimental results of the parallel ant colony algorithm.
IssueIndex3 units4 sets5 units6 units7 units8 unitsA229Acceleration ratio0.870.920.950.960.980.98Efficiency0.440.400.250.200.150.13B439Acceleration ratio1.511.661.962.312.202.30Efficiency0.760.550.590.530.360.22C575Acceleration ratio1.571.892.232.573.003.01Efficiency0.790.700.540.530.400.33D742Acceleration ratio1.701.982.453.093.303.20Efficiency0.850.770.570.590.520.36The parallel ant colony algorithm is measured according to the acceleration ratio and efficiency as follows:(18)Sp=T1Tp.The above equation represents the acceleration ratio formula, whereTp is the parallel ant colony algorithm runtime and T1is the time it takes for a single machine to execute a serial algorithm.(19)Ep=SpP.The above equation represents the efficiency formula, whereP indicates how many hosts there are and Ep indicates the efficiency of running the algorithm.The acceleration of this algorithm is shown in Figure7.Figure 7
Parallel ant colony algorithm experiment acceleration ratio trend plot.The experimental results from Figure7 show the acceleration ratio and efficiency of the parallel ant colony test algorithm. The acceleration ratio is 0.97 at a minimum and 3.25 at its largest. Obviously, if the problem data increase, the progress will also be greatly improved. When the amount of problem data is greater, the parallel ant colony algorithm can be used, which can greatly shorten the time. Using the parallel ant colony algorithm suggested in this paper for a large number of problems, setting reasonable initialization parameters will help greatly improve better acceleration efficiency.


#### 3.3.5. Improved Ant Colony Algorithm Experiments

The improved ant colony algorithm is experimental, the improved performance is tested, and the parametersa = 1, b = 2, and c = 0.95 are set, and the probability of each segment is C1 = 0.8 and C2 = 0.2, and the number of iterations is 250. The test sets are W20, M48, N30, and H225. The experimental results of the improved ant colony algorithm are shown in Table 4.Table 4
Experimental results of the improved ant colony algorithm.
Test setASACSMMASThis algorithmThe optimal solution is knownW2025.058024.566924.687724.566924.5669M4832158.61831486.84631425.64031414.14731115.085N306410.0676260.9326194.5826190.8656110.051H2254312.8394156.3724140.7794119.0304108.810Therefore, from the data in Table2, it can be concluded that this algorithm is superior to several other algorithms, that is, the improvement of the ant colony algorithm is effective.Table 5
Analysis table of the IOR supply positioning model for four types of agricultural products based on the improved ant colony algorithm.
Types of agricultural productsProcurement difficultyProcurement costsIOR levelPurchasing strategyCropperPotatoEasyLowLowTactical acquisitionFisherySea bassEasyHighLowTactical profitsAnimal husbandryHorseDifficultyHighHighStrategic keyOther productsMao teaDifficultyLowHighStrategic securityTable 6
Node coordinates and demand.
Node propertiesX coordinate (km)Y coordinate (km)Demand for goods (g)Supply chain center A1452150Customer node B1512641100Customer node C156261700Client node D130254800Customer node E1282521400Customer node F1632472100Customer node G146246400Customer node H161242800Customer node I142239100Client node J163236500Customer node K148232600Customer node L1282311200Customer node M1562171300Customer node N1292141300Customer node O146208300Customer node P164208900Client node Q1412062100Customer node R1471931000Customer node S164193900Customer node T1291892500Customer node U1551851800Customer node V139183700


## 3.1. Standard Ant Colony Algorithm

Assume more ants, study related problems, and then have them parallel. After each ant completes a journey, it releases pheromones during the journey, and the pheromone content is proportional to the quality of the solution [20]. Ant paths choose a random local search strategy based on the initial pheromone amount (provided the initial pheromone amount is equal) after considering the distance between two points. This improves the pheromone of the periphery and makes it easier to choose follow-up actions. Each ant can only take the legal route when all the ants run out to find them and they will start to have the autonomy to update all the pheromones. New ant colonies conduct new searches for updated pheromones that include alternatives to the original pheromones and improved their methods. If the predetermined steps are happening or stalling (all the ants have chosen the same path and the answer has not changed), then the algorithm succeeds, and the current best solution is considered the best solution to the problem. The flowchart of the ant colony algorithm is summarized in Figure 2. It looks like this:Figure 2
Flowchart of the ant colony algorithm.


## 3.2. Analyze the Supply Chain Path

The logistics characteristics of the intelligent supply chain of agricultural products include a variety of models, unfilled, multi-target, vehicle path problems, time windows, and other characteristics. VRP (VRPTW) with a time window is more suitable for the actual situation of intelligent supply chains for agricultural products [21]. The mathematical model of VRPTW is as follows:Objective function:(1)minΖ=∑i=0n∑j=0n∑k=1kCijXijk,represents its lowest cost.The actual cargo capacity of vehiclek is less than the vehicle’s limit cargo capacity:(2)∑j=1nqyjk≤D,K=1,2,…,K.For each vehicle departing from the supply center:(3)∑k=1kyok=K.The vehicle serves and completes the delivery of the designated user:(4)∑j=1kyjk=1,j=1,2,⋯,n.All vehicles complete the mission and return to the starting point:(5)∑i=1nXiok=1,K=1,2,⋯,K.The relationships between the variables are(6)∑i=0nXijk=yjk,j=1,2,⋯,n;k=1,2,⋯,K,∑j=0nXijk=yik,i=1,2,⋯,n;k=1,2,⋯,K.Equation (7) is the time window that satisfies the user’s requirements:(7)STi≤ti+wi≤ETi,i=1,2,⋯,n;k=1,2,⋯,K,Xijk=1,VehicleKstarts from merchantviand goes back to merchantvj,0,otherwise,,yjk=1,The task of merchantvjis completed by vehicleK,0,otherwise..Formula V represents vertex set;v1,v2,⋯,vn represent user;v0 represents intelligent supply chain supply center for agricultural products;E represents side set;K represents the total number of cars;Cij represents the cost of transportation from user to user, vivj;qi------------------vi;q represents the weight of what the vehicle can hold;STi,ETi represents the user’s time window, vi;STi represents the starting point of the delivery time of individual users;ETi represents the end of the delivery period for individual users;ti represents the vi time when the vehicle arrives at the user;wi represents the time that the vehicle vi stays in the user.


## 3.3. Improve the Ant Colony Algorithm

### 3.3.1. Ant Colony Systems

(1)
Set to a new constant; a random number is generated before antk chooses a path; and if the q0q0∈0,1qq0∈0,1 node of the current k is i, then k moves from node to node, following ij the PP formula; the PP formula is as follows:∗(8)PP=argmaxj∈ALkτijaηijβ,q≤q0,Pijk,q>q0..(2)
Global pheromone update for the shortest route is as the following formulas:(9)τij=1−p∗τijt−1+p∗Δτij,(10)Δτij=1Lbest,If the global optimal path includes pathi,j,0,Otherwise..In formula (9), p represents a pheromone evaporation parameter, pp∈0,1. In Equation (10), Δτij indicates that the pheromone of the current route(i,j) increases through the loop; Lbest indicates that the best global route is found, ΔτijLbest.(3)
In addition, local pheromones are also being upgraded and improved, and ants move from nodei to node j, and the route they pass, representing constants, refers to the concentration of pheromones on the initial path, adjustable. The formula is as follows: i,jτ0ξξ∈0,1,(11)τijt=1−ξ∗τijt−1+ξ∗t0.


### 3.3.2. Maximum and Minimum Ant Colony System

(1) Improvements to the Search Path of Individual Ants. Set O, P, Q, W, and N as the user address because the, is OW<DsOP<DSON<DsOQ>DSDs. O, P, Q, and W and N are the radius formed by the user’s address. O is the starting point, and then, the selectable end points are P, N, and W, and Q cannot be used as the end point. Then, the probability of choosing O point to P, W, N, and other points is inversely proportional to the distance, and the closer the distance, the easier it is to choose the next one, as shown in Figure 3, starting from O, P may be preferred as the next point.Figure 3
User-point selection strategy.Taking a one-day agricultural product order in a certain area as the sample data, the number of users is about 2270, the number of ants in the population is 26, and the number of iterations is 360. The sample data were performed 40 times, and the time and path length of the first 20 improvements and the last 20 improvements of the experiment were averaged, respectively. The results are shown in Table1.Table 1
Improved search comparison of stocks before and after.
Compare itemsMean time to complete (s)Draw path length (km)Before improvements1237.517681.6After improvements213.34218.8Hence, from Table1, we can see that the improved ant colony algorithm is converging at a faster rate.(2) Improve Pheromones. In order to get a better and better solution, add a penalty function to improve pheromone updates based on (delivery time) ti.Maximum time difference TM:(12)TM=ETi−STi×15%,where ETi is the end time and STi is the start time ETiSTiPenalty function formula:(13)PF=ti−STiTM+1,STi−TM<ti<STi,1,STi<ti<ETi,ti−ETiTM+1,ETi<ti<ETi+TM,,where STi is the starting point of the delivery time period in the intelligent supply chain center, ETi is the end point of the delivery time period in the intelligent supply chain center, and ti is the time at which the vehicle arrives at the user, vi.The purpose of the penalty function formula is to accelerate the convergence of the ant colony without affecting the optimization ability of the pheromone.Pheromone calculation formula:(14)τijnew¯=τij+ΔτijnewPF.It indicates that the longer it exceeds the window, the smaller the cumulative value of this path, the lower the chance of choosing it.(3) Improve the Selection Probability. The ant colony iteration is divided into three stages, and the calculation formula is distributed in different stages, the formula is as follows:(15)P=c1,0<ni<nj,c2,nj<ni<nk,c1,nk<ni<nmax,,where ni is the current iteration position, ni and nkare the number of iterations, and nmax is the maximum number of iterations. P is the probability, 0.8 << c1 1.0< < 0.4 c2. The larger the P value, the more the ants are acting on the same path, resulting in a very similar path; the optimal solution cannot be found; and the smaller the P value, the smaller the P value, indicating that the ants do not walk on one path but spread out to expand the walking range, but the disadvantage is that the convergence rate is slower.(4) Growth Mechanism. When the ant colony algorithm is applied to the intelligent supply chain architecture of agricultural products, it will be limited by the impact of intelligent supply chain logistics of agricultural products, and the calculation formula is as follows:(16)K=DQ,where D represents the total amount of agricultural goods waiting for distribution, Q is the load capacity of a single distribution vehicle in the intelligent supply chain center for agricultural products, K is the total number of theoretical distribution vehicles in the intelligent supply chain center of agricultural products. The flow of the improved ant colony algorithm is shown in Figure 4.Figure 4
Improved ant colony algorithm flowchart.(5) The Improved Ant Colony Algorithm Flow and the Algorithm Flow. (1)
Start:(1)
Read the set of orders to be issued, and get the basic information of the associated users, such as quantity, longitude and latitude. In the ant colony algorithm, user location is equated with city.(2)
Initializes the taboo access table (list of allowed nodes and list of accessed nodes).(3)
Calculate the ideal number of delivery vehicles (ant number).(4)
Calculate the maximum number of vehicles allowed.(5)
Set the global optimal vehicle load ratio, the global optimal single load ratio, and the default single load ratio.(2)
Loop iterations until the maximum number of iterations is reached:(1)
Initialize the basic parameters of this iteration.(2)
Start traversing addresses until you traverse all addresses.(a)
Select the next appropriate location in turn. Selection principle: The appropriate place is one of the sets of the next location that the ant’s current node can reach, and the amount of goods in that location is less than the remaining load of the ant. There may be multiple ants that meet the criteria. The roulette algorithm is used for selection. The more pheromones, the easier it is to choose.(b)
When the ant finds the next suitable place, update the relevant information of the ant, record the information of the place, increase the load of the ants, and mark the place as a place that has been visited.(c)
If no ants find the next place to visit in consecutive P times, add an ant and traverse the remainingm times where there is no visit.(3)
Iterate through all user locations and all ants reach their distribution destinations.(4)
Calculate objective function value:(a)
The total stroke of all ants is locally optimal.(b)
Calculate the total stroke of all ants.(c)
Determine whether it is the global optimal ant colony, and record the optimal ant colony and the shortest total distance.


### 3.3.3. Parallel Ant Colony Algorithm

Each colony uses a parallel algorithm to match their best solution. After the colony obtains the optimal solution, the other ants plot the resolution information on the receiver [22]. In the queue, regularly extract information from the queue, compare them with the most feasible local solutions, analyze the saved path information, and update the local information system. When the optimal path of other colonies deviates from the current colony path, other colonies are considered “filter paths” [23], as shown in Figure 5.Figure 5
Filter path schematic.As can be seen from Figure5, the colony has gone through the class A (A-B-C-D-E route). According to the best solutions and rules of other ant colonies, all pheromones on the road section are optimized for FB and DN roads to increase the possibility of choosing other roads. Then, the current information cable is updated as follows:(17)τi′=LnL0⋅τi,where τi′ is the pheromone value of the path for the current colony, τi is the pheromone value propagated by other ants on the road they are walking, Ln is the optimal solution of the filter path of the ant colony i corresponding to the sub-colony n, and L0 indicates the optimal solution for the current ant colony.The algorithm steps are shown in Figure6, and the algorithm steps are as follows:(1)
Initialize the system and generatex independent sub-ant colonies with the same basic information.(2)
X sub-colonies operate independently in parallel, and the number of iterations of each sub-colony isn, d = 0, C = 0. The specific steps are as follows:(1)
For sub-ant colonies I, the number of iterationsC = C + 1, each ant in the colony in turn enters the search path on the network and updates the pheromones. Record the optimal solution of the colony and the ants with the shortest path of the optimal ant (row).(2)
The number of iterations of sub-colony I satisfies the condition of dividingn by M = 0, and then the number of iterations is passed to the optimal ant information artificial intelligence (including its optimal path and attached pheromones) in other colony m-order operations.(3)
Repeat steps (1)-(2) untilC = n, exit the cycle, and wait for the other sub-colonies.(3)
At the same time, sub-colony I is responsible for receiving and processing the optimal colony spread by other sub-colonies, as follows:(1)
Write the optimal ant AK that receives the ant colony broadcast K to the ant queue Li.(2)
Take the earliest ant AK from the ant queue Li, calculate the differential path according to the calculation method, and update the pheromone matrix of sub-colony I.(3)
Repeat (1)-(2), repeatedly executed.(4)
After all sub-ant colonies completen iterations, the global optimal ant colony is output.(5)
End.Figure 6
Parallel ant colony algorithm flowchart.


### 3.3.4. Parallel Ant Colony Algorithm Experiment

The parallel ant colony algorithm was experimented with to test its performance, and the data set was selected TSPLIB [24]. Set parameters: a = 1, b = 2, c = 0.95, G = 3, 4, 5, 6, 7, and M = 250. The experimental data are shown in Tables 2 and 3.Table 2
Test question examples.
IssueNumber of citiesSolution time (s)A22922912.40B43943973.62C57557570.30D74272473.78Table 3
Experimental results of the parallel ant colony algorithm.
IssueIndex3 units4 sets5 units6 units7 units8 unitsA229Acceleration ratio0.870.920.950.960.980.98Efficiency0.440.400.250.200.150.13B439Acceleration ratio1.511.661.962.312.202.30Efficiency0.760.550.590.530.360.22C575Acceleration ratio1.571.892.232.573.003.01Efficiency0.790.700.540.530.400.33D742Acceleration ratio1.701.982.453.093.303.20Efficiency0.850.770.570.590.520.36The parallel ant colony algorithm is measured according to the acceleration ratio and efficiency as follows:(18)Sp=T1Tp.The above equation represents the acceleration ratio formula, whereTp is the parallel ant colony algorithm runtime and T1is the time it takes for a single machine to execute a serial algorithm.(19)Ep=SpP.The above equation represents the efficiency formula, whereP indicates how many hosts there are and Ep indicates the efficiency of running the algorithm.The acceleration of this algorithm is shown in Figure7.Figure 7
Parallel ant colony algorithm experiment acceleration ratio trend plot.The experimental results from Figure7 show the acceleration ratio and efficiency of the parallel ant colony test algorithm. The acceleration ratio is 0.97 at a minimum and 3.25 at its largest. Obviously, if the problem data increase, the progress will also be greatly improved. When the amount of problem data is greater, the parallel ant colony algorithm can be used, which can greatly shorten the time. Using the parallel ant colony algorithm suggested in this paper for a large number of problems, setting reasonable initialization parameters will help greatly improve better acceleration efficiency.


### 3.3.5. Improved Ant Colony Algorithm Experiments

The improved ant colony algorithm is experimental, the improved performance is tested, and the parametersa = 1, b = 2, and c = 0.95 are set, and the probability of each segment is C1 = 0.8 and C2 = 0.2, and the number of iterations is 250. The test sets are W20, M48, N30, and H225. The experimental results of the improved ant colony algorithm are shown in Table 4.Table 4
Experimental results of the improved ant colony algorithm.
Test setASACSMMASThis algorithmThe optimal solution is knownW2025.058024.566924.687724.566924.5669M4832158.61831486.84631425.64031414.14731115.085N306410.0676260.9326194.5826190.8656110.051H2254312.8394156.3724140.7794119.0304108.810Therefore, from the data in Table2, it can be concluded that this algorithm is superior to several other algorithms, that is, the improvement of the ant colony algorithm is effective.Table 5
Analysis table of the IOR supply positioning model for four types of agricultural products based on the improved ant colony algorithm.
Types of agricultural productsProcurement difficultyProcurement costsIOR levelPurchasing strategyCropperPotatoEasyLowLowTactical acquisitionFisherySea bassEasyHighLowTactical profitsAnimal husbandryHorseDifficultyHighHighStrategic keyOther productsMao teaDifficultyLowHighStrategic securityTable 6
Node coordinates and demand.
Node propertiesX coordinate (km)Y coordinate (km)Demand for goods (g)Supply chain center A1452150Customer node B1512641100Customer node C156261700Client node D130254800Customer node E1282521400Customer node F1632472100Customer node G146246400Customer node H161242800Customer node I142239100Client node J163236500Customer node K148232600Customer node L1282311200Customer node M1562171300Customer node N1292141300Customer node O146208300Customer node P164208900Client node Q1412062100Customer node R1471931000Customer node S164193900Customer node T1291892500Customer node U1551851800Customer node V139183700


## 3.3.1. Ant Colony Systems

(1)
Set to a new constant; a random number is generated before antk chooses a path; and if the q0q0∈0,1qq0∈0,1 node of the current k is i, then k moves from node to node, following ij the PP formula; the PP formula is as follows:∗(8)PP=argmaxj∈ALkτijaηijβ,q≤q0,Pijk,q>q0..(2)
Global pheromone update for the shortest route is as the following formulas:(9)τij=1−p∗τijt−1+p∗Δτij,(10)Δτij=1Lbest,If the global optimal path includes pathi,j,0,Otherwise..In formula (9), p represents a pheromone evaporation parameter, pp∈0,1. In Equation (10), Δτij indicates that the pheromone of the current route(i,j) increases through the loop; Lbest indicates that the best global route is found, ΔτijLbest.(3)
In addition, local pheromones are also being upgraded and improved, and ants move from nodei to node j, and the route they pass, representing constants, refers to the concentration of pheromones on the initial path, adjustable. The formula is as follows: i,jτ0ξξ∈0,1,(11)τijt=1−ξ∗τijt−1+ξ∗t0.


## 3.3.2. Maximum and Minimum Ant Colony System

(1) Improvements to the Search Path of Individual Ants. Set O, P, Q, W, and N as the user address because the, is OW<DsOP<DSON<DsOQ>DSDs. O, P, Q, and W and N are the radius formed by the user’s address. O is the starting point, and then, the selectable end points are P, N, and W, and Q cannot be used as the end point. Then, the probability of choosing O point to P, W, N, and other points is inversely proportional to the distance, and the closer the distance, the easier it is to choose the next one, as shown in Figure 3, starting from O, P may be preferred as the next point.Figure 3
User-point selection strategy.Taking a one-day agricultural product order in a certain area as the sample data, the number of users is about 2270, the number of ants in the population is 26, and the number of iterations is 360. The sample data were performed 40 times, and the time and path length of the first 20 improvements and the last 20 improvements of the experiment were averaged, respectively. The results are shown in Table1.Table 1
Improved search comparison of stocks before and after.
Compare itemsMean time to complete (s)Draw path length (km)Before improvements1237.517681.6After improvements213.34218.8Hence, from Table1, we can see that the improved ant colony algorithm is converging at a faster rate.(2) Improve Pheromones. In order to get a better and better solution, add a penalty function to improve pheromone updates based on (delivery time) ti.Maximum time difference TM:(12)TM=ETi−STi×15%,where ETi is the end time and STi is the start time ETiSTiPenalty function formula:(13)PF=ti−STiTM+1,STi−TM<ti<STi,1,STi<ti<ETi,ti−ETiTM+1,ETi<ti<ETi+TM,,where STi is the starting point of the delivery time period in the intelligent supply chain center, ETi is the end point of the delivery time period in the intelligent supply chain center, and ti is the time at which the vehicle arrives at the user, vi.The purpose of the penalty function formula is to accelerate the convergence of the ant colony without affecting the optimization ability of the pheromone.Pheromone calculation formula:(14)τijnew¯=τij+ΔτijnewPF.It indicates that the longer it exceeds the window, the smaller the cumulative value of this path, the lower the chance of choosing it.(3) Improve the Selection Probability. The ant colony iteration is divided into three stages, and the calculation formula is distributed in different stages, the formula is as follows:(15)P=c1,0<ni<nj,c2,nj<ni<nk,c1,nk<ni<nmax,,where ni is the current iteration position, ni and nkare the number of iterations, and nmax is the maximum number of iterations. P is the probability, 0.8 << c1 1.0< < 0.4 c2. The larger the P value, the more the ants are acting on the same path, resulting in a very similar path; the optimal solution cannot be found; and the smaller the P value, the smaller the P value, indicating that the ants do not walk on one path but spread out to expand the walking range, but the disadvantage is that the convergence rate is slower.(4) Growth Mechanism. When the ant colony algorithm is applied to the intelligent supply chain architecture of agricultural products, it will be limited by the impact of intelligent supply chain logistics of agricultural products, and the calculation formula is as follows:(16)K=DQ,where D represents the total amount of agricultural goods waiting for distribution, Q is the load capacity of a single distribution vehicle in the intelligent supply chain center for agricultural products, K is the total number of theoretical distribution vehicles in the intelligent supply chain center of agricultural products. The flow of the improved ant colony algorithm is shown in Figure 4.Figure 4
Improved ant colony algorithm flowchart.(5) The Improved Ant Colony Algorithm Flow and the Algorithm Flow. (1)
Start:(1)
Read the set of orders to be issued, and get the basic information of the associated users, such as quantity, longitude and latitude. In the ant colony algorithm, user location is equated with city.(2)
Initializes the taboo access table (list of allowed nodes and list of accessed nodes).(3)
Calculate the ideal number of delivery vehicles (ant number).(4)
Calculate the maximum number of vehicles allowed.(5)
Set the global optimal vehicle load ratio, the global optimal single load ratio, and the default single load ratio.(2)
Loop iterations until the maximum number of iterations is reached:(1)
Initialize the basic parameters of this iteration.(2)
Start traversing addresses until you traverse all addresses.(a)
Select the next appropriate location in turn. Selection principle: The appropriate place is one of the sets of the next location that the ant’s current node can reach, and the amount of goods in that location is less than the remaining load of the ant. There may be multiple ants that meet the criteria. The roulette algorithm is used for selection. The more pheromones, the easier it is to choose.(b)
When the ant finds the next suitable place, update the relevant information of the ant, record the information of the place, increase the load of the ants, and mark the place as a place that has been visited.(c)
If no ants find the next place to visit in consecutive P times, add an ant and traverse the remainingm times where there is no visit.(3)
Iterate through all user locations and all ants reach their distribution destinations.(4)
Calculate objective function value:(a)
The total stroke of all ants is locally optimal.(b)
Calculate the total stroke of all ants.(c)
Determine whether it is the global optimal ant colony, and record the optimal ant colony and the shortest total distance.


## 3.3.3. Parallel Ant Colony Algorithm

Each colony uses a parallel algorithm to match their best solution. After the colony obtains the optimal solution, the other ants plot the resolution information on the receiver [22]. In the queue, regularly extract information from the queue, compare them with the most feasible local solutions, analyze the saved path information, and update the local information system. When the optimal path of other colonies deviates from the current colony path, other colonies are considered “filter paths” [23], as shown in Figure 5.Figure 5
Filter path schematic.As can be seen from Figure5, the colony has gone through the class A (A-B-C-D-E route). According to the best solutions and rules of other ant colonies, all pheromones on the road section are optimized for FB and DN roads to increase the possibility of choosing other roads. Then, the current information cable is updated as follows:(17)τi′=LnL0⋅τi,where τi′ is the pheromone value of the path for the current colony, τi is the pheromone value propagated by other ants on the road they are walking, Ln is the optimal solution of the filter path of the ant colony i corresponding to the sub-colony n, and L0 indicates the optimal solution for the current ant colony.The algorithm steps are shown in Figure6, and the algorithm steps are as follows:(1)
Initialize the system and generatex independent sub-ant colonies with the same basic information.(2)
X sub-colonies operate independently in parallel, and the number of iterations of each sub-colony isn, d = 0, C = 0. The specific steps are as follows:(1)
For sub-ant colonies I, the number of iterationsC = C + 1, each ant in the colony in turn enters the search path on the network and updates the pheromones. Record the optimal solution of the colony and the ants with the shortest path of the optimal ant (row).(2)
The number of iterations of sub-colony I satisfies the condition of dividingn by M = 0, and then the number of iterations is passed to the optimal ant information artificial intelligence (including its optimal path and attached pheromones) in other colony m-order operations.(3)
Repeat steps (1)-(2) untilC = n, exit the cycle, and wait for the other sub-colonies.(3)
At the same time, sub-colony I is responsible for receiving and processing the optimal colony spread by other sub-colonies, as follows:(1)
Write the optimal ant AK that receives the ant colony broadcast K to the ant queue Li.(2)
Take the earliest ant AK from the ant queue Li, calculate the differential path according to the calculation method, and update the pheromone matrix of sub-colony I.(3)
Repeat (1)-(2), repeatedly executed.(4)
After all sub-ant colonies completen iterations, the global optimal ant colony is output.(5)
End.Figure 6
Parallel ant colony algorithm flowchart.


## 3.3.4. Parallel Ant Colony Algorithm Experiment

The parallel ant colony algorithm was experimented with to test its performance, and the data set was selected TSPLIB [24]. Set parameters: a = 1, b = 2, c = 0.95, G = 3, 4, 5, 6, 7, and M = 250. The experimental data are shown in Tables 2 and 3.Table 2
Test question examples.
IssueNumber of citiesSolution time (s)A22922912.40B43943973.62C57557570.30D74272473.78Table 3
Experimental results of the parallel ant colony algorithm.
IssueIndex3 units4 sets5 units6 units7 units8 unitsA229Acceleration ratio0.870.920.950.960.980.98Efficiency0.440.400.250.200.150.13B439Acceleration ratio1.511.661.962.312.202.30Efficiency0.760.550.590.530.360.22C575Acceleration ratio1.571.892.232.573.003.01Efficiency0.790.700.540.530.400.33D742Acceleration ratio1.701.982.453.093.303.20Efficiency0.850.770.570.590.520.36The parallel ant colony algorithm is measured according to the acceleration ratio and efficiency as follows:(18)Sp=T1Tp.The above equation represents the acceleration ratio formula, whereTp is the parallel ant colony algorithm runtime and T1is the time it takes for a single machine to execute a serial algorithm.(19)Ep=SpP.The above equation represents the efficiency formula, whereP indicates how many hosts there are and Ep indicates the efficiency of running the algorithm.The acceleration of this algorithm is shown in Figure7.Figure 7
Parallel ant colony algorithm experiment acceleration ratio trend plot.The experimental results from Figure7 show the acceleration ratio and efficiency of the parallel ant colony test algorithm. The acceleration ratio is 0.97 at a minimum and 3.25 at its largest. Obviously, if the problem data increase, the progress will also be greatly improved. When the amount of problem data is greater, the parallel ant colony algorithm can be used, which can greatly shorten the time. Using the parallel ant colony algorithm suggested in this paper for a large number of problems, setting reasonable initialization parameters will help greatly improve better acceleration efficiency.


## 3.3.5. Improved Ant Colony Algorithm Experiments

The improved ant colony algorithm is experimental, the improved performance is tested, and the parametersa = 1, b = 2, and c = 0.95 are set, and the probability of each segment is C1 = 0.8 and C2 = 0.2, and the number of iterations is 250. The test sets are W20, M48, N30, and H225. The experimental results of the improved ant colony algorithm are shown in Table 4.Table 4
Experimental results of the improved ant colony algorithm.
Test setASACSMMASThis algorithmThe optimal solution is knownW2025.058024.566924.687724.566924.5669M4832158.61831486.84631425.64031414.14731115.085N306410.0676260.9326194.5826190.8656110.051H2254312.8394156.3724140.7794119.0304108.810Therefore, from the data in Table2, it can be concluded that this algorithm is superior to several other algorithms, that is, the improvement of the ant colony algorithm is effective.Table 5
Analysis table of the IOR supply positioning model for four types of agricultural products based on the improved ant colony algorithm.
Types of agricultural productsProcurement difficultyProcurement costsIOR levelPurchasing strategyCropperPotatoEasyLowLowTactical acquisitionFisherySea bassEasyHighLowTactical profitsAnimal husbandryHorseDifficultyHighHighStrategic keyOther productsMao teaDifficultyLowHighStrategic securityTable 6
Node coordinates and demand.
Node propertiesX coordinate (km)Y coordinate (km)Demand for goods (g)Supply chain center A1452150Customer node B1512641100Customer node C156261700Client node D130254800Customer node E1282521400Customer node F1632472100Customer node G146246400Customer node H161242800Customer node I142239100Client node J163236500Customer node K148232600Customer node L1282311200Customer node M1562171300Customer node N1292141300Customer node O146208300Customer node P164208900Client node Q1412062100Customer node R1471931000Customer node S164193900Customer node T1291892500Customer node U1551851800Customer node V139183700


## 4. Case Studies

### 4.1. Study Design

(1)
The intelligent supply chain center purchases the procurement strategy and tactics of agricultural products according to the improved ant colony algorithm to improve the competitive advantage of the market, and the details of its procurement strategy are as follows:From Table5, it can be obtained that the procurement difficulty and IOR are low, and the supply chain tactics can be used to purchase, and as shown in Table 6, the supply chain strategy can be used to maximize profits.(2)
According to Table5, an experimental agricultural product intelligent supply chain center distributes goods to 21 customers, known customer locations and the demand for goods; there are 4 identical transport vehicles in the agricultural product intelligent supply chain center; and the supply chain center is set up as node 1. The relationship between them is shown below.


### 4.2. Data Analysis and Processing

The experiment was solved by using the improved ant colony algorithm, and the parametersa = 2.0 (a represents the degree of attention of the pheromones left on each path), b = 5.0 (representing visibility, guiding the importance of the path in the process of ant selection and optimization), and c = 0.2 (refers to the degree coefficient of pheromone volatilization), W = 100 = 200 NCMAX (the maximum number of iterations), the number of ant ants y = 15, the total number of vehicles K = 4, the number of customer nodes T = 21, and supply chain center is node 1. The results obtained are shown in Table 7.Table 7
Records of the results of 10 consecutive searches after several consecutive searches.
Number of searchesBefore improvementsAfter improvementsOptimal path length (km)Look for time (s)Optimal path length (km)Look for time (s)1403.83118.27397.9718.2232398.3019.42398.3018.493421.5118.15421.5118.284380.9422.32380.9418.025386.8518.29386.8517.746393.7026.17393.7017.887432.12222.44432.1217.948386.8518.29393.7017.889393.6722.21411.1918.7410396.8718.26396.8718.10From Table6, it can be seen that the shortest path searched before and after the improved ant colony algorithm is basically the same, but there are differences in time. There is not much difference between the length obtained before and after the improved ant colony algorithm shown in Figure 8, but the optimal path obtained by searching for the improved ant colony algorithm is relatively stable to 380.94 km before the improvement.Figure 8
Compares the results before and after ten consecutive runs to improve.


### 4.3. Data Results

The best solution according to the improved ant colony algorithm is to distribute the goods in four vehicles, with a total distance of 380.94 km (the optimal path obtained from Figure8). Figures 9 and 10 are shown below.Figure 9
Results of the distribution route optimization problem.Figure 10
Average distance and minimum distance.Figures9 and 10 show the optimal result graph obtained after improving the pheromone exertion coefficient in the improved ant colony algorithm. That is, the optimal route for delivering goods by four vehicles available in Figures 9 and 10 is A-K-I-G-D-E-L-N-A, A-M-P-S-U-Q-A, A-O-Q-T-V-A, and A-H-F-C-B-J-A.


## 4.1. Study Design

(1)
The intelligent supply chain center purchases the procurement strategy and tactics of agricultural products according to the improved ant colony algorithm to improve the competitive advantage of the market, and the details of its procurement strategy are as follows:From Table5, it can be obtained that the procurement difficulty and IOR are low, and the supply chain tactics can be used to purchase, and as shown in Table 6, the supply chain strategy can be used to maximize profits.(2)
According to Table5, an experimental agricultural product intelligent supply chain center distributes goods to 21 customers, known customer locations and the demand for goods; there are 4 identical transport vehicles in the agricultural product intelligent supply chain center; and the supply chain center is set up as node 1. The relationship between them is shown below.


## 4.2. Data Analysis and Processing

The experiment was solved by using the improved ant colony algorithm, and the parametersa = 2.0 (a represents the degree of attention of the pheromones left on each path), b = 5.0 (representing visibility, guiding the importance of the path in the process of ant selection and optimization), and c = 0.2 (refers to the degree coefficient of pheromone volatilization), W = 100 = 200 NCMAX (the maximum number of iterations), the number of ant ants y = 15, the total number of vehicles K = 4, the number of customer nodes T = 21, and supply chain center is node 1. The results obtained are shown in Table 7.Table 7
Records of the results of 10 consecutive searches after several consecutive searches.
Number of searchesBefore improvementsAfter improvementsOptimal path length (km)Look for time (s)Optimal path length (km)Look for time (s)1403.83118.27397.9718.2232398.3019.42398.3018.493421.5118.15421.5118.284380.9422.32380.9418.025386.8518.29386.8517.746393.7026.17393.7017.887432.12222.44432.1217.948386.8518.29393.7017.889393.6722.21411.1918.7410396.8718.26396.8718.10From Table6, it can be seen that the shortest path searched before and after the improved ant colony algorithm is basically the same, but there are differences in time. There is not much difference between the length obtained before and after the improved ant colony algorithm shown in Figure 8, but the optimal path obtained by searching for the improved ant colony algorithm is relatively stable to 380.94 km before the improvement.Figure 8
Compares the results before and after ten consecutive runs to improve.


## 4.3. Data Results

The best solution according to the improved ant colony algorithm is to distribute the goods in four vehicles, with a total distance of 380.94 km (the optimal path obtained from Figure8). Figures 9 and 10 are shown below.Figure 9
Results of the distribution route optimization problem.Figure 10
Average distance and minimum distance.Figures9 and 10 show the optimal result graph obtained after improving the pheromone exertion coefficient in the improved ant colony algorithm. That is, the optimal route for delivering goods by four vehicles available in Figures 9 and 10 is A-K-I-G-D-E-L-N-A, A-M-P-S-U-Q-A, A-O-Q-T-V-A, and A-H-F-C-B-J-A.


## 5. Conclusion

This paper is based on the research on the intelligent supply chain architecture of agricultural products based on the improvement of the ant colony algorithm, through the upgrading and improvement of the global pheromone of the ant colony system, the improvement of the path analysis and research of the largest and smallest ant colony system, and the improvement of the filtering algorithm for the selection of the path that is not the optimal path in the parallel ant colony algorithm, and finally the experiment is carried out on the entire intelligent supply chain architecture after the overall improvement of the ant colony algorithm, and the experiment starts from the procurement of agricultural products in the intelligent supply chain center (source) to screen various agricultural products in digital form. Through the use of the improved ant colony algorithm intelligent supply chain system, the cost, sales, logistics, and other aspects of the purchased agricultural products are analyzed and decided, and the optimal procurement method and optimal logistics and transportation path are obtained. It can be concluded that the improvement of the ant colony algorithm for the intelligent supply chain of agricultural products is feasible, whether it is from the procurement of agricultural products to derive the optimal procurement scheme, or in the supply chain warehouse for intelligent delivery and receipt of goods for the supply chain center to save costs; especially, in the delivery and distribution link, the optimization of the logistics path not only reduces the mileage, but also further reduces the cost, greatly improving the delivery efficiency. Although this paper has achieved some results in the study of the intelligent supply chain based on the improved ant colony algorithm, we can also combine the following aspects to conduct deeper research and application:(1)
Combine with big data technology to improve the comprehensive management capability of the intelligent supply chain of agricultural products.(2)
Use the dynamic capability perspective to make full use of the resources embodied in the structure of the intelligent supply chain of agricultural products and integrate and upgrade the intelligent supply chain architecture of agricultural products.



---

*Source: 5643304-2022-08-30.xml*