Optimal path selection of multimodal transport based on Ant Colony Algorithm

In the process of multimodal transport, the cost and time of transportation are particularly important. In order to avoid unreasonable container transportation and unnecessary waste of transportation capacity and transportation cost, we must effectively integrate the advantages of various transportation modes, select the most suitable transportation mode and the most reasonable transportation path, and take the minimum cost and time as the goal to ensure the smooth transportation of goods to the destination. Therefore, optimizing multimodal transport network has very important practical significance. This paper starts with the multimodal transport network under a single task, designs the solution method of the model combined with ant colony algorithm, and gives an example. Finally, the model and algorithm design are proved to be reasonable by using MATLAB solution algorithm.


Introduction
The purpose of multimodal transport is to provide economic, reasonable, fast, safe and convenient transportation services for shippers. The choice of multimodal transport route is directly related to the quality, cost, time and transportation of goods and services, which can meet the most critical factors of multimodal transport operators or shippers. Comprehensively considering various factors, the multimodal transport operator of cargo transportation selects the most appropriate route, and the enterprise can win the trust of the boss, such as improving the income of the enterprise. Therefore, it is of great significance to complete the selection of multimodal transport route.
Based on the logistics city node, this paper comprehensively studies the construction and selection of port logistics city nodes, mainly based on the improved ant colony algorithm to find the best combination of port logistics city nodes and solve the problem of finding the best city node, which can also make the logistics nodes independent and integrate the market, so as to reduce the service cost, It can also combine demand and supply to give play to its own advantages, and on the whole, it can also find the best multimodal transport line.
The main computer tool used in this paper is artificial intelligence algorithm ant colony search algorithm. Although ant colony algorithm is not long in the long history of human research, its proposal can easily solve many system optimization problems, especially in discrete combinatorial optimization problems, ant colony algorithm shows far more advantages than other algorithms, with the increasing

Introduction to the principle of ant colony algorithm
The initial structure model of ant colony algorithm was proposed by M. Dorigo in 1994, and the algorithm is applied to solve the classical TSP problem perfectly. Ant colony algorithm is used in this paper because ant colony algorithm has good compatibility and modifiability. Compared with genetic algorithm, tabu algorithm has obvious advantages. Especially in solving the optimal path selection problem, the quality of the results of the improved ant colony algorithm is obviously better than other algorithms.
Moreover, ant colony algorithm has the advantages of distributed computing, self-organization and positive feedback, so it is used in different fields as a tool for problem solving. The following describes the basic ant colony algorithm with the classical traveling salesman problem: the basic ant colony algorithm can be expressed as follows: at the initial moment of the algorithm, m ant is randomly placed in n city, and at the same time, Set the first element of each ant's taboo table tabu as its current city.
At this time, the amount of pheromones on each path is equal, and τ (a small constant) is set. Next, each ant independently selects the next city according to the amount of pheromones remaining on the path and heuristic information (the distance between two cities) [1]. At time t , the probability ( ) t p k ij of ant k transferring from city i to city j is: represents the set of cities that ants k are allowed to select in the next step. The taboo table k tabu records the cities that ants k currently walk through. When all n cities are added to the taboo list k tabu , the ant k completes a tour. At this time, the path traveled by the ant k is a feasible solution to the TSP problem. ij η in equation (1) is a heuristic factor, which represents the expected degree of ants moving from city i to city j . In ant colony algorithm, ij η usually takes the reciprocal of the distance between city i and city j . alpha \ and beta \ represent the relative importance of pheromones and expected heuristic factors, respectively [2]. When all ants complete a round trip, the pheromone on each path is updated according to equation (2): Where Q is the normal number and k L represents the length of the path traveled by the k ant in this tour. When the path length DIJ constructed by ants is smaller, each edge of the path will get more pheromones, and it is more likely to be selected by other ants in future iterations. Every time the ant completes a cycle, it clears the taboo list and returns to the original city for the next tour.
In addition, the difference between the global path and the theoretical optimal path can be reduced by updating and improving pheromone rules and heuristic functions. , clear the record table of ant path, and return to step 2; Otherwise, the calculation is terminated and the optimal solution is output [4]. When choosing the path, ants not only use the pheromone on the path, but also use the reciprocal of the distance between cities as the heuristic factor. Next, we build relevant models and algorithms for multimodal transport.

