Intelligent algorithms of construction of public transport routes

. Today, in public transport planning systems, it is relevant to a search for a possible route with a minimum time. The aim of the work is the development of intelligent algorithms for constructing public transport routes, the development of programs, and the conduct of a computational experiment. Research methods are the theory of neural networks. The paper considers Hopfield neural networks and proposed recurrent neural networks. However, in Hopfield neural networks, the chances of solving this optimization problem decrease as the matrix size increases. A recurrent neural network is proposed, represented by a differential equation to solve this problem. As a result, the number of iterative computations can be reduced by 2 n times than in the Hopfield network.


Introduction
Algorithms for finding the shortest path are used to build public transport routes.For those who want to use public transport, many online services help plan the route.However, the problem is a bit more complicated because the routes have to be short; for example, the next train cannot arrive at the station before the departure of the current train [1][2][3][4][5][6][7].Besides, there may be several mandatory criteria.A short train/air transfer can be very important in reducing the overall travel time.Price may also be taken into account.In airline companies, sites such as http://orbitz.com or http://expedia.comgivea long list of possible routes for users.
There are more sophisticated train journey planning tools in Europe, such as the HAFAS planning system.One of these approaches is that a network that expands over time can be wide.An alternative approach is to define a "time-dependent" model in which one node is available for each station [1].If a modified version of Dijkstra's algorithm finds the optimum path between two stations, the first problem that comes to mind is whether it can calculate the shortest path from one node to another.For example, the time-based approach can be used to combine the modified Dijkstra algorithm with the A* search algorithm and use the Nachtigal algorithm [2], which calculates the shortest path between nodes, and computes results for the German railways, consisting of 26 routes and 37 stations.
Pyrga et al. [3] studied a two-criteria version of time-varying approaches to minimize transport time and the number of transfers.Their largest examples were networks with over 30,000 ends and 90,000 edges for a time-dependent approach.
According to the analysis, the development of hardware, computing tools, and software to solve the problem of traffic regulation is growing.At the same time, the number of addresses, ends, and edges of traffic is growing rapidly, moving from one parameter to more parameters and from static parameters to dynamic ones [4][5][6][7].
The study presents an analytical table of the level of complexity of algorithms for solving problems of finding the shortest path by static parameters (Table 1).The concepts of choosing a route and the shortest path are very close to each other, and the problem needs to be solved.However, the shortest path problem is a special case of the routing problem, and routing problems can be used to find ideal solutions to this problem.Finding the shortest paths is integral to many routing problems [4][5][6][7].

Methods
To solve this routing problem, we construct the objective function of the Hopfield neural network.We use two indices to represent each neuron.In this case, the routing index is the node number, and the second index is the node access sequence number at the time of the route.For example, the expression 1 xi Y means the input of the x-bit node as the i-th node in the route.The objective function must satisfy two conditions: first, each row and each column of the direction matrix should have the minimum (unique)value; second, the length of the entire path in the chosen direction should be minimal.
The fulfillment of the first condition of the objective function can be checked based on the following expression [8]: where A, B and C are constant numbers.To achieve this aim, the following conditions must be met: 1.If there is no more than one unit in each row, the sum of the first three terms is zero.2. If there is no more than one unit in each column (the sequence number of entry into the node), the sum of the second triple is zero.
3. If there are V units in the matrix, the third sum is zero.
The objective function is focused on finding the minimum path based on the fulfillment of the second condition -introducing an additional element to the objective function: . 4 Sufficiently large values for parameters A, B, and C indicate that the route has the least cost, while a large value of D ensures that the shortest path is selected.Opening the brackets of expression (1) and introducing additional variables, we create a matrix of weights for the following neural network connections: where ij G is the Kronecker parameter, which takes the value of 1 if condition ݅ = ݆ is satisfied, otherwise, it takes the value of 0. We proposed to choose the following function as the activation function of the Fneuron: where 0 u is the threshold value of neural network connections, e is the exponential function, E is the constant number.
Based on experiments, it was observed that effective results could be achieved with this function in many cases, so we have proposed the same function to solve this problem.
Then, the initial arbitrary values of the weight coefficients of the neural network were obtained, and in the next steps, the parameters of the neural network were selected, which can solve the problem as a result of their evolutionary change.
The Hopfield network setting process continues iteratively until the network's position remains unchanged, and the function reaches its minimum value.After the termination of the computational process, the neural network output is taken as the most optimal direction.
To solve this problem, the Hopfield network algorithm can be expressed in the following steps: Step 1. Initialization: CityXY is node coordinates, N is number of nodes.
Step 2. Calculation of distances between nodes: Step 3. Initialization of the initial values of the neural network weight matrix: Step 4. Calculation of the optimization function: The first part of the optimization function is (there is only one unit in each row of the matrix) The second part of the optimization function is (there is only one unit in each column of the matrix) The third part of the optimization function is (one direction only) Minimizing the length (cost) of the sought-for path, we obtain [ , ] 4

