Introduction

The shortest path problem (SPP) is a vital issue in the logistics field. Previous studies usually assumed vehicle speed as a static known constant, without considering changes during the path. However, in actual logistics activities, factors such as vehicle flow, traffic accidents, and weather conditions constantly affect the speed, resulting in variations in the driving time for each section of the road network. Consequently, the traditional static shortest path approach fails to meet the requirements of real logistics distribution. Thus, there is an urgent need to address the time-dependent shortest path problem (TDSPP).

With the advancement of artificial intelligence and the availability of traffic big data, it has now become possible to predict the continuously changing trends of vehicle speeds using historical road network data. This presents a new approach and data support for studying the TDSPP.

The rest of this paper is organized as follows. It starts with discussing the related work and establishing the shortest path problem with time-dependent speed in a traffic network in “Introduction” and Related work. We present the proposed architecture of the SRNN for traffic speed prediction and the SRNN-RSA algorithmic framework for solving TDSPP in “Time-dependent shortest path problem” and “Structural recurrent neural network”. The proposed approach and results of the performance evaluation with a real dataset are given in "Ripple spreading algorithm". Finally, "Experimental validation" discusses the results.

Related work

In this section, we give a detailed overview of the relevant literature about previous works on time-dependent shortest path problems (TDSPP), structural recurrent neural network (SRNN) and the ripple spreading algorithm (RSA). This will help readers figure out the background and differentiate our work from the existing works.

TDSPP

TDSPP is one of the general problems in the real world. In the time-dependent shortest path problem, different departing times of a node lead to different arrival times of its successive node. Under the condition of time-varying speed, vehicle speed is related to time, and vehicles have different driving speeds in different time periods and different driving areas. In the past decades, this classical problem has been the subject of extensive research resulting in a large number of algorithms. Pioneering work by references has proposed a variety of algorithms for solving TDSPP (Table 1).

Table 1 Overview of TDSPP solving algorithms

SRNN

The SRNN has been proposed in [39] with the application in human motion forecasting, human activity anticipation, and driver maneuver anticipation where the connected components in a system of interest are represented as nodes in a graph. The SRNN is based on the spatio-temporal graphs which are usually used to model spatial and temporal reasoning [40]. The spatial and temporal interactions between nodes are parametrized with a factor graph [41]. As the principles described in [39] implies, the SRNN is applicable to any system that can be expressed as spatio-temporal graphs. An attention model has recently been applied to the SRNN [42] to find subsets of human crowds within which humans interact with each other, instead of using a fixed graph to represent the connection among the humans. This approach deals with only one kind of node, humans, to predict human trajectories, which resembles the problem of short-term traffic prediction.

RSA

The ripple spreading algorithm (RSA) proposed by Hu [43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63], simulating the generation of a ripple relay race. The optimal path can be obtained only by running once. The computational process of RSA consists of an addition operation that updates the ripple radius according to the ripple speed and a comparison operation that compares the ripple radius with the link length.

Hence, it is feasible to simulate vehicle speed changes by manipulating the variation in ripple speed, leading to a simultaneous development of the real-time speed change and algorithmic solution processes. This approach resolves the time-dependent shortest path problem in evolving road networks. Previous literature has presented three common cases for ripple velocity, including fixed constants, minimum edge weights, and dynamic change functions (Table 2).

Table 2 Overview of ripple speed setting situations

After reviewing the existing literature, the relevant research work still has the following problems and deficiencies.

  1. 1.

    Currently, most studies use speed-time dependency functions to represent the changing trend of vehicle speed, without considering the differences in traffic network topology such as road grades, traffic capacity, and congestion levels at different time periods. As a result, they fail to reflect the spatial and temporal dynamic characteristics of traffic networks during vehicle travel.

  2. 2.

    In existing studies, in most cases, the time-varying speeds are provided first, then algorithms are used to calculate the routes. This approach cannot adapt to the changing vehicle speeds in real time. Additionally, different traffic networks require different speed-time dependency functions, and existing algorithms lack scalability when applied to different types of traffic networks.

