Message Passing Neural Networks for Traffic Forecasting
A road network, in the context of traffic forecasting, is typically modeled
as a graph where the nodes are sensors that measure traffic metrics (such as
speed) at that location. Traffic forecasting is interesting because it is
complex as the future speed of a road is dependent on a number of different
factors. Therefore, to properly forecast traffic, we need a model that is
capable of capturing all these different factors. A factor that is missing from
the existing works is the node interactions factor. Existing works fail to
capture the inter-node interactions because none are using the message-passing
flavor of GNN, which is the one best suited to capture the node interactions
This paper presents a plausible scenario in road traffic where node
interactions are important and argued that the most appropriate GNN flavor to
capture node interactions is message-passing. Results from real-world data show
the superiority of the message-passing flavor for traffic forecasting. An
additional experiment using synthetic data shows that the message-passing
flavor can capture inter-node interaction better than other flavors.
Arian Prabowo, Hao Xue, Wei Shao, Piotr Koniusz, Flora D. Salim
# Message Passing Neural Networks

###### Abstract

A road network, in the context of traffic forecasting, is typically modeled as a graph where the nodes are sensors that measure traffic metrics (such as speed) at that location. Traffic forecasting is interesting because it is complex as the future speed of a road is dependent on a number of different factors. Therefore, to properly forecast traffic, we need a model that is capable of capturing all these different factors. A factor that is missing from the existing works is the node interactions factor. Existing works fail to capture the inter-node interactions because none are using the message-passing flavor of GNN, which is the one best suited to capture the node interactions This paper presents a plausible scenario in road traffic where node interactions are important and argued that the most appropriate GNN flavor to capture node interactions is message-passing. Results from real-world data show the superiority of the message-passing flavor for traffic forecasting. An additional experiment using synthetic data shows that the message-passing flavor can capture inter-node interaction better than other flavors.

Keywords:Traffic Forecasting Graph Neural Network.

## 1 Introduction

Traffic forecasting is the task of predicting future traffic measurements (e.g. volume, speed, etc.) in a road network based on historical data. It is an interesting task from the perspective of both the broader societal impact of its application, as well as from a theoretical perspective. As a part of intelligent transport systems, better traffic forecasting can lead to more efficient designs and management of transportation networks. The downstream impacts include decreases in energy usage and reductions of the negative economic and psychological impacts of congestion.

Recently, traffic forecasting also gathers the interests of the research community [11]. This is because, from the theoretical perspective, traffic forecasting is interesting because it is complex as the future speed of a road is dependent on a number of different factors. Therefore, to properly forecast traffic, we need a
model that is capable of capturing all these different factors. An example of one such factor is each node's unique periodical pattern. To capture this behavior, AGCRN [3] learned a unique set of weights for each node.

Another factor is the past speed of neighboring nodes. To capture information from the neighboring nodes, many models used Graph Neural Networks (GNNs) which come in three flavors: convolutional, attentional, and message-passing [4]. For example, DCRNN[16], STGCN[24], Graph WaveNet[23], MTGNN[22], AGCRN[3] used different variations of convolutional GNNs, while ASTGCN[9] and GMAN[25] used different variations of attentional GNNs.

However, in this paper, we argue that there is another factor that is missing from the existing works, and that is the node interactions factor. Existing works fail to capture the inter-node interactions because none are using the message-passing flavor of GNN, which is the one best suited to capture node interactions.

Our contributions are as follows:

* This paper presents a plausible scenario in road traffic where nodes interactions are important.
* We then argued that the most appropriate GNN flavor to capture node interactions is message-passing.
* We perform several experiments using real-world data to show the superiority of the message-passing flavor for traffic forecasting.
* We perform an additional experiment using synthetic data to show that the message-passing flavor can capture inter-node interaction better than other flavors.

