scieee AI-readable full text Open interactive document viewer

Mobility vs. Contiguity: Spatially Explicit Graph Neural Networks for COVID-19 Forecasting

Li, Fengjiao; Wu, Meiliu; Basiri, Anahid

Abstract

This study demonstrates that graph construction is a critical modelling decision in spatial GNN forecasting by introducing and systematically evaluating five alternative spatial graph designs. The findings show that selecting or combining graph structures to reflect local mobility and spatial configurations can substantially improve predictive performance, underscoring the need to tailor graph representations to urban context.

Full text

Mobility vs. Contiguity: Spatially Explicit Graph Neural Networks for COVID-19 Forecasting Fengjiao Li1[0009−0006−9075−0818], Meiliu Wu1∗[0000−0002−5246−4603] and Anahid Basiri1[0000−0002−2399−1797] 1. School of Geographical and Earth Sciences, University of Glasgow, Glasgow, UK * [email protected] Abstract. Assessing how different graph constructions affect spatiotemporal forecasting is essential for avoiding misleading predictions and ineffective interventions across domains such as epidemic control, transportation, and environmental monitoring. Graph neural networks (GNNs) offer a powerful framework for modelling these processes, but the choice of graph representation, whether based on geographic contiguity, transport networks, or mobility flows, remains underexplored. This study evaluates and compares five graph designs for forecasting daily COVID-19 infection rates per 100,000 residents in Glasgow and Edinburgh (2020–2023), including contiguity, road distance, mobility, and hybrids that integrate mobility with either contiguity or road distance. Using a 7-day sliding input window to predict the subsequent 7 days, and assessing performance via MAE, RMSE, MAPE, and R2, we observe city-specific heterogeneity: mobility-informed hybrids achieve the best forecasts in Glasgow but not in Edinburgh. These findings suggest that the value of mobility is context-dependent, shaped by urban form and travel intensity. More broadly, the study points to the potential importance of tailoring graph construction to local conditions, offering methodological insights for epidemic modelling and other spatio-temporal forecasting applications. Keywords: Geospatial Artificial Intelligence ·Spatially Explicit Graph Neural Networks ·Mobility networks ·Spatio-temporal modelling ·COVID19 Forecasting 1 Introduction Spatially explicit graph neural networks (GNNs) can model spatially structured time series where interactions among places shape outcomes, enhancing many downstream tasks, e.g., traffic forecasting [16], epidemic spread prediction [9], and air pollution forecasting [10]. However, the choice of graph (e.g., contiguity, transportation connectivity, or measured mobility) remains under explored and may be context dependent. Spatial interactions can influence COVID-19 spread, and graph-based models provide a way to represent such dependencies. However, their advantages depend on context, data quality, and modelling assumptions. DOI: https://doi.org/10.5281/zenodo.17660772 2 F. Li et al. As such, this study forecasts daily COVID-19 infection rates and evaluates five different graph designs based on the backbone of Diffusion Convolutional Recurrent Neural Network (DCRNN) [17] between two Scottish cities that differ in population distribution and travel intensity. We aim to answer two important questions: when does mobility improve the prediction over, or combined with, contiguity (i.e., geographic adjacency), and how should graphs be combined? Studies have begun to explore the potential of Spatially explicit GNNs, particularly in epidemic forecasting. Kapoor et al. [15] examined spatio-temporal GNNs for COVID-19 forecasting, showing that their graph-based representations outperform purely temporal baselines. Witzke et al. [28] further demonstrated that mobility data can improve the prediction of incidence trends using graph neural networks. More recently, Duarte et al. [11] highlighted the advantages of integrating mobility flows directly into graph learning frameworks for epidemic forecasting. Despite these advances, most research studies only focused on mobility-based graphs, and few attempt to integrate different factors [3, 8], such as geographic adjacency [12], mobility flows [7], and road networks [18]. An open question remains: how should graphs be constructed and potentially combined? In the domain of traffic prediction, hybrid graph designs (e.g., combining road networks with mobility demand) have been more widely explored [29, 30]. Yet, systematic comparisons of these alternatives across different urban contexts seem to be still limited. It remains unclear whether mobility-based graphs consistently offer benefits, or whether their effectiveness varies depending on city-specific characteristics such as population density or travel patterns. To address these limitations, this study explores the comparative performance of five graph construction strategies within the DCRNN architecture: (1) geographic adjacency, (2) road network distances, (3) mobility flows, (4) hybrid graphs combining mobility with road networks, and (5) hybrid graphs combining mobility with geographic adjacency. Using daily COVID-19 infection rates per 100,000 residents at the InterZone level from 2020 to 2023 and a 7-day input window to forecast the subsequent 7 days, we conduct a comparative analysis in Glasgow and Edinburgh, two Scottish cities with contrasting demographic and mobility profiles. The study aims to examine how different graph designs may influence forecasting performance and to provide guidance on tailoring graphbased neural networks to local urban contexts in epidemic modelling 2 Data and Methods 2.1 Data Sources This study focuses on Glasgow and Edinburgh, two major Scottish cities with contrasting demographics and mobility patterns. Daily COVID-19 infection data at the InterZone level from March 2020 to February 2023 were obtained from Public Health Scotland [21].1Small counts (≤2cases per zone per day) were 1https://www.opendata.nhs.scot/dataset/covid-19-in-scotland Spatially Explicit Graphs for COVID-19 Forecasting 3 suppressed for confidentiality. To address this, we applied multiple imputation using the mice package in R [6]. Following standard practice in the missing data literature, we generated 20 imputed datasets. While Rubin originally suggested that as few as 3–5 imputations might be sufficient, subsequent methodological studies have shown that using a larger number (e.g., 20–40) improves the stability and precision of parameter estimates [5,13,25]. The 20 completed datasets were averaged to produce infection rates per 100,000 residents. Figure 1 illustrates the temporal evolution of infection rates in both cities, highlighting substantial fluctuations across pandemic waves and differences in magnitude between Glasgow and Edinburgh. These descriptive plots provide the empirical motivation for applying spatio-temporal models capable of adapting to heterogeneous dynamics. Population mobility data were accessed from the Urban Big Data Centre (UBDC) [26].2These origin–destination matrices provide anonymised flows between InterZones, expressed as percentages of resident movements. Road and rail network data were downloaded from the Geofabrik OpenStreetMap server for Scotland [20] and processed with the dodgr package to compute shortestpath distances for multiple transport modes. Together, these datasets enabled the construction of diverse graph structures that capture both geographic adjacency and mobility interactions. (a) Glasgow (b) Edinburgh Fig. 1: Weekly average 7days COVID-19 rate per 100,000 population in Glasgow and Edinburgh (2020–2023). 2.2 Graph Construction Five graph structures were designed to represent spatial and mobility relationships. (1) Geographic adjacency: wgeo ij =(1,if zones iand jshare a common boundary, 0,otherwise.(1) 2https://data.ubdc.ac.uk/datasets/6d87635c-96bb-4b7a-9a2e-676bb250032d 4 F. Li et al. (2) Road network: wroad ij =1 droad ij +ϵ, i =j, (2) where droad ij denotes the shortest-path distance between zones iand jthrough the multimodal road and rail network, and ϵis a small smoothing constant to avoid division by zero. Step 1: Data Daily COVID-19 infection counts at the InterZone level (2020–2023); Origin–destination mobility flows from the Urban Big Data Centre; Road and rail network data from OpenStreetMap; Geographic boundary data for InterZones Step 2: Preprocessing Small counts(≤2) imputed using the mice package in R with 20 imputations; Imputed counts averaged and converted to infection rates per 100,000 residents; Z-score normalisation applied; Shortest-path distances calculated from the road and rail network; Origin–destination flows symmetrised by averaging flows in both directions Step 3: Graph Construction (1) Geographic adjacency (shared boundaries); (2) Road network connectivity (inverse of shortest-path distance); (3) Mobility flows (symmetrised origin–destination flows); (4) Mobility + Road; (5) Mobility + Geographic adjacency Step 4: Modelling Diffusion Convolutional Recurrent Neural Network (DCRNN); Input: past 7 days of infection rates; Output: forecast of the next 7 days; Same hyperparameters applied for both Glasgow and Edinburgh; Data split chronologically into 70% training, 15% validation, 15% testing Step 5: Evaluation Predictions transformed back to original infection rate units; Performance assessed with MAE, RMSE, MAPE, and R2 Fig. 2: Step-by-step workflow of the study: data collection, preprocessing, graph construction, modelling, and evaluation. Spatially Explicit Graphs for COVID-19 Forecasting 5 (3) Mobility flows: wmob ij =1 2fij +fji, i =j, (3) where fij is the proportion of trips from zone ito zone j. The matrix is symmetrized to obtain an undirected representation, where edge weights reflect the average of flows in both directions. Although OD matrices are inherently directional, we adopt a symmetric representation for two reasons. First, transmission risk is bidirectional, since movements in both directions can facilitate cross-zone exposure. Similar symmetric assumptions are common in epidemic modelling to simplify transmission structures [3,23]. Second, OD data at the InterZone scale often contain sampling noise and directional imbalances; averaging fij and fji produces a more stable connectivity structure, which improves robustness when training graph neural networks. (4) Mobility + Road: WMR =αW mob + (1 −α)Wroad,(4) (5) Mobility + Geographic adjacency: WMG =αW mob + (1 −α)Wgeo,(5) which combines dynamic mobility flows with static geographic adjacency. Each matrix W= [wij]specifies the weighted adjacency structure used in the DCRNN model, where higher values of wij represent stronger spatial proximity or greater mobility flow intensity between zones. The coefficient αranged from 0.5 to 0.9, ensuring that mobility contributed at least equally to the hybrid structures. This range reflects the assumption that mobility is a dominant driver of transmission while allowing sensitivity to spatial constraints. Figure 3 presents visualisations of the graph structures, offering an intuitive illustration of the differences between geographic adjacency, road connectivity, and mobility flows. 2.3 Model and Training The DCRNN architecture was employed, integrating diffusion convolution with recurrent units to capture temporal dynamics alongside spatial diffusion over graphs. Forecasting was formulated as a multistep task in which a 7-day sliding input window was used to predict the subsequent 7 days at the InterZone level. The window advanced by one day at each step, generating overlapping input–output sequences across the entire time series. This rolling-window design functions as a time-series analogue to cross-validation, maximising data utilisation while preserving temporal ordering. To ensure comparability between Glasgow and Edinburgh, all model and training hyperparameters were kept identical across cities, including the number of recurrent layers (3), hidden units per layer (128), the maximum diffusion step 6 F. Li et al. (a) Geographic adjacency. (b) Road network. (c) Mobility flows. Fig. 3: Visualisations of the graph structures. Spatially Explicit Graphs for COVID-19 Forecasting 7 (3), the sequence length and forecast horizon (both set to 7), the use of dual random-walk filters, and curriculum learning with a decay of 300 steps. Training hyperparameters such as the learning rate (0.001 with multi-step decay), batch size (32), dropout (0.1), gradient clipping (5), and early-stopping patience (30) were also fixed. Keeping these hyperparameters constant prevents differences in model capacity or optimisation behaviour from influencing performance, allowing the analysis to isolate the impact of graph construction strategies. Data were split chronologically into training (70%), validation (15%), and testing (15%). The split points were selected not only by proportion but also with reference to fluctuations in weekly infection rates, ensuring that each subset contained representative epidemic dynamics. Later stages of the pandemic were reserved for out-of-sample evaluation. All infection rates were standardised using Z-score normalisation, defined as x′=x−µ σ,(6) where xis the raw infection rate, µthe mean, and σthe standard deviation. The inverse transformation was applied before computing the evaluation metrics to retain interpretability in the original units. 2.4 Evaluation Metrics Performance was assessed using four standard error metrics widely applied in forecasting studies [14,19]: mean absolute error (MAE), root mean squared error (RMSE), mean absolute percentage error (MAPE), and the coefficient of determination (R2). Since MAPE is undefined when yi= 0 and unstable for small denominators, we adopt a modified version MAPEεby adding a small constant ε= 10−3to the denominator. This ensures numerical stability for small-area incidence rates while retaining the interpretability of percentage error. The metrics are defined as: MAE =1 n n X i=1 |yi−ˆyi|,(7) RMSE =v u u t 1 n n X i=1 (yi−ˆyi)2,(8) MAPEε= 1 n n X i=1  yi−ˆyi yi+ε!×100%,(9) R2= 1 −Pn i=1(yi−ˆyi)2 Pn i=1(yi−¯y)2.(10) 8 F. Li et al. 3 Results 3.1 Glasgow Table 1 shows that hybrid graphs integrating mobility flows with geographic adjacency clearly outperform the single source alternatives in Glasgow. The best performing specification assigns 60% weight to mobility and 40% to geographic adjacency, achieving MAE = 80.01, RMSE = 133.22, MAPE = 48.89%, and R2= 0.90. Compared with the pure contiguity graph, this corresponds to a reduction of 1.6% in MAE, 14.83% in RMSE, and 4.97% in MAPE, highlighting the value of incorporating mobility information. The second and third ranked configurations (90% and 50% mobility weights, respectively) yield similarly competitive results, with RMSE values around 135–138. To visualise the multi-metric performance differences more clearly, Figure 4 presents a radar chart that summarises all four normalised metrics (MAE, RMSE, MAPE, and R2). The hybrid mobility–adjacency graphs form the largest enclosed area in the radar plot, indicating consistently strong performance across all evaluation metrics. In contrast, single-source graphs (contiguity, road distance, or mobility alone) show more uneven profiles, performing well on some metrics but worse on others. This graphical summary reinforces the tabulated results, showing visually that mobility-enhanced hybrid graphs provide the most balanced and accurate forecasts in Glasgow. Table 1: Forecasting performance of different graph structures in Glasgow. Models MAE (/100k) RMSE (/100k) MAPE (%) R2 Geographic adjacency 81.61 148.05 43.92% 0.88 Road 85.89 155.46 47.50% 0.87 Mobility 81.47 141.32 47.62% 0.89 Mobility + Road 50% + 50% 82.62 144.64 48.88% 0.89 60% + 40% 84.20 150.78 46.47% 0.88 70% + 30% 83.15 147.41 46.88% 0.88 80% + 20% 84.09 153.50 46.33% 0.87 90% + 10% 83.91 147.55 48.84% 0.88 Mobility + Geographic adjacency 50% + 50%(3) 82.32 137.81 48.43% 0.90 60% + 40%(1) 80.01 133.22 48.89% 0.90 70% + 30% 80.65 135.89 50.27% 0.90 80% + 20% 82.38 136.45 52.55% 0.90 90% + 10%(2) 80.33 135.45 47.55% 0.90 Note: Superscripts (1),(2), and (3) denote the top three models ranked by overall performance across MAE, RMSE, MAPE, and R2. MAE and RMSE are reported in units of the infection rate, defined as daily COVID-19 cases per 100,000 population (/100k). The training and validation loss curves in Figure 5(a–c) confirm that the three top hybrid models converge smoothly, with validation loss stabilising at a Spatially Explicit Graphs for COVID-19 Forecasting 9 Fig. 4: Radar chart comparing the forecasting performance of all graph designs in Glasgow. For MAE, RMSE, MAPE: score = 1 −x−xmin xmax−xmin . For R2: score = x−xmin xmax−xmin . similar level across runs. These patterns indicate that incorporating mobility into spatial graphs enhances the model’s ability to capture cross-zone transmission pathways in Glasgow. 3.2 Edinburgh In contrast, Table 2 and Figure 6 highlight a different ranking of graph structures in Edinburgh. The best performance is achieved by the geographic adjacency graph, with MAE = 78.24, RMSE=146.92, MAPE = 43.81%, and R2= 0.88. The second best configuration is the mobility graph, followed by the hybrid of 60% mobility and 40% adjacency. This ordering suggests that local contiguity relationships are more predictive of infection patterns in Edinburgh than mobilityenhanced graphs, which contrasts with the findings for Glasgow. Figure 5(d–f) shows that the top three models in Edinburgh also exhibit stable convergence, though validation loss remains slightly higher than in Glasgow, consistent with the overall larger errors reported in the metrics. A key observation is the heterogeneity in the role of mobility across cities. In Glasgow, mobility-informed hybrid graphs deliver clear improvements over spatial or road-based structures, whereas in Edinburgh, simple geographic adjacency provides the best forecasts. These findings imply that the utility of mobilityenhanced graphs is context dependent, shaped by city-specific factors such as travel intensity, population distribution, and administrative zoning. They also underscore the importance of tailoring graph construction strategies to local conditions rather than assuming universal superiority of mobility-based representations.