Inspired by previous research, we apply the SRNN to predict the short-term traffic speed, considering road segments as nodes that are semantically the same but use a road network topology to construct the spatiotemporal graph. Meanwhile, we take the predicted vehicle speed of each specific period as the ripple speed, applying the RSA to solve TDSPP. Moreover, we verify the scalability of the SRNN-RSA by using training and evaluation datasets that have different network topologies. The main contributions of this work are as follows:

  1. 1.

    A structural RNN (SRNN) approach for traffic speed prediction that incorporates the topological information of the road network is used, where all nodes and edges are associated with the RNNs after joint trained, which can represent well both the spatial and temporal dynamics of the traffic;

  2. 2.

    The SRNN-RSA framework for solving the TDSPP is proposed, that is, the time-varying speed predicted by the SRNN is used to represent the ripple speed, which achieves the synergistic evolution of the real-time vehicle speed change process and the RSA solution process;

  3. 3.

    More importantly, we show the SRNN-RSA framework is scalable, which is evaluated with the real dataset from Santander and Guangzhou; The SRNN model trained with a road network is capable of predicting traffic states in other road networks that have different network topologies (the number of road segments and how they are connected with one another).

Time-dependent shortest path problem

Time-dependent road network

Let G = (V, E) be a directed graph that represents a road network, where V is a set of N nodes and E = {(i, j)∣i,j ∊ V}is a set of M edges. i and j are neighboring nodes. A is the directed adjacency matrix of edge, that is, A (i, j) = 1 denotes that there is an edge connecting nodes i and j, otherwise it is 0. Each edge (i, j) ∊ E has an arrival function (AF) f: R → R≥0 that for the given departure time ti at node i gets the arrival time tj at node j. Alternatively, we can define a travel time function (TTF) g(tij) that returns the time needed to cross the edge. A relationship between the TTF and the corresponding AF is defined as g(tij) = tj − ti = f(ti) − ti.

It is assumed that every f fulfills the first-in-first-out (FIFO) property at all edges: ∀ (i, j) ∊ E and ∀ ti1 < ti2, having tj1 ≤ tj2f (ti1) ≤ f (ti2) and the departure time must be smaller than the arrival time (the travel time tda must be positive). AFs are implemented as piecewise linear functions.

Problem description

More precisely, TDSPP can be defined as minimizing the travel time over the set Ps,d of all paths in G from the source node s to the destination node d:

$$ f_{d} = \min \left\{ {f_{p} \left( t \right)\left| {p \in P_{s,d} } \right.} \right\}, $$
(1)

where fd is the function of the earliest arrival time (minimal AF) from node s to node d and fp is AF of the path p ∊ Ps,d. This paper deals with single source and single-destination shortest-path problem. The input data are the graph G, AF fuv for every edge (u, v) ∊ E, the source node s and destination node d. The output is the set F of the earliest AFs from s to d: F = {fsdd ∊ V}.

Structural recurrent neural network

Speed prediction problem

In this subsection, we predict traffic speeds based on historical traffic speed data and road network graph in preparation for RSA to update the ripple speed during each time cycle. Let xtu represent the traffic speed on road segment u at time step t. Given a sequence of traffic speed data {xtu} for road segments u = 1, 2 … N − 1, N at time steps t = tc − (l − 1), tc − (l − 2),…, tc − [l − (l − 1)],tc. we predict the future traffic speed xt+1u on each road segment where tc denotes the current time step and l denotes the length of the historical data sequence under consideration.

Spatio-temporal graph representation

We use a spatio-temporal graph representation GST = (VST, ES, ET). Let GST denotes the spatio-temporal graph. VST, ES and ET denote the set of road segment nodes, the set of spatial edges, and the set of temporal edges, respectively.