¦¦ ¦
2. If there is no more than one unit in each column (the sequence number of entry into the node), then the condition 3. If there are N units in the matrix, then the condition ¦¦ i j N X is satisfied.
Step 7. Termination.If all three check conditions are met simultaneously, the iteration stops, and the sequence of found nodes is printed; otherwise, the algorithm continues from step 3.In many cases, the solution to combinatorial optimization problems may require a lot of computational processes and computational time.In such cases, to increase the program's speed and efficiency, there are cases of inappropriate actions, such as purchasing a number of additional devices and software and attracting additional services.However, intuitive assessment does not always lead to effective success.When calculating according to the Amdahl law based on ideal parallelism to processor p, the calculating speed can be expressed as follows [10] . 1 Based on this expression, 95 percent parallel computing speed of 20 processors gives a numerical value of 1/(0.05 + 0.95/20) = 10.26.In practice, the efficiency of parallel computing may be lower.Observations have shown that in a modern dual-core computer with two cores, the solution to a problem divided into four mutually independent processes is 1.5 times faster than the speed of a simple, sequential solution, as long as it is possible.It should also be noted that the speed and quality of parallelization also depend on the communication parameters.
Gustafson and Barsis, in 1988, found that the execution time of the non-parallel part of the program takes less time than its parallel parts [10,11].This is especially true for the nonparallel preparation of sections and results processing.In this case, it is convenient to load a non-parallel task as a parameter of a parallel task: . 1 Gustafson and Barsis combined (2) with formula (3) to get the following expression: The resulting formula (4) allows us to estimate the percentage of the sequential part of the program required to achieve a given speed.For example, to increase the performance of a program by 19 times on 21 computers, the proportion of sequentially running programs on each computer should not exceed (21-19)/(21-1)=10%.
The main conclusion of the Gustafson-Barsis law is that parallelization is effective for large tasks when the task requires a lot of time for parallel computing.Parallelization across multiple processors is effective for very large tasks.
It is known that when solving this problem in the Hopfield neural network, neurons tend to solve the problem on the "one after another" principle.This dramatically increases the computational processes.If there is a matrix dimension, then based on this matrix, iterative calculations can be performed to solve this optimization problem using the Hopfield grid.It follows that as the size of the matrix increases, the chances of solving this optimization problem decrease.
To solve the problem (1), a recurrent neural network is proposed, represented by the following differential equation [12]: The finite difference version of the above equation for solving the proposed neural network can be expressed as: where t ' is the time step, and the value of this parameter can take values in the range are chosen based on experiments and have a significant impact on the speed of solving the problem and the quality of this solution.Observations show that the chances of obtaining an effective result t 1 K increase.Here t is the number of iteration steps.
To speed up the solution of the above system of equations ( 5), it was proposed to use the "Winner takes all" principle [19].Accordingly, the solution to this optimization problem is performed in the following sequence: 2. Iteration(7) continues until the following inequality condition is met: , 2 1 1 here H is a very small positive number.

Processing of the generated elements ij
x of the matrix: 3.1.From the i-th row of matrix max , j i x , the element with the maximum value is obtained, where max j is the column number of the element with the maximum value in the row.
3.2.Replacement 1 max , j i x is performed by the element obtained.The values of the row and all other elements in the column where this element is located are replaced with zeros: ., 0 The next step is to go back to row max j .
Steps 3.1 and 3.2 continue until the switching processes return to the first row.This condition indicates that the iteration is complete.
4. If the transition to the first row is done before n elements ij x of the matrix take the value of 1, than this means that the number of iterations performed was less than n.In this case, steps 1 and 3 are repeated.

Results and Discussion
When transmitting vector data coming to the input of the neural network, the initial states of the neurons are determined.Since the neural network has the feedback property, in the next steps, the outputs of the neurons again come to their inputs in the form of a new vector based on the feedback, and the state of the neurons changes again.It is known that recurrent neural networks are directly related to the concept of neuronal stasis [12][13][14].According to the Lyapunov criterion, such a neural network is considered stable if, after a finite number of iterations, the state of the neurons takes a state in which the topologies do not change.The output signals of neurons are formed due to transferring the vector to the input of fixed recurrent networks.They again enter the input as unwanted signals and form a new precedent vector.However, as the number of iterations increases, the number of changes in node states decreases until the final state of the network is established.It is known that open-loop networks are always stable because when a single unwanted vector is fed into the input, the nodes of the network can change their position only once due to the continuity of neuron inputs.
One of the most important features of artificial neural networks is the reliability of neural network models and systems.This feature allows the implementation of practical neural network systems in various sectors of the economy and solutions to problems that require high reliability.
Another important feature of neural networks is their ability to learn.Taking advantage of this ability, adequate adaptive neural network models were built to solve problems (Fig. 1,2).The results of numerous studies have shown that, in many cases, effective results can be achieved with this function, and for this task, it was proposed to choose this particular activation function.
It can be seen that in the proposed neural network n nu dimensional matrix is formed, as in the Hopfield network.But in this case, neurons interact not "one after another" but in rows and columns.As a result, the number of iterative calculations can be reduced by 2 n times compared with the Hopfield network [16-20].1.The work considers the Hopfield neural network for finding the optimal route by public transport.A computational experiment was carried out to find the optimal route for different numbers of nodes.
2. When the number of nodes is more than 30, the time to find the optimal route based on the Hopfield neural network has increased dramatically.To overcome this problem, a recurrent neural network is presented, represented by a differential equation.
3. The methods and algorithms used in the software package designed to find the optimal route for vehicles with different numbers of nodes have been tested.The method, algorithm, and modules of the software package presented in the research work are based on the effectiveness of model tests.The time to find the optimal route with the number of 2000 nodes is equally decreased by times than in the Hopfield network.

Step 5 . 1 .
Recalculation of weights of neural connections:U=U+lamda*Udao;We calculate the output value of the neuron If there is no more than one unit in each raw, then the condition

Table 1 .
Algorithms for finding the shortest path based on static parameters