In the next section, we are going to formally describe the traffic forecasting task, node interactions in the context of traffic, and GNN flavors in the context of node interactions. Then, we briefly review the existing works on traffic forecasting, from the perspective of GNN flavors. Next, we describe the models we use in our experiments. These are: Graph WaveNet [23], the backbone architecture for our experiment; Diffusion convolution [16] a part of Graph WaveNet representing the convolutional flavor; Graph Attention Network (GAT) [21] representing the attentional flavor; and Message Passing Neural Network (MPNN) [8] representing the message-passing flavor. We then present and describe the results of two sets of experiments; one set on real-world data and another on synthetic data. Finally, we discuss the ethical implication of our work and present our conclusion.

## 2 Preliminary

### Traffic Forecasting Problem Definition

A traffic dataset is defined as a tensor \(\chi\in\mathbb{R}^{D\times N\times L}\) where \(D\) is the value of different traffic metrics (such as speed, flow, and density) at a particular node, \(N\) is the number of nodes, and \(L\) is the number of timesteps. The dataset can be accompanied with adjacency matrices \(A\in\mathbb{R}^{B,N,N}\), where \(B\) is the number
of different adjacency matrices. Since the edges can be weighted (usually as the inverse of distance) the adjacency matrix contains real values instead of binary. Moreover, because there are more than one way to construct adjacency matrices, some works use multiple adjacency matrices.

The traffic forecasting task is to perform multi-step forecast of the near future traffic metrics \(\chi[:,:,l+L_{FH}:l+L_{FH}+L_{FW}]\) based on the recent past traffic metrics \(\chi[:,:,l-L_{OW}:l]\) and the adjacency matrix \(\mathbf{A}\). The typical value is 12 timesteps (1 hour) for observation and forecasting window. This is formalized as follows:

\[\chi[:,:,l+L_{FH}:l+L_{FH}+L_{FW}]=f(\chi[:,:,l-L_{OW}:l],\mathbf{A}) \tag{1}\]

where \(l\) is the forecasting time, \(L_{OW}\) is the observation window, \(L_{FH}\) is the forecasting horizon, and \(L_{FW}\) is the forecasting window. Figure 3 in the Supplementary Material shows the problem definition visually.

### Node interactions

In this subsection, we are going to present a simplistic but illustrative scenario where node interaction is an important factor in road traffic. Consider a subgraph consisting of two nodes, \(u\) and \(v\), and a directed edge \((u,v)\), representing a one way street. Each node has a corresponding binary traffic state \(x_{u}^{t}\) and \(x_{v}^{t}\) at time \(t\) with the options being: congested or free-flow. The binary function \(x_{v}^{t+1}(x_{u}^{t},x_{v}^{t})\) represents the future traffic at node \(v\) at time \(t+1\). Generally, we can decompose this function into three different terms: \(x_{v}^{t+1}(x_{u}^{t},x_{v}^{t})=f(x_{u}^{t})+g(x_{v}^{t})+h(x_{u}^{t},x_{v}^{ t})\) where \(f(x_{u}^{i})\) is the term representing the influence of the neighboring nodes (in this case, there is only one), \(g(x_{v}^{i})\) is the term representing the influence of node \(v\) onto itself, and \(h(x_{u}^{i},x_{v}^{i})\) is the term representing the node interactions. (Note that the idea is that \(h(\cdot)\) is whatever is left from \(f(\cdot)\) and \(g(\cdot)\).)

Now, let's imagine a situation where the timestep is relatively short compared to the clearing of congestion at a node, but sufficiently long for congestion from node \(u\) to be able to reach node \(v\) in a timestep. Then the future of node \(v\) can be modeled with an AND function: \(x_{v}^{t+1}(x_{u}^{t},x_{v}^{t})=x_{u}^{t}\wedge x_{v}^{t}\). This behavior cannot be reduced in terms of combinations of \(f(\cdot)\) and \(g(\cdot)\) alone. Thus, we show that it is plausible that a scenario in traffic exists where the node interaction \(h(\cdot)\) is important.

### GNN flavors