Figure 1 represents an example spatio-temporal graph and Fig. 2 represents the spatio-temporal graph that is unrolled over time through the temporal edges in ET, where nodes u,v,w ∊ VST represent road segments and the nodes are linked by edges in ES and temporal edges in ET. Edges are labelled with corresponding feature vectors. ES represents the dynamics of traffic interaction between two adjacent road segments and ET represents the dynamics of the temporal evolution of the traffic speed in road segments.

Fig. 1
figure 1

Spatio-temporal graph

Fig. 2
figure 2

Spatio-temporal graph that is unrolled over time

The feature of node u at time step t is xtu, denoting the traffic speed on the road segment. The feature vector of spatial edge (u,v) ∊ ES at time step t is xt(u,v) = [xtu, xtv], which is obtained by concatenating the features of nodes u and v as a row vector. Two spatial edges linking two nodes u and v in opposite direction have different feature vectors, that is, xt(u,v) ≠ xt(v,u) = [xtv, xtu]. The feature vector of temporal edge (u,u) ∊ ET at time step t is xt(u,u) = [xt−1u, xtu], which is obtained by concatenating the features of node u at the previous time step and the current time step.

SRNN model architecture

In SRNN architecture, sets VST, ES and ET are associated with RNNs. The architecture is the simplest case where the nodes, spatial edges and temporal edges are sharing the same factors, respectively.

This means the dynamics of the spatio-temporal interactions are semantically the same for all road segments, which keeps the overall parametrization compact and makes the architecture scalable and independent of the road network topology.

Figure 3 visualizes the overall architecture. For each node u, a sequence of node features {xtu}tct=tc−(l−1), is fed into the architecture. Every time each node feature enters, the SRNN is supposed to predict the node label ytu, which corresponds to the traffic speed at the next time step, xt+1u. The node feature xtu is concatenated with the outputs of the edgeRNNs to be fed into the nodeRNN.

Fig. 3
figure 3

Architecture of the SRNN in perspective of node u drawn with the unrolled spatio-temporal graph

In this study, we used long short-term memory networks (LSTMs) for the RNNs. The hidden state dimension of nodeRNN is 128, and that of edgeRNNs is 256. We employed embedding layers in the network that convert the input into 128-dimensional vector using a rectified linear unit (ReLU) activation function to achieve nonlinearity.

After using the forward path algorithm, the prediction error, {xt+1u} − {ytu}, is jointly backpropagated through the nodeRNN, the spatial edgeRNN, and the temporal edgeRNN involved in the forward path, employing mean squared error (MSE) as a loss function. Note that the trainable parameters of this SRNN whose size is in dependent on the size of the spatio-temporal graph. It only depends on the sizes of the RNNs.

We provide a detailed explanation of how the SRNN algorithm works in a forward path. The inputs to the RNNs are converted into fixed-length vectors by an embedding function, denoted as φ(·). The embedding function applies a linear transformation to the input with a rectified linear unit (ReLU) activation and dropout. For each node u, the following RNNs are executed to predict the node label ytu (Table 3 and Algorithm 1).

Table 3 Notations in the SRNN and their meanings

We employ summation to realize a fixed architecture regardless of the graph topology. This is one of the key efforts to control the number of parameters by representing the variable context with a fixed-length vector.

After using the forward path algorithm, the prediction error, {xt+1u} − {ytu}, is jointly backpropagated through the nodeRNN, the spatial edgeRNN, and the temporal edgeRNN involved in the forward path, employing mean squared error (MSE) as a loss function. Note that the trainable parameters of this SRNN are {WES, WLS, WET, WLT, WE, WEH, WL, WO} whose size is in dependent on the size of the spatio-temporal graph. It only depends on the sizes of the RNNs.

Algorithm 1:
figure a

SRNN predicts speed

Ripple spreading algorithm

Ripple spreading principle