Mathematical model design of multimodal transport
Suppose that a batch of goods are transported from the starting point to a series of urban nodes and arrive at the destination, and there is no traffic path between cities in the same stage and non adjacent stages. There is at least one alternative transportation mode between any two adjacent transportation stages. When different transportation modes are selected between cities, due to the different characteristics of each transportation mode, the transportation time and freight change with time. If the transportation is changed from waterway transportation to railway transportation, a certain conversion time and cost are required, and so on. On the premise of considering the above factors, the optimal transportation route is established to minimize the total cost. Therefore, the goal of this multimodal transport is to select an optimal multimodal transport route and mode under the condition of considering the transit cost and transit time, and minimize the total transport cost and total transport time.
Simple task: it is assumed that from Osaka, Japan to Chengdu, China, it passes through Shanghai, Nanjing, Xiangyang and Chongqing, and finally reaches Chengdu. Except that water transportation must be selected from Osaka to Shanghai, other lines can be selected between water, highway and railway. The network diagram of transportation mode is as follows:

Fig. 2 transportation network diagram under simple task
In the figure, SH-W refers to water transportation in Shanghai, SH-R refers to road transportation in Shanghai, SH-T refers to railway transportation in Shanghai, and so on.
Many enterprises are involved in the multimodal transport logistics service supply chain. In order to more intuitively reflect the advantages of different routes, this paper mainly considers the following factors as the evaluation index of the multimodal transport logistics service supply chain. This index is mainly divided from the aspects of transportation cost, transportation time, reloading cost and reloading time. After introducing the algorithm design, We will use matlab to simulate simple tasks and get the results.

Design of ant colony algorithm for multimodal transport
Introducing ants, the total number of ants is m, and the number of ants is less than the sum of the number of all alternative logistics node cities, i.e.

( )
indicates the quantity of pheromones on the path connected by the logistics node city at position ij and the logistics node city at position pq at time t . It is stipulated that p i = +1 , that is, the ants in the upper logistics node city can only move to the lower logistics node city, and can not move beyond the level. 0 = t at any time, the amount of pheromone on all paths is equal, which is recorded as 0 τ . In most cases, it is considered that the amount of pheromone is 0, that is, when there is , m ants are randomly placed in all logistics node cities, Only one ant can be placed in the city location of each logistics node, and then m ants placed randomly start looking for partners. When all tasks in task demand set Z are traversed, end the cycle and get a route. During the movement of ants, ants will take the pheromone concentration among logistics enterprises as a weight to select the next logistics node city. As a partner, Where β α， is the exponential weight coefficient, α represents the pheromone accumulation factor, β represents the expected factor of the connection cost, is called greedy heuristic, that is, only the connection cost factor is considered. When 0 1 = = β α ， is used, only the pheromone is considered. Because there is a volatilization phenomenon of the pheromone on the path, we will ρ represent the pheromone residue factor [5], which is natural, ρ determination of the parameters is determined by experimental method, However, due to some inherent shortcomings of ant colony algorithm, ants are prone to local optimization and premature convergence in the search process, which will make the algorithm in a dead cycle state and is not conducive to finding the optimal solution. Therefore, we make some improvements to ant colony algorithm. In order to prevent premature convergence, we disturb the pheromone accumulation factor, Introduce a disturbance factor h 9 . 0 = R , so that the local optimal cycle can be ended as soon as possible [6]. Then the adjustment of transfer probability between enterprises is as follows: The following are the model solving steps: , NC is the number of iterations, and m ants without repetition are randomly placed in the logistics city.
 the L ant carries its own task number l Z search forward and backward respectively. In the process of solving the task, select different transportation modes of the logistics city until all the task numbers are traversed, and stop traversing to form an optimal route.  pheromone update: calculate and update the pheromone value on each side of the global according to equations (6)-(7).
 carry out the next cycle, pheromone disturbance factor is added to prevent falling into local optimization cycle until the optimal solution is obtained. According to the above algorithm and model, the simple task is calculated by MATLAB. Assuming that the transportation cost and transportation time are the basic data in Chapter 4, the results are as follows:

Fig. 3 optimization convergence diagram under single task
From the program operation results, it is obvious that the ants make a sequential choice from Osaka, Japan, through Shanghai, Nanjing, Xiangyang and Chongqing, and finally to Chengdu. The result is that starting from Osaka, the water transportation mode is selected to arrive in Shanghai, and then arrive in Nanjing through water transportation. The railway transportation mode is selected from Nanjing to Xiangyang, and the road transportation mode is adopted from Xiangyang to Chongqing, Finally, the highway transportation mode is selected from Chongqing to Chengdu.
Such a combination can achieve the answer closest to the optimal solution, so that all the indicators of the optimal route can reach the optimum. As can be seen from Figure3, the objective function value of the route of the algorithm decreases rapidly before 15 iterations, indicating that the calculation convergence speed of the algorithm is very fast, and the objective function value of the alliance basically tends to be stable after 15-30 iterations.

