## 4 Methodology
### Dynamic Graph Fusion Module  
In this section, we will design a dynamic graph fusion module. This module aims to generate an adjacency matrix that represents the dynamic spatial correlations in the traffic road network by fusing the dynamic features extracted from the road attributes. As the dynamic spatio-temporal correlations heavily depend on real-time traffic states, it is essential to model the dynamic spatial correlations by inputting real-time traffic states. The core of constructing the dynamic feature matrix ensures a comprehensive encoding of the input's dynamic, latent spatial, and temporal information. To achieve this, we incorporate the following components at each time step: the current traffic state \(\mathbf{X}_{t}\in R^{N\times c}\), and the time-related embeddings including time of day \(\mathbf{T}_{t}^{D}\in R^{N\times d}\) and day of the week \(\mathbf{T}_{t}^{W}\in R^{N\times d}\). To further efficiently extract the hidden space features between nodes, we use two spatial node embeddings \(\mathbf{E}_{1}\in R^{N\times e}\) and \(\mathbf{E}_{2}\in R^{N\times e}\). Additionally, we extract features for the traffic state \(\mathbf{X}_{t}\) using two non-linear fully connected layers and convert the dimensionality from \(N\times c\) to \(N\times h\). From this, at time step \(t\), we create two dynamic feature matrices by fusing the above features in a concatenated manner as follows:  
\[\mathbf{D}\mathbf{F}_{t}^{1}=FC(\mathbf{X}_{t})\parallel\mathbf{E}_{1}\parallel\mathbf{T}_{t}^{D }\parallel\mathbf{T}_{t}^{W} \tag{2}\]  
\[\mathbf{D}\mathbf{F}_{t}^{2}=FC(\mathbf{X}_{t})\parallel\mathbf{E}_{2}\parallel\mathbf{T}_{t}^{D }\parallel\mathbf{T}_{t}^{W} \tag{3}\]  
where \(\mathbf{D}\mathbf{F}_{t}^{1},\mathbf{D}\mathbf{F}_{t}^{2}\in R^{N\times(h+e+2d)}\), \(N\) is the number of nodes, \(h\) is the feature dimension, \(e\) is the node embedding dimension, and \(d\) is the temporal embedding dimension. \(FC(\cdot)\)  
Figure 2: The overall framework of DSTGFCN. The encoder and decoder consist of two GC\(-\)GRU layers, with residual connections between the layers. The GC\(-\)GRU receives dynamic or adaptive graphs and simultaneously models the spatio-temporal correlations. denotes the network of two non-linear fully connected layers. We then compute the dynamic feature matrix at the current time step using the self-attention mechanism [34]:  
\[\widetilde{\mathbf{A}}_{t}=Softmax\left(\frac{\left(\mathbf{D}\mathbf{F}_{t}^{\mathbf{1}}\mathbf{W}_{ Q}\right)\left(\mathbf{D}\mathbf{F}_{t}^{\mathbf{2}}\mathbf{W}_{K}\right)^{T}}{\sqrt{h}}\right) \tag{4}\]  
where \(\mathbf{W}_{Q},\mathbf{W}_{K}\in R^{(h+e+2d)\times h}\) are the parameters of the self-attention mechanism. \(\widetilde{\mathbf{A}}_{t}\in R^{N\times N}\) denotes the spatial correlation between road nodes at time step \(t\). In this way, each dynamic feature matrix can learn unique adjacency relationships at each input time step through Equation (4), which reflects the time-varying traffic topology. Although the traffic conditions are dynamic, these changes occur gradually. For instance, the relationships between neighboring road segments exhibit variations during peak and off-peak periods. However, within consecutive time intervals, the local spatial dependencies between neighboring road segments change slowly. Hence, we employ a gating mechanism to extract and fuse crucial spatial topological information from the current time step's dynamic feature matrix \(\widetilde{\mathbf{A}}_{t}\) and the previous time step's dynamic adjacency matrix \(\mathbf{A}_{t-1}\), as follows:  
\[\mathbf{z}_{t}=Sigmoid\left(\widetilde{\mathbf{A}}_{t}\mathbf{W}_{\widetilde{A}_{t}}+\mathbf{ A}_{t-1}\mathbf{W}_{\mathbf{A}_{t-1}}\right) \tag{5}\]  
where \(\mathbf{W}_{\widetilde{A}_{t}}^{\sim},\mathbf{W}_{\mathbf{A}_{t-1}}\in R^{N\times N}\) are two learnable linear transformation matrices. Finally, we can obtain the dynamic adjacency matrix \(\mathbf{A}_{t}\in R^{N\times N}\) at time step \(t\):  
\[\mathbf{A}_{t}=