Like other optimization algorithms, the basic idea of RSA [43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63] is inspired by nature and tries to mimic the phenomenon of a stone falling into water and creating ripples that propagate in all directions. The core of the algorithm is based on a divisible, parallel computing Ripple Relay Race to search for optimal paths, which has excellent optimality and robustness when solving static or dynamic network problems. Nodes have three states: inactive (blue node), activated (red node), and dead (black node). States can only be changed in one direction and each node can only be activated once.

The schematic diagram of the RSA is shown in Fig. 4, using the example of finding the shortest path between node 1 and node 4. At the moment t = 1, source node 1 is in the activated state and generates ripples that spread to its neighboring nodes 2 and 3; At the moment t = 2, when the ripples generated by source node 1 reach node 2, which is in the inactive state, it converts node 2 from the inactive state to the activated state and creates new ripples. At the same time, the ripples from node 1 continue to spread to node 3; At the moment t = 3, the new ripples generated by node 2 continue to spread along the link until they reach their neighboring nodes. Meanwhile, node 1 activates node 3 and creates new ripples to spread. After node 1 activates all neighboring nodes, it will be in a dead state and no longer spread ripples; At the moment t = 4, while the ripple relay race is running continuously, more ripples gradually compete with each other until one ripple reaches and activates the destination node 4, and the remaining ripples immediately stop spreading. The shortest path from a source node to the destination node is determined by backtracking. Since path 1–3–4 has the smallest total length, 1–3–4 is the shortest path in the four-node network.

Fig. 4
figure 4

Schematic diagram of RSA

RSA operational steps

Given the actual situation of solving shortest paths in time-dependent road network, it is assumed that road network is G = (V, E). Each node is activated at most once during the entire ripple-spreading process. The relevant variables and definitions are listed (Table 4).

Table 4 Notations in the RSA and their meanings

The formulae for the parameters associated with the RSA algorithm for solving the complete Pareto front for TDSPP are as follows below.

  1. 1.

    Ripple spreading speed

Assuming that the ripple spreading speed between node i and node j at time step t is denoted as v(i,j,t), and after updating the iteration time t′, the ripple-spreading speed between node i and neighboring node j at moment t + t′ are denoted as v(i,j,t + t′), so the speed matrix at moment t is obtained based on the SRNN predicted speed in different unit times.

  1. 2.

    Update the ripple spreading radius

The ripple-spreading radius is updated once in the iteration time t´ and the spreading radius at moment t + t′ is equal to the product of the spreading radius at moment t plus the ripple spreading speed and the iteration time t′. The ripple-spreading radius for spreading from node i to node j at moment t + t′ is calculated as follows:

$$ R(i,j,t + t^{\prime}) = R\left( {i,j,t} \right) + v\left( {i,j,t + t^{\prime}} \right) \times t^{\prime}. $$
(2)
  1. 3.

    Radius of ripple spreading in the remaining time

In a certain iteration time t′, there exists a ripple that activates a node and the activated node generates new ripples to continue to spread in the remaining time. When node i activates the neighboring node j within the iteration time t′ and there is still a remaining time, the ripple spreading radius for node j to generate new ripples to spread to the neighboring node k within the remaining time tre is calculated as follows:

$$ t_{re} = \frac{{R(i,j,t + t^{\prime}) - C(i,j)}}{{v(i,j,t + t^{\prime})}}, $$
(3)
$$ R(j,k,t + t^{\prime}) = R(j,k,t) + v(j,k,t + t^{\prime}) \times t_{re} . $$
(4)

The flow chart of the RSA is shown in Fig. 5.

Fig. 5
figure 5

Flow chart of ripple spreading algorithm

Step 1 indicates generating the road network; Step 2 indicates initializing the parameters and setting an initial ripple at the source node; Step 3 indicates updating the time and predicting the speed of the road segment through the SRNN model; Step 4 indicates updating the ripple spreading radius; Step 5 determines whether a node in the road network is activated or not; Step 6 indicates updating the node status; Step 7 determines whether the destination node is activated or not; Step 8 indicates computing the ripple spreading radius for the remaining time; Step 9 indicates that a node is in a dead state when all neighboring nodes of the node are activated or are all in a dead state; Step 10 indicates obtaining the optimal path and the minimum time by backtracking.