Case Analysis
It is assumed that a batch of goods with a weight of 250 tons and a unit price of 1000 yuan / ton will be transported from Osaka, Japan to Chengdu. There are many modes of transportation between cities. Since the goods in this case are not suitable for air transportation, only three modes of transportation: highway, railway and waterway can be selected. If it is transported from Osaka, Japan to Chengdu, China, the possible urban nodes on the way are Osaka, Shanghai, Nanjing, Xiangyang, Chongqing, Suzhou, Xi'an, Hanzhong and Chengdu. In order to analyze and describe the problem more intuitively, a transportation network diagram of the possible transportation path of the scheme is constructed. And for the convenience of calculation, the urban nodes passed during each transportation are labeled. The starting point in Osaka is 0 and the ending point in Chengdu is 8. It is worth noting that the network diagram is relatively simple because different cities are transported by direct connection. In the actual transportation process, there are three different modes of transportation between different cities except for water transportation from Osaka to Shanghai. Therefore, it can be said that it is a relatively complex transportation network.   Among them, the shipping data comes from the shipping mileage query of the shipping online network, which can directly query the transportation mileage between any port in the world, the train freight data comes from the passenger service website of the Ministry of railways, and the highway mileage is queried through some highway mileage websites on the network. The transportation time between them can be queried directly. For example, the train time can be queried directly through the train freight timetable. If there is no direct data, the transportation time can be obtained by dividing the actual distance between each node city by the average transportation speed of each transportation mode. According to the query of relevant literature at home and abroad, the data of relevant transportation cost, replacement cost and time are obtained, which are highway railway 1000 yuan / hour, Highway Waterway 1700 yuan / hour, railway waterway 1000 yuan / hour, and vice versa. Moreover, we calculate that the unit transportation costs of different transportation modes are different. As shown in the table below, the transportation costs of corresponding routes can be easily calculated according to the product of different unit costs and distances.

Table 2. Unit transportation cost of different transportation modes
According to the model established in the previous chapter, considering multiple factors, multiple transportation modes, multiple routes and time constraints, it is difficult to calculate the problem directly by using common methods. Therefore, the intelligent optimization algorithm is considered to solve the model, and the final path of the transportation scheme, the optimal selection scheme and the minimum cost under the optimal selection scheme are solved with the help of MATLAB. When the fitness value is used as the reference standard for random search of the population, the greater the fitness value is required, the greater the probability that an individual will be selected to inherit to the next generation. In this paper, the fitness function is regarded as the original function. Selection operation is a step to determine the probability of an individual being selected from the parent population and genetic evolution. It is divided into two stages: one is to calculate the fitness value of a single individual according to the fitness function, and the other is to select chromosomes with certain methods and rules. This paper selects the roulette selection method. Taking proportional selection as the strategy, according to the chromosome fitness value and random selection probability, the roulette is divided by the value of chromosome fitness function. The selection probability is determined by the area of each chromosome on the roulette, and then randomly selected points on the roulette, and the corresponding chromosome is selected for inheritance in the next generation. Through MATLAB programming, the transportation time, total cost and optimal route selection are as follows:  Fig. 7 optimal convergence diagram of the first route Obviously, tasks 1 and 2 to be performed have different task requirements, and the cost and time required to complete the task are also different. At the same time, looking at the iterative convergence diagram, we can see that the ant can basically stabilize and obtain the optimal solution by performing 10-15 cyclic iterations in the optimization process. By comparing the optimization convergence diagrams of tasks 1 and 2, it can be found that in the most basic model without considering other factors, only the transportation cost and transit cost, the total cost is 6779.2 yuan and the transportation time is 66 hours. The route selection scheme starts from Osaka, selects the waterway transportation mode to arrive in Shanghai, and then arrives in Nanjing by waterway transportation, Water transportation is used from Nanjing to Xiangyang, railway transportation is used from Xiangyang to Chongqing, and finally road transportation is used from Chongqing to Chengdu.
In the most original model, because the cost caused by time factor is not considered, the nodes with waterway transportation are generally considered in the choice of route. The characteristic of waterway transportation is that the transportation cost is low, so waterway transportation is the primary consideration in the choice of transportation route. After considering the time penalty caused by delayed delivery, the number of nodes choosing waterway transportation is reduced, and the number of options for railway transportation is increased. Because waterway transportation has low cost and long timeconsuming, railway transportation has faster speed, and the cost is lower than highway transportation. Therefore, on the premise of no delay in delivery, the scheme is selected by combining the advantages of the two. At the same time, considering the penalty cost caused by late arrival and the inventory cost caused by early arrival, the goods are required to arrive on time within the specified time. Therefore, the combination of waterway and highway is selected to make the goods delivered on time. Finally, after considering the loss cost of goods and other factors, the selected transportation route is different from the loss cost not considered. Because of the high loss rate of goods in road transportation, water transportation and railway transportation with low loss rate of goods are preferred.