Passenger Mobility Prediction via Representation Learning for Dynamic Directed and Weighted Graph

Yuandong Wang, Hongzhi Yin, Tong Chen, Chunyang Liu, Ben Wang, Tianyu Wo, Jie Xu

Abstract

Predicting passenger mobility is a cornerstone for the efficiency of ride-hailing platforms. Traditional models often overlook the directional nature of traffic or struggle with the inherent sparsity of urban trip data. This paper presents Gallat (Graph prediction with all attention), a novel framework that treats city traffic as a Dynamic, Directed, and Weighted (DDW) graph. Gallat utilizes a tripartite attention mechanism—spatial, temporal, and transferring—to learn robust representations of regional demand and origin-destination (OD) flows. Evaluations on large-scale datasets from Beijing and Shanghai show that Gallat consistently outperforms existing state-of-the-art spatiotemporal models.

Introduction: The Challenge of Urban Mobility

For ride-hailing platforms, the ability to anticipate demand allows for proactive driver dispatching, which minimizes passenger wait times and maximizes driver utility. However, modeling urban mobility is challenging due to two primary factors:

  1. Directional Semantics: Traffic flows are inherently asymmetric. Morning commutes from residential to business districts differ fundamentally from evening returns. Treating these relationships as simple undirected links loses critical semantic information.
  2. Data Sparsity: Many urban regions, particularly in the suburbs or during off-peak hours, have very few recorded trips. Standard Graph Neural Networks (GNNs) often fail to learn meaningful patterns when edges are sparse or weights are negligible.
Distribution of forward and backward neighbors at 3:00 AM and 9:00 AM, highlighting data sparsity and dynamic connectivity.

As shown in the neighbor distribution analysis, the connectivity of the urban graph is highly dynamic and often sparse, necessitating a model that can adapt to varying densities of information.

Methodology: The Gallat Framework

Gallat addresses these challenges by modeling the city as a DDW graph and processing it through three specialized attention layers.

The Gallat architecture featuring spatial, temporal, and transferring attention layers.

1. Spatial Attention Layer

Gallat distinguishes between three types of regional relationships: Forward neighbors (destinations), Backward neighbors (origins), and Geographical neighbors (physical proximity). By using "pre-weighted functions" based on historical trip intensity and distance, the model incorporates prior knowledge to stabilize learning in data-sparse regions.

2. Temporal Attention Layer

To capture the periodic nature of traffic, Gallat employs a multi-channel temporal attention mechanism. It analyzes snapshots from the same time slots on previous days alongside immediately preceding intervals. Scaled dot-product attention is used to dynamically weigh the relevance of these historical states.

3. Transferring Attention Layer

The final prediction is a two-stage process. Gallat first predicts the total outbound demand for a region. It then applies a transferring attention mechanism to calculate the probability of that demand being distributed to specific destination regions, effectively solving the complex OD flow prediction task.

Experimental Results

The model was rigorously tested on Didi datasets from Beijing and Shanghai, each partitioned into 400 grids with 1-hour granularity.

  • Accuracy: Gallat achieved significant improvements over baselines like LSTNet and GCRN. In the Beijing OD prediction task, Gallat recorded a MAPE-0 of 0.7283, a substantial lead over the next best model's 0.8347.
  • Interpretability: Visualization of the learned embeddings confirmed that the model successfully identifies functional zones, such as residential clusters and business districts, based on their unique inflow and outflow signatures.
  • Pretraining Benefit: A key finding was that pretraining the model on the simpler task of predicting total regional demand significantly accelerated convergence and improved the accuracy of the more complex OD flow predictions.

Conclusion

Gallat demonstrates that modeling traffic as a Dynamic, Directed, and Weighted graph provides a more accurate representation of urban mobility than traditional methods. By leveraging multi-layered attention and pre-weighted spatial priors, it effectively overcomes the hurdles of data sparsity and directional complexity. Future work may involve extending the model to irregular road networks and incorporating external variables like weather and public events to further enhance predictive precision.

Summary updated

Abstract

In recent years, ride-hailing services have been increasingly prevalent, as they provide huge convenience for passengers. As a fundamental problem, the timely prediction of passenger demands in different regions is vital for effective traffic flow control and route planning. As both spatial and temporal patterns are indispensable passenger demand prediction, relevant research has evolved from pure time series to graph-structured data for modeling historical passenger demand data, where a snapshot graph is constructed for each time slot by connecting region nodes via different relational edges (origin-destination relationship, geographical distance, etc.). Consequently, the spatiotemporal passenger demand records naturally carry dynamic patterns in the constructed graphs, where the edges also encode important information about the directions and volume (i.e., weights) of passenger demands between two connected regions. aspects in the graph-structure data. representation for DDW is the key to solve the prediction problem. However, existing graph-based solutions fail to simultaneously consider those three crucial aspects of dynamic, directed, and weighted graphs, leading to limited expressiveness when learning graph representations for passenger demand prediction. Therefore, we propose a novel spatiotemporal graph attention network, namely Gallat (Graph prediction with allattention) as a solution. In Gallat, by comprehensively incorporating those three intrinsic properties of dynamic directed and weighted graphs, we build three attention layers to fully capture the spatiotemporal dependencies among different regions across all historical time slots. Moreover, the model employs a subtask to conduct pretraining so that it can obtain accurate results more quickly. We evaluate the proposed model on real-world datasets, and our experimental results demonstrate that Gallat outperforms the state-of-the-art approaches.
BibTeX
@article{wang2022passenger,
  author = {Yuandong Wang and Hongzhi Yin and Tong Chen and Chunyang Liu and Ben Wang and Tianyu Wo and Jie Xu},
  title = {{Passenger Mobility Prediction via Representation Learning for Dynamic Directed and Weighted Graph}},
  journal = {ACM Trans. Intell. Syst. Technol.},
  year = {2022},
  url = {https://openreview.net/forum?id=wSvmsH-yut},
}
Figure