One popular taxonomy of GNNs is the three flavors[4]: convolutional, attentional, and message-passing, visualized in Figure 1. The idea behind all GNN layers is to update a node's latent features based on its neighborhood (including itself). They all have the general form of:

\[\mathbf{h}_{u}^{i+1}=\boldsymbol{\phi}(\mathbf{h}_{u}^{i},\mathcal{H}_{u}^{i }\left(\left\{\mathbf{h}_{v}^{i}|v\in u\cup\mathcal{N}_{u}\right\}\right)) \tag{2}\]
where \(\mathbf{\phi}(\cdot)\) is a learnable non-linear transformation such as Multi-Layer Perceptron (MLP), \(\mathbf{h}_{u}^{i}\) is the latent feature of node \(u\) at layer \(i^{\text{th}}\), \(\mathcal{H}_{u}^{i}(\cdot)\) is a function that acts on the neighbourhood, and \(\mathcal{N}_{u}\) is a set containing all the neighbours of node \(u\). The key difference between the flavors is in their choice of \(\mathcal{H}_{u}^{i}(\cdot)\) that decides what the central node \(u\) is allowed to interact with.

In a convolutional GNN layer,

\[\mathcal{H}_{u}^{i}=\bigoplus_{\mathcal{N}_{u}}c_{uv}\mathbf{\psi}(\mathbf{h}_{v}^ {i}) \tag{3}\]

where \(\mathbf{\psi}(\cdot)\) are learnable non-linear transformations such as MLP, \(\bigoplus\) is a permutation-invariant aggregator such as mean-pooling, max-pooling, or summation, and \(c_{uv}\) is a learnable constant. Here, the central node \(u\) is only allowed to interact with the aggregate of the neighborhood. There are no node interactions.

In an attentional GNN layer,

\[\mathcal{H}_{u}^{i}=\bigoplus_{\mathcal{N}_{u}}\alpha(\mathbf{h}_{u}^{i}, \mathbf{h}_{v}^{i})\mathbf{\psi}(\mathbf{h}_{v}^{i}) \tag{4}\]

where \(\alpha(\cdot,\cdot)\) is a scalar function representing attention mechanism [21]. It dynamically modulates the contribution of each of the node neighbours. Since the scalar attention is calculated from the node interactions \(a(\mathbf{x}_{i},\mathbf{x}_{j})\), when combined with the multi-head technique, the linear combinations of the different heads can approximate the full inter-nodes interactions.

In a message-passing GNN layer,

\[\mathcal{H}_{u}^{i}=\bigoplus_{\mathcal{N}_{u}}\mathbf{\psi}(\mathbf{h}_{u}^{i} \dashv\mathbf{h}_{v}^{i}) \tag{5}\]

where \(\dashv\) is the binary concatenation operator. Here, \(\mathcal{H}_{u}^{i}(\cdot)\) captures the node interactions before the aggregations. This ensures that all the important information arising from the interactions between pairs of nodes is preserved. Thus,

Figure 1: Visualization of the three flavors of GNN [4]. The convolutional flavor lacks direct interactions between the center node and its neighbors. The attentional flavor uses the center and neighbor nodes interactions to dynamically adjust the attention weights of the neighboring nodes. Only the message-passing flavor allows direct interactions between the center and the neighboring nodes.
in tasks where it is important to capture interactions between nodes, such as traffic, message-passing is the most appropriate flavor.

## 3 Related Works

Road traffic has spatial and temporal elements. However, in this section, we are only going to focus on how the models proposed in the existing works propagate spatial information, and the GNN flavors used. This information is summarized in Table 1. For a more thorough review of this topic, check the survey [18] and the benchmark paper [11]. Earlier work such as LSTNet [14] did not model any spatial dependencies.

### Convolutional

STGCN [24] focused on making the multi-hop spatial information propagation efficient. To that end, they choose to use the Chebychev polynomial to approximate the spectral convolution kernels [6]. At about the same time, DCRNN [16] argued that a weighted and directed graph is a better model of the traffic network. To that end, they formulated a spatial convolution operation, called diffusion convolution, that works on weighted and directed graphs. They also showed that, when a graph is unweighted and non-directed, the diffusion convolution becomes equivalent the spectral convolution.