SRNN-RSA framework

Based on the above principles of SRNN prediction speed and RSA solving for path, we combined the two parts to construct the SRNN-RSA framework, which can be used to solve TDSPP (Fig. 6).

Fig. 6
figure 6

SRNN-RSA framework

Algorithm 2 is the pseudo-code of the SRNN-RSA framework for solving TDSPP. Input a specific traffic network, update the time once in each time interval and use SRNN to predict the real-time speed of each road segment at that moment, then use RSA to solve for the optimal path given the source and destination.

Algorithm 2:
figure b

SRNN-RSA for solving TDSPP

Experimental validation

Experimental data

To validate the effectiveness and scalability of the SRNN-RSA framework, this section conducts experiments using two differen-sized traffic networks and traffic speed datasets. All experiments were conducted uniformly using Python programming language, and the environment of all algorithms was a personal computer with an Intel(R) Core (TM) i5-8250U CPU @ 1.60 GHz (Table 5).

Table 5 Examples of different-scales traffic networks

The first traffic speed dataset consists of 16 road segments in the central Santander city of Spain. Traffic speed measurements had been taken every 15 min. The overall dataset contains 33,504 speed readings per road segment [64, 65].

The second traffic speed dataset consists of 214 anonymous road segments (mainly consist of urban expressways and arterials) from Aug. 1, 2016 to Sep. 30, 2016 in Guangzhou, China. Traffic speed measurements had been taken every 10 min. Each road segment is observed for 61 days and there are 144 10-min time windows every day [66].

SRNN parameters

SRNN employs the mean squared error (MSE) as a loss function and Adam optimizer to minimize the sum of the MSE [67]. The traffic speed data, measured in [km/h], are scaled into the range [0, 1] before being fed into the networks.

The SRNN shows its best performance with the following hyperparameters. The major hyperparameters of the SRNN are summarized (Table 6). The SRNN is built based on the Pytorch implementation. The computational complexity of the SRNN is O(W). Note that the number of trainable parameters W is independent of the size of the road network.

Table 6 Hyperparameters of SRNN

Result analysis of Santander

We use data from the first 9 months (75%, 25, 128 speed readings per road segment) as a training set and the remaining data from the last 3 months (25%, 8376 speed readings per road segment) as an evaluation set. Given the datasets, the neural networks are supposed to give 15-min prediction of traffic speed based on 150-min data, which corresponds to a short-term prediction for the next time step based on data of previous 10-time steps (l = 10).

In the experiment, Santander consists of 16 road segments and 8 nodes. Next to each road segment is a unique ID number for the segment. Their graph representation illustrated clarifies the spatial connections between the road segments (Fig. 7) and the distribution of nodes in the road network (Fig. 8). The traffic data from the adjacent road segments are correlated, which is referred to as their spatial relationship to be learned by the SRNN.

Fig. 7
figure 7

Road segment network of Santander

Fig. 8
figure 8

TDSPP network of Santander

To further validate the accuracy and stability of the SRNN model in predicting traffic speeds on each road segment, three additional different types of traffic speeds (historical average values, fitting Gaussian distribution functions and fitting Sigmoid function) were selected and analyzed compared with the actual speeds (Table 7).

Table 7 Types of traffic speed on different road segment in Santander

Based on RSA optimality, it is necessary to further explore the effect of different speed types on the path result of TDSPP, so as to make it more accurately reflect the real traffic network.

According to Table 7, we set up RSA [43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63] based on real speeds (Real-RSA), RSA based on predicted SRNN speeds (SRNN-RSA), RSA based on historical averages (AVG-RSA), and RSA based on fitting Gaussian distribution speeds to historical information (Gaussian-RSA), and RSA based on fitting Sigmoid functions speeds to historical information (Sigmoid-RSA). Taking Fig. 7 as an example, node 7 and node 3, node 5 and node 2 are selected as the source node and destination node, respectively. TDSPP is solved using RSA with different traffic speeds (Table 8).