Graph WaveNet [23] also used the diffusion convolution proposed by in DCRNN [16]. However, it argued that there are hidden spatial dependencies that are not captured by the adjacency matrix constructed from the physical road network. Instead, it proposed the construction of self-adjacency matrices that learn the hidden spatial structure from data. In the absence of information about the spatial connectivity, these self-adjacency matrices can be used alone.

\begin{table}
\begin{tabular}{l l c c} \hline \hline  & Model & Conv. & Att. & M-P \\ \hline IJCAI 2018 & STGCN[24] & ✓ & & \\ ICLR 2018 & DCRNN[16] & ✓ & & \\ IJCAI 2019 & Graph WaveNet[23] & ✓ & & \\ AAAI 2019 & ASTGCN[9] & & ✓ & \\ AAAI 2020 & GMAN[25] & & ✓ & \\ SIGKDD 2020 & MTGNN[22] & ✓ & & \\ NeurIPS 2020 & AGCRN[3] & ✓ & & \\ PAKDD 2021 & AGCAN[15] & & ✓ & \\ PAKDD 2022 & T\({}^{2}\)-GNN[17] & ✓ & & \\  & **Ours** & & & ✓ \\ \hline \hline \end{tabular}
\end{table}
Table 1: GNN flavors of existing works
MTGNN [22] extended this idea of learning the graph structure from the data, to any multivariate time series instead of just traffic. Regarding the propagation of spatial information, they used a multi-hop spatial Graph Convolutional Network (GCN) [13]. Furthermore, they argued that it is important to dynamically adjust the contributions of neighborhoods with different numbers of hops. This was done by using a gating mechanism.

AGCRN [3] argued that every node has a unique behavior, and thus, there should be a different set of weights for every node. To prevent over-fitting and the explosion in the number of parameters, they proposed matrix factorization of the GCN parameters. T\({}^{2}\)-GCN [17] decomposed the dynamic spatial correlations in a traffic network into seasonal static and acyclic dynamic components. Because the two components have different dynamic spatial correlations, they used two parallel GCN towers, each containing a dynamic graph generation layer.

### Attentional

ASTGCN [9] pointed out the lack of attentional flavor in the literature then. Spatially, they proposed an attention mask over each of the Chebyshev terms. GMAN [25] argued that the inter-node correlations changes over the typical forecasting window (1 hour). Thus, to capture these fast changes, they used multi-head attention [20] to make the graph convolution steps dynamic. AGCAN [15] observed that adjacent nodes do not always have similar behavior due to differences in road attributes (like road width). On the other hand, non-adjacent nodes could have very similar traffic patterns, also due to road attribute similarities (like point-of-interest). To this end, they proposed a hierarchical spatial attention module.

### Message-passing

To the best of our knowledge, we are the first to try the message-passing flavor to the traffic forecasting task, as shown in Table 1. MPNN [8] was the first to be introduced as a generalization of several different GNN. The first implementation was in the domain of quantum chemistry and remained as a popular application up to recent years. For example, DimeNet [7] added a way for the model to access information regarding the angle between bonds in a molecule.

## 4 Methods

To evaluate the impact of different flavors of GNN for traffic forecasting, we first pick the current state-of-the-art architecture as the backbone. Based on a recent benchmark [11], we picked Graph WaveNet [23] as the backbone as it remains state-of-the-art. Its usage as a backbone remained popular in recent works [17]. Next, we replaced the GNN module of Graph WaveNet with other flavors of GNN as shown in Figure 2. In particular, we picked Graph Attention Network (GAT) [21] and Message Passing (MPNN) [8] as representatives of the attentional and
message-passing flavors respectively, to replace the diffusion convolution [16] in Graph WaveNet. This way, we can attribute any changes in performance to the different flavors alone.