Table 8 Comparison of TDSPP path results for different traffic speed types in Santander

Based on the data in Table 8, the following conclusions can be drawn:

  1. 1.

    When a source is node 7 and destination node is node 3, the optimal paths and distances of RSAs with different speeds are the same. However, SRNN-RSA has the lowest timing percentage errors and is closest to Real-RSA, which always outperforms the other situations.

  2. 2.

    When a source is node 5 and destination is node 2, the optimal paths and distances of SRNN-RSA and Sigmoid-RSA are the same as Real-RSA. The path selection of AVG-RSA and Gaussian-RSA to reach node 2 through node 4 results in length of 0.022 more than Real-RSA. In addition, SRNN-RSA has the lowest timing percentage error, which is superior in terms of path quality and errors.

Considering the path results and timing percentage errors together, SRNN-RSA performs well in both examples and is closer to Real-RSA. This suggests that SRNN-RSA may have higher accuracy and efficiency in the path planning task of solving TDSPP, which is more consistent with the actual transportation situation.

To verify the superiority of the SRNN-RSA framework in solving TDSPP, the SRNN-RSA is compared with Dijkstra's algorithm [1,2,3,4,5,6,7,8,9], Branch and Bound (BB) [68], Genetic Algorithm (GA) [69], Simulated Annealing Algorithms (SA) [27], Ant Colony Algorithm (ACO) [29], and Q-learning [36, 38]. The above seven algorithms are applied to solve the optimal path respectively and each group of experiments is carried out 30 times (Table 9).

Table 9 Comparison of TDSPP path results for different algorithms in Santander

When analyzing the data in Table 9, in a small transport network of Santander, the following conclusions can be drawn:

  1. 1.

    In terms of optimal paths and path lengths, SRNN-RSA's search results are consistent with other algorithms;

  2. 2.

    In terms of vehicle travel time, the result of SRNN-RSA (0.685) is closer to that of Real-RSA (0.784), which is better than other algorithms and is most consistent with the TDSPP result under the actual traffic network;

  3. 3.

    In terms of the accuracy rate, SRNN-RSA always maintains a success rate of 100%.

  4. 4.

    In terms of the running time of the algorithms, SRNN-RSA is significantly lower than the other six algorithms. Exact algorithms such as Dijkstra and Branch and Bound require more time to ensure accuracy, and GA, SA, ACO and Q-Learning are probability-based stochastic algorithms that fall into the local optimum to varying degrees and require more running time to ensure accuracy ensure optimal solution.

  5. 5.

    SRNN-RSA can balance the solution accuracy and calculation speed.

Result analysis of Guangzhou

We use data from the first 75% readings per road segment as a training set and the remaining data as an evaluation set. Given the datasets, the neural networks are supposed to give 10-min prediction of traffic speed based on 100-min data, which corresponds to a short-term prediction for the next time step based on data of previous 10-time steps (l = 10).

In a similar way as in the small Santander network, we select different speed types of RSAs such as Real-RSA, SRNN-RSA, AVG-RSA, Gaussian-RSA and Sigmoid-RSA in the Guangzhou network to further explore the impact of different RSAs on the TDSPP path results in large-scale networks. Node 59 and node 117, node 9 and node 204 are selected as source and destination nodes, respectively. TDSPP with different traffic speeds is solved using RSA (Table 10).

Table 10 Comparison of TDSPP path results for different traffic speed types in Guangzhou

Based on the data in Table 10, the following conclusions can be drawn:

  1. 1.

    When a source is node 59 and the destination is node 117, the optimal path and distance of SRNN-RSA are the same as Real-RSA. In addition, SRNN-RSA has the lowest percentage timing error (− 2.26%), which is better than other cases in terms of path quality and error.

  2. 2.

    When a source is node 9 and the destination is node 204, the large-scale node network leads to errors in all cases with Real-RSA. However, SRNN-RSA has the lowest percentage timing error (12.57%). Considering the path results and the percentage timing error, SRNN-RSA has a clear advantage even in large cases, which corresponds to the actual traffic situation.