For the rest of this section, we describe diffusion convolution, GAT, and MPNN. A short summary of our Graph WaveNet backbone can be found in the Supplementary Material B.

### Diffusion convolution with self-adaptive adjacency matrix

DCRNN [16] introduced diffusion convolution for directed graphs. Graph WaveNet [23] added a self-adaptive adjacency matrix term into the diffusion convolution.

The combined version is as follows:

\[\mathbf{h}^{[l+1]}=\mathbf{B}+\sum_{k=0}^{K}\mathbf{P}_{f}^{k}\mathbf{h}^{[l]} \mathbf{W}_{k,1}+\mathbf{P}_{b}^{k}\mathbf{h}^{[l]}\mathbf{W}_{k,2}+\tilde{ \mathbf{A}}^{k}\mathbf{h}^{[l]}\mathbf{W}_{k,3} \tag{6}\]

[16] where \(\mathbf{h}^{[l]}\) and \(\mathbf{h}^{[l+1]}\) are the input and output of the \(l^{\text{th}}\) module, \(\mathbf{P}_{f}^{k}\) and \(\mathbf{P}_{b}^{k}\) are the forward and backward normalized adjacency matrices respectively, to the power of \(k\), \(\mathbf{W}_{k,1}\), \(\mathbf{W}_{k,2}\), \(\mathbf{W}_{k,3}\), and \(\mathbf{B}\) are the learnable parameters, \(K\) is the number of hops, and \(\tilde{\mathbf{A}}\) is the self-adaptive adjacency matrix. The adjacency matrices are normalized as follows: \(\mathbf{P}_{f}=\mathbf{A}/\text{rowsum}(\mathbf{A})\) and \(\mathbf{P}_{b}=\mathbf{A}^{T}/\text{rowsum}(\mathbf{A}^{T})\). The self-adaptive adjacency matrix is defined as follows: \(\tilde{\mathbf{A}}=\text{SoftMax}(\text{ReLU}(\mathbf{E}_{1}\mathbf{E}_{2}^{T}))\) where \(\mathbf{E}_{1},\mathbf{E}_{2}\in\mathbb{R}^{N\times c}\) are learnable parameters, \(N\) is the number of nodes, and \(c\) is the size of latent feature.

### Graph Attention Network (GAT)

Based on the success of attention [2] and multi-headed self-attention mechanism [20], GAT [21] extended this to a graph structured data. We picked GAT as the representative of the attentional flavor. We used this PyTorch implementation: github.com/Diego999/pyGAT.

Figure 2: Simplified architecture diagram of Graph WaveNet backbone. Number of layers is only illustrative. G-TCN is a gated temporal convolutional network layer [19]. \(\bigoplus\) is a summation operation. In the original paper [23], the GNN of choice is diffusion convolution (DC) [16]. In this paper, we replace the DC with GAT [21] or MPNN [8].
The forward function of GAT is:

\[\tilde{\mathbf{h}}_{i}^{[l]}=\underset{m=1}{\overset{M}{\text{\text{\text{\text{ \text{\text{\text{\text{\text{\text{\text{\text{\text{\text{\text
#### 5.1.2 Experimental Setup

We used Optuna [1] for hyperparameter optimization with a budget of 20 runs for each model. Following the original setup, we used Adam as the optimizer, and Mean Absolute Error (MAE) as the loss function. We split the dataset to training/validation/testing set with a ratio of 7:1:2. We use a standard scaler on the input.

#### 5.1.3 Results

The results of our experiments are being compared with the results from a recent benchmark [11] in Table 2. Firstly, not including results from our experiments, Graph WaveNet outperforms all the other models more often than not. In METR-LA, GAT WaveNet significantly outperformed the original Graph WaveNet, and yet still outperformed by MP WaveNet. We attribute these improvements to GAT capabilities to dynamically adjust the edge weights and MPNN capabilities to capture node interaction.

### Synthetic data: Root Mean Square of neighbor pairs in a Graph (RMSG)

To show that the improvements of the MP WaveNet was due to its capacity in capturing complex inter-node interactions, we tested the different flavors of GNN on a synthetic graph attribute regression task: Root Mean Square of neighbour pairs in a Graph (RMSG). The motivation behind this task is to get simple non-linear interactions between a pair of neighbour.

#### 5.2.1 Task and Dataset

We constructed a graph with 100 nodes. 10% of all possible edges are connected; the edges are not directed and are unweighted. The node

\begin{table}
\begin{tabular}{l l|c c c|c c c|c c c} \hline \multicolumn{2}{c|}{\multirow{2}{*}{Model}} & \multicolumn{4}{c}{RMSE} & \multicolumn{4}{c}{MAE} & \multicolumn{4}{c}{MAPE (\%)} \\  & \multicolumn{2}{c}{15 mins} & \multicolumn{2}{c}{30 mins} & \multicolumn{2}{c}{60 mins} & \multicolumn{2}{c}{15 mins} & \multicolumn{2}{c}{30 mins} & \multicolumn{2}{c}{60 mins} & \multicolumn{2}{c}{15 mins} & \multicolumn{2}{c}{30 mins} & \multicolumn{2}{c}{60 mins} \\ \hline \multirow{6}{*}{
\begin{tabular}{} \end{tabular} } & HistoricalAverage & 14.737 & 14.737 & 14.736 & 11.013 & 11.010 & 11.005 & 23.34 & 23.34 & 23.33 \\  & CopyLastSteps & 14.215 & 14.214 & 14.214 & 6.799 & 6.799 & 6.798 & 16.73 & 16.73 & 16.72 \\  & LSTNet & 8.067 & 10.181 & 11.890 & 3.914 & 5.129 & 6.335 & 9.27 & 12.22 & 15.38 \\  & STGCN & 7.918 & 9.948 & 11.813 & 3.469 & 4.263 & 5.079 & 8.57 & 10.70 & 13.09 \\  & DCRNN & _7.509_ & 9.543 & 11.854 & 3.261 & 4.021 & 5.080 & 8.00 & 10.12 & 13.08 \\  & Graph WaveNet & 7.512 & _9.445_ & _11.485_ & _3.204_ & _3.922_ & _4.848_ & _7.62_ & _9.52_ & _11.93_ \\  & ASTGCN & 7.977 & 10.042 & 12.092 & 3.624 & 4.514 & 5.776 & 9.13 & 11.57 & 14.85 \\  & GMAN & 8.869 & 9.917 & 11.910 & 4.139 & 4.517 & 5.475 & 10.88 & 11.77 & 14.10 \\  & MTGNN & 7.707 & 9.625 & 11.624 & 3.277 & 3.999 & 4.867 & 8.02 & 10.00 & 12.17 \\  & AGCRN & 7.558 & 9.499 & 11.502 & 3.292 & 4.016 & 4.901 & 8.17 & 10.16 & 12.43 \\  & GAT WaveNet* & 5.303 & 6.388 & 7.595 & 2.759 & 3.173 & 3.668 & 7.14 & 8.58 & 10.12 \\  & MP WaveNet* & **5.206** & **6.247** & **7.412** & **2.712** & **3.093** & **3.556** & **6.84** & **8.23** & **10.00** \\ \hline \end{tabular}
\end{table}
Table 2: Performance comparison using real-world data. The results of our experiments are denoted with asterisk an (*), the rest are baselines taken from a 2021 benchmark [11]. The 15/30/60 mins column headings refer to the forecasting horizon. RMSE, MAE, and MAPE are error metrics, lower is better. The best number in the relevant group is in **bold**, the second best is underlined, and the third best is _italicized_.
feature is a single scalar distributed as follows: \(x_{i}=\mathcal{U}_{[-2,2]}\), where \(x_{i}\) is the attribute of node \(i\), and \(\mathcal{U}_{[-2,2]}\) a continuous uniform distribution with a lower and upper bound of \(-2\) and \(2\) respectively.

The node label is the root mean square of the product of the features between a node and its neighbors: \(y_{i}=\sqrt{\frac{1}{n}\sum_{j\in\mathcal{N}}(x_{i}x_{j})^{2}}\), where \(y_{i}\) is the label of node \(i\), and \(\mathcal{N}\) is a set containing all the nodes adjacent to node \(i\). The label is designed to have simple interaction, that is multiplications, followed by a simple non-linearity, that is quadratic. We used the root mean square as the aggregation, as we also use it as the loss function. This ensures that the behavior that the GNN needs to capture is simply the non-linear interactions, as the aggregation is trivial.

#### 3.2.2 Experimental Setup

A new graph is generated for each new data point, with new features and a new adjacency matrix. The loss function is RMSE. Each GNN flavor is trained on \(1,048,576=2^{20}\) datapoints, validated on \(104,857\) datapoints, and tested on \(2^{20}\) datapoints. The hyperparameters are optimized using Optuna [1] with a budget of \(20\) runs. The performance is based on the average and standard deviation of five runs. At every run, a new random seed is used to generate a new graph and initialize the model. To evaluate the performance, we used three metrics: Root Mean Square Error (RMSE), Mean Average Error (MAE), and Coefficient of Determination (\(R^{2}\)). They are defined in the Supplementary Material D.

#### 3.2.3 Models

There will be four different models compared: the _average_ as the baseline comparison, as well as the three GNN flavors models.

In the _average_ model, the label is the same for the entire graph, and it is the average of the label of the training set: \(\mathbf{h}_{n}=\frac{1}{N}\sum_{n=1}^{N}\mathbf{y}_{n}\) As a representative for the convolutional, attentional, and message-passing flavors, we pick GCN [12], GAT [21], and MPNN [8] models for each flavor respectively. We pick GCN [12] because this is the undirected version of diffusion convolution in Graph WaveNet.

To adjust the models for the RMSG task, we make the following changes: In GCN and GAT, we remove the typical softmax layer at the end because this is a regression task. We added MLP with one hidden layer as the encoder and decoder. We also added a self-loop in the adjacency matrix by adding an identity matrix to the adjacency matrix.

#### 3.2.4 Results

The result summary of five runs on each model is shown in Table 3. We use _average_ model metrics as the baseline. As expected, the \(R^{2}\) is practically zero. Note that this number can be negative when the sum of squared error in the numerator of equation 12 is bigger than the standard deviation of the data in the denominator. GCN did not manage to learn. This is shown by the fact that it has similar RMSE and MAE with the _average_ model. It also has an \(R^{2}\) that is very close to zero. Since past literature [12] has shown that GCN can deal with non-linearity, this result shows that GCN failed to capture node interaction.
GAT performed better with \(R^{2}\) about 0.88. It also has a significantly lower RMSE and MAE compared to the GCN and the baseline _average_ model. GAT performance is also less reliable, shown by the high standard deviation across all metrics. We attributed these improvements due to the attentional flavor capability to use node interactions to dynamically adjust the weight of the contribution from each node.

Only MPNN managed to learn the RMSG task completely RMSE and MAE approximately equal to zero and \(R^{2}\) approximately equal to one. The result of this set of experiments on the synthetic data shows that there exists a situation involving node interactions where MPNN, representing message-passing flavor, is the only flavor that is capable of fully learning the underlying patterns in the data.

## 6 Conclusion

Among the many factors that influence the future speed in a road network, we argued that node interaction is a plausible factor. Moreover, among the three different flavors of GNN, we also argued that message-passing is the most appropriate flavor to capture node interaction. Our experiments on real-world data show the superiority of the message-passing flavor. We also did additional experiments on the RMSG task to contrast the capabilities of the three flavors of GNN with respect to capturing node interactions, concluding that message-passing is superior, not only in terms of losses and metrics but also in capturing the distribution.