In the large-scale nodes network, SRNN-RSA is also used to compare with the other six algorithms. The results of the algorithms are shown in Table 11.

Table 11 Comparison of TDSPP path results for different algorithms in Guangzhou

By analyzing the data in Table 11, the following conclusions can be drawn in a large-scale traffic network:

  1. 1.

    In terms of optimal paths and path lengths, the search results of RSA are consistent with the exact algorithms such as Dijkstra and BB.

  2. 2.

    In terms of vehicle travelling time, the results of SRNN-RSA are closer to those of Real-RSA (1.414), which is better than other algorithms, and is the most consistent with the results of TDSPP under the actual traffic network.

  3. 3.

    In terms of success rate, SRNN-RSA always maintains 100% success rate, Dijkstra uses speeds obeying a Gaussian distribution, whose randomness makes the success rate of Dijkstra's path results less than 100%, and BB's branching optimization process makes the path results have the possibility of bias, and algorithms such as GA, SA, ACO and Q-learning are based on probabilistic optimization and have a lower success rate in large-scale networks.

  4. 4.

    In terms of the running time of the algorithms, the running time of SRNN-RSA is significantly lower than that of the other six algorithms, which can take into account the solution accuracy and calculation speed.

In summary, compared with other algorithms, RSA comprehensively traverses the search solution space, and the search mechanism better balances the algorithm's breadth-mining and depth-mining capabilities, which prevents the algorithm from entering the blind and disorderly search state, thus reducing the algorithm's computation time, guaranteeing the accuracy of the solution, and ultimately obtaining better search results.

Ablation study

To verify the validity of the SRNN model in the SRNN-RSA framework proposed in this paper, the standard RSA is constructed as the Baseline benchmark in this section. SRNN-RSA denotes that the SRNN model is used to predict the speeds of each road segment, which will be used as the input to solve the TDSPP with RSA to obtain the path results; RSA indicates that the TSDPP is solved by setting the relevant speed parameters only according to the basic principles of the standard RSA algorithm (Table 12).

Table 12 Experiments on the validity of the SRNN prediction module

The experimental findings demonstrate that the TSDPP solution performs better when the SRNN prediction module is added, outperforming the baseline when standard RSA is used alone.

  1. 1.

    In the small-scale example of Santander, the addition of the SRNN prediction module improves the travelling time but has no influence on the path results or path lengths. Standard RSA will not take into account the real traffic speeds because it bases its determination of the speeds on the example's network structure. This leads to a high bias and poor timing accuracy. With the help of the SRNN module, standard RSA can now account for the traffic network's temporal and geographical dynamics, improving timing accuracy and making it more in line with actual traffic patterns.

  2. 2.

    In the large-scale example of Guangzhou, the addition of the SRNN prediction module positively improves standard RSA, increasing the accuracy of path length by 19.12% and 14.94%, and the accuracy of travel time by 82.86% and 84.14%. It also shows that the benefit of the SRNN prediction module becomes more noticeable with increasing instance size.

The above ablation experiments prove that the SRNN prediction module proposed in this paper is effective. After adding the SRNN prediction module, the performance of RSA is greatly improved and the path results of solving TDSPP are more in line with the actual situation.

Conclusion

In this paper, we used an SRNN architecture that learns the spatial and temporal relationship between the traffic data represented as a spatio-temporal graph, which contains topological information of the road network to predict time-varying speeds in traffic road networks. Based on this, we proposed an SRNN-RSA framework for solving the TDSPP problem, which achieves a synergistic evolution between the real-time process of vehicle speed changes and the RSA-solving process.

In the future, the proposed SRNN-RSA framework can be integrated into traffic management systems or route planning systems to provide accurate predictions of future traffic states in an efficient and scalable manner.