Traffic Assignment of Urban Road Based on Heterogeneous Graph Neural Networks
Abstract
1. Introduction
2. Literature Review
2.1. Traffic Assignment Problem
2.2. Applications of Heterogeneous Graph Neural Networks in Transportation
2.3. Research Gaps and Summary
3. Technical Background
3.1. Core Theory of Traffic Assignment
3.2. Graph Neural Network Technology
3.3. Fundamentals of the Transformer Multi-Head Self-Attention Mechanism
4. Architecture of the Dual Encoder Heterogeneous Graph Neural Network for Traffic Assignment
4.1. Virtual Encoder (V-Encoder)
4.2. Real Encoder (R-Encoder)
4.3. Traffic Assignment Prediction and Loss Function Design
5. Experiments and Conclusions
5.1. Experimental Design and Overall Performance Analysis
- Randomization of OD demands: The original dataset provides a fixed initial OD demand matrix. For each travel volume in this original OD demand matrix, a random scaling factor following the uniform distribution U (0.1, 1.0) is applied to independently generate 5000 groups of differentiated demand samples. This fluctuation range refers to mainstream traffic demand simulation studies, which conforms to the variation law of urban travel demand in peak hours, off-peak hours, and on different dates. This simulates travel demand fluctuations of urban networks across different time periods and dates, ensuring that the model performance is fully validated under various demand intensities.
- Construction of multi-level congestion scenarios: The original road network dataset only provides basic link capacity data and does not include pre-defined congestion levels. Based on the core index of the volume-to-capacity ratio (V/C ratio) of road segments (calculated using the original link capacity and the generated OD demand data), three typical traffic scenarios are independently defined in this study. The V/C ratio classification thresholds in this study adopt widely recognized traffic operation evaluation criteria and follow the classical congestion division standards in existing traffic network research, realizing quantitative and reasonable grading of network operation status: Free-flow scenario (V/C < 0.6, where the entire network remains in a smooth free-flow state); Moderate congestion scenario (0.5 ≤ V/C ≤ 1.0, supply and demand remain balanced and critical links approaching saturation); Severe congestion scenario (V/C > 1.0, representing oversaturated network operation with flow accumulation and congestion propagation on major road segments). Figure 5 presents the boxplot distribution of link V/C ratios (calculated based on original and generated data) for the Sioux Falls network under the three scenarios, visually demonstrating the operational differences among distinct congestion levels.
5.2. Ablation Experiments on Core Modules
5.3. Robustness Analysis Under Abnormal Traffic Scenarios
6. Conclusions and Future Work
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Sheffi, Y. Urban Transportation Networks: Equilibrium Analysis with Mathematical Programming Methods; Prentice-Hall: Englewood Cliffs, NJ, USA, 1985; pp. 23–32. [Google Scholar]
- Li, Y.; Pu, Z.; Liu, P.; Qian, T.; Hu, Q.; Zhang, J.; Wang, Y. Efficient predictive control strategy for mitigating the overlap of EV charging demand and residential load based on distributed renewable energy. Renew. Energy 2025, 240, 122154. [Google Scholar] [CrossRef]
- Zhang, H.; Dong, Y.; Xu, X.; Liu, Z.; Liu, P. A novel framework of the alternating direction method of multipliers with application to traffic assignment problem. Transp. Res. Part C Emerg. Technol. 2024, 169, 104843. [Google Scholar] [CrossRef]
- Xiao, Y.; Xiao, G.; Li, J. Photovoltaic-energy storage systems empowered: Low-carbon and economic scheduling for electric buses. Transp. Res. Part D Transp. Environ. 2026, 150, 105082. [Google Scholar] [CrossRef]
- Tang, R.; Yu, D.; Li, Y.; Tan, Y.; Shang, W.L.; Han, C.; Yang, M.; Ieromonachou, P. Accelerating the global energy transition through carbon pricing: An ex-post analysis of emissions reduction effects and mechanisms based on international data. Front. Eng. Manag. 2026; in press. [CrossRef]
- Shang, W.; Chen, H.; Watling, D.; Ochieng, W. How Far Are we from the large-scale adoption of V2G technology? Front. Eng. Manag. 2026, 13, 240–245. [Google Scholar] [CrossRef]
- Wang, C.; Tang, Y.Q. The Discussion of System Optimism and User Equilibrium in Traffic Assignment with the Perspective of Game Theory. Transp. Res. Procedia 2017, 25, 2970–2979. [Google Scholar] [CrossRef]
- Guo, X.; Xiao, G. Display slot competition and multi-homing in ride-hailing aggregator platforms: A game-theoretic analysis of profit and welfare implications. Sustainability 2026, 18, 3625. [Google Scholar] [CrossRef]
- Batista, S.F.A.; Cantelmo, G.; Menéndez, M.; Antoniou, C.; Leclercq, L. Activity-based user equilibrium considering aggregated traffic dynamics emulated using the Macroscopic Fundamental Diagram. Transp. Res. Part C Emerg. Technol. 2025, 171, 104980. [Google Scholar] [CrossRef]
- Van Vliet, D. The Frank-Wolfe algorithm for equilibrium traffic assignment viewed as a variational inequality. Transp. Res. Part B Methodol. 1987, 21, 87–89. [Google Scholar] [CrossRef]
- Xu, Z.; Chen, A.; Li, G.; Li, Z.; Liu, X. Elastic-demand bi-criteria traffic assignment under the continuously distributed value of time: A two-stage gradient projection algorithm with graphical interpretations. Transp. Res. Part E Logist. Transp. Rev. 2024, 183, 103425. [Google Scholar] [CrossRef]
- Chen, X.; Zhang, Z.; Li, Z.; Han, B.; Zheng, Y.; Biancardo, S.A. Microscopic aggregated traffic parameter extraction against complex camera motion interference. Transp. Saf. Environ. 2025, 7, tdaf056. [Google Scholar] [CrossRef]
- Raadsen, M.P.H.; Bliemer, M.C.J.; Bell, M.G.H. Aggregation, disaggregation and decomposition methods in traffic assignment: Historical perspectives and new trends. Transp. Res. Part B Methodol. 2020, 139, 199–223. [Google Scholar] [CrossRef]
- Ahmed, S.F.; Kuldeep, S.A.; Rafa, S.J.; Fazal, J.; Hoque, M.; Liu, G.; Gandomi, A.H. Enhancement of traffic forecasting through graph neural network-based information fusion techniques. Inf. Fusion 2024, 110, 102466. [Google Scholar] [CrossRef]
- Shao, F.; Shao, H.; Wu, X.; Cheng, Q.; Lam, W.H.K. A physics-informed machine learning framework for speed-flow prediction: Integrating an S-shaped traffic stream model with deep learning models. Transp. Res. C Emerg. Technol. 2025, 180, 105362. [Google Scholar] [CrossRef]
- Guarda, P.; Qian, S. Traffic estimation in unobserved network locations using data-driven macroscopic models. Transportmetr. A Transp. Sci. 2025; in press. [CrossRef]
- Liu, X.; Zhou, M.; Dong, H. Joint rescheduling for timetable and platform assignment of high-speed railways via graph neural network based deep reinforcement learning. Transp. Res. Part E 2025, 202, 104277. [Google Scholar] [CrossRef]
- Dong, P.; Zhang, X. ST-GTrans: Spatio-temporal graph transformer with road network semantic awareness for traffic flow prediction. Neural Netw. 2025, 190, 107623. [Google Scholar] [CrossRef]
- He, Y.; He, J.; Zhu, D.; Zhou, J. Traffic network equilibrium with capacity constraints and generalized Wardrop equilibrium. Nonlinear Anal. Real World Appl. 2010, 11, 4248–4253. [Google Scholar] [CrossRef]
- Lee, D.H.; Nie, Y.; Chen, A. A conjugate gradient projection algorithm for the traffic assignment problem. Math. Comput. Model. 2003, 37, 863–878. [Google Scholar] [CrossRef]
- Fukushima, M. A modified Frank-Wolfe algorithm for solving the traffic assignment problem. Transp. Res. B 1984, 18, 169–177. [Google Scholar] [CrossRef]
- Babazadeh, A.; Javani, B.; Gentile, G.; Florian, M. Reduced gradient algorithm for user equilibrium traffic assignment problem. Transp. A 2020, 16, 1111–1135. [Google Scholar] [CrossRef]
- Yun, L.; Qin, Y.; Fan, H.; Ji, C.; Li, X.; Jia, L. A reliability model for facility location design under imperfect information. Transp. Res. Part B Methodol. 2015, 81, 596–615. [Google Scholar] [CrossRef]
- Larsson, T.; Patriksson, M. An augmented Lagrangean dual algorithm for link capacity side constrained traffic assignment problems. Transp. Res. Part B Methodol. 1995, 29, 433–455. [Google Scholar] [CrossRef]
- Maksoud, A.; Alawneh, S.I.A.-R.; Hussien, A.; Abdeen, A.; Abdalla, S.B. Computational design for multi-optimized geometry of sustainable flood-resilient urban design habitats in Indonesia. Sustainability 2024, 16, 2750. [Google Scholar] [CrossRef]
- Obeidat, M.S.; Alomari, A.H.; Jaradat, A.S.; Barhoush, M.M. Traffic sign detection and recognition in Jordan based on machine learning and deep learning. Egypt. Inform. J. 2025, 31, 100761. [Google Scholar] [CrossRef]
- Zhang, P.; Qian, S. Low-rank approximation of path-based traffic network models. Transp. Res. Part C Emerg. Technol. 2025, 172, 105027. [Google Scholar] [CrossRef]
- Rahman, R.; Hasan, S. A deep learning approach for network-wide dynamic traffic prediction during hurricane evacuation. Transp. Res. Part C Emerg. Technol. 2023, 152, 104126. [Google Scholar] [CrossRef]
- Hu, X.; Liu, W.; Huo, H. An intelligent network traffic prediction method based on Butterworth filter and CNN-LSTM. Comput. Netw. 2024, 240, 110172. [Google Scholar] [CrossRef]
- Zhu, H.; Sun, F.; Tang, K.; Qin, G.; Chung, E. Lane level traffic flow prediction in urban networks with missing data—A time accessibility based multi-task learning framework. Transp. Res. Part C Emerg. Technol. 2025, 180, 105343. [Google Scholar] [CrossRef]
- Zhang, H.; Lu, G.; Zhang, Y.; Ariano, A.; Wu, Y. Railcar itinerary optimization in railway marshalling yards: A graph neural network based deep reinforcement learning method. Transp. Res. Part C Emerg. Technol. 2025, 171, 104970. [Google Scholar] [CrossRef]
- Rowan, D.; He, H.; Hui, F.; Yasir, A.; Mohammed, Q. A systematic review of machine learning-based microscopic traffic flow models and simulations. Commun. Transp. Res. 2025, 5, 100164. [Google Scholar] [CrossRef]
- Li, X.; Xiao, G.; Li, A.; Lai, F.; Xu, L. Network analysis of port clusters in the context of regional coordinated development: A case study of the Bohai bay port cluster. Marit. Policy Manag. 2026; in press. [CrossRef]
- Tran, T.; He, D.; Kim, J.; Hickman, M. M2NN: Multi-view multi-task graph neural network using congestion heatmap imagery for predicting traffic incidents across heterogeneous areas. Transp. Res. Part C Emerg. Technol. 2026, 183, 105458. [Google Scholar] [CrossRef]
- Fang, J.; Wei, W.; Shi, B.; Wang, C.-D.; Cai, Y.; Yang, J. Metapath-based feature aggregated heterogeneous graph neural network for adverse drug reactions prediction. Neurocomputing 2026, 667, 132271. [Google Scholar] [CrossRef]
- Fu, X.; King, I. MECHH: Metapath Context Convolution-based Heterogeneous Graph Neural Networks. Neural Netw. 2024, 170, 266–275. [Google Scholar] [CrossRef]
- Li, S.; Liu, P.; Stouffs, R. Fine-grained local climate zone classification using graph networks: A building-centric approach. Build. Environ. 2025, 278, 112928. [Google Scholar] [CrossRef]
- Liu, T.; Meidani, H. End-to-end heterogeneous graph neural networks for traffic assignment. Transp. Res. Part C Emerg. Technol. 2024, 165, 104695. [Google Scholar] [CrossRef]
- Tian, R.; Sun, H.; Mei, B.; Fu, Y.; Zhu, W. A heterogeneous graph neural network with spatial-temporal and operating condition-aware message passing mechanism for RUL prediction of aero-engines. Adv. Eng. Inf. 2026, 73, 104507. [Google Scholar] [CrossRef]
- Liu, T.; Meidani, H. Multi-class traffic assignment using multi-view heterogeneous graph attention networks. Expert Syst. Appl. 2025, 286, 128072. [Google Scholar] [CrossRef]
- Guo, X.; Yu, Z.; Huang, F.; Chen, X.; Yang, D.; Wang, J. Dynamic meta-graph convolutional recurrent network for heterogeneous spatiotemporal graph forecasting. Neural Netw. 2025, 181, 106805. [Google Scholar] [CrossRef]
- Xu, M.; Xiang, J.; Xie, Z.; Meng, X. Learning to rank critical road segments via heterogeneous graphs with origin-destination flow integration. Inf. Process. Manag. 2026, 63, 104702. [Google Scholar] [CrossRef]
- Chen, X.; Wu, P.; Wang, Z.; Feng, Z.; Luo, L.; Zhang, H.; Biancardo, S.A. MKG-GNN: Maritime knowledge graph and GNN framework for ship speed forecasting in port. Ocean Eng. 2026, 355, 125179. [Google Scholar] [CrossRef]
- Cai, B.; Camarcat, L.; Shang, W.L.; Quddus, M. A new spatiotemporal convolutional neural network model for short-term crash prediction. Front. Eng. Manag. 2024, 12, 86–98. [Google Scholar] [CrossRef]
- Chen, X.; Xin, Z.; Zhang, H.; Wu, Y.; Wei, C.; Postolache, O. Vision transformer-based image dehazing for climate-resilient maritime navigation. IEEE Trans. Intell. Transp. Syst. 2026, 1–13. [Google Scholar] [CrossRef]
- Huang, B.; Ruan, K.; Yu, W.; Xiao, J.; Xie, R.; Huang, J. OD former: Spatial-temporal transformers for long sequence Origin-Destination matrix forecasting against cross application scenario. Expert Syst. Appl. 2023, 222, 119835. [Google Scholar] [CrossRef]
- Zong, X.; Yu, F.; Chen, Z.; Xia, X. MSSTGCN: Multi-Head Self-Attention and Spatial-Temporal Graph Convolutional Network for Multi-Scale Traffic Flow Prediction. Comput. Mater. Contin. 2025, 82, 3517–3537. [Google Scholar] [CrossRef]
- Peng, X.; Li, L.; Lo, H.K.; Huang, W. A physics-constrained deep learning approach for dynamic origin-destination estimation using link counts. Transp. A Transp. Sci. 2026; in press. [CrossRef]
- Bar-Gera, H.; Stabler, B. Transportation Networks: A Repository for Transportation Research. GitHub Repository. 2018. Available online: https://github.com/bstabler/TransportationNetworks (accessed on 5 January 2026).
- Yang, H.; Jiang, C.; Song, Y.; Fan, W.; Deng, Z.; Bai, X. TARGCN: Temporal attention recurrent graph convolutional neural network for traffic prediction. Complex Intell. Syst. 2024, 10, 8179–8196. [Google Scholar] [CrossRef]
- Wu, K.; Ding, J.; Lin, J.; Zheng, G.; Sun, Y.; Fang, J.; Xu, T.; Zhu, Y.; Gu, B. Big-data empowered traffic signal control could reduce urban carbon emission. Nat. Commun. 2025, 16, 1. [Google Scholar] [CrossRef] [PubMed]










| Network Name | Nodes | Link | OD Pairs | Network Characteristic Description |
|---|---|---|---|---|
| Sioux Falls | 24 | 76 | 528 | A small-scale network with a simple and regular topological structure. |
| EMA | 74 | 258 | 1113 | A medium-scale network simulating the traffic connection between urban core areas and suburban regions. |
| Congestion Condition | Non-Congestion | Moderate Congestion | Congestion | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Network | Model | MAE | RMSE | R2 | MAE | RMSE | R2 | MAE | RMSE | R2 |
| Sioux Falls | GAT | 42.86 | 65.32 | 0.9872 | 51.39 | 78.45 | 0.9795 | 63.71 | 95.88 | 0.9683 |
| T-GCN | 38.57 | 58.14 | 0.9921 | 45.23 | 69.77 | 0.9864 | 56.42 | 85.19 | 0.9765 | |
| HetGNN | 34.91 | 52.76 | 0.9999 | 39.87 | 61.29 | 0.9954 | 48.65 | 74.38 | 0.9890 | |
| EMA | GAT | 59.43 | 90.17 | 0.9786 | 72.85 | 109.62 | 0.9654 | 89.37 | 134.59 | 0.9482 |
| T-GCN | 52.11 | 79.24 | 0.9853 | 63.47 | 96.83 | 0.9748 | 78.69 | 118.75 | 0.9597 | |
| HetGNN | 46.99 | 70.83 | 0.9914 | 55.32 | 84.76 | 0.9841 | 68.94 | 104.52 | 0.9725 | |
| Congestion Condition | Non-Congestion | Moderate Congestion | Congestion | ||||
|---|---|---|---|---|---|---|---|
| Network | Model | Train (min) | Infer (s) | Train (min) | Infer (s) | Train (min) | Infer (s) |
| Sioux Falls | GAT | 24.3 | 0.17 | 24.7 | 0.18 | 25.1 | 0.18 |
| T-GCN | 23.1 | 0.16 | 23.5 | 0.16 | 23.8 | 0.17 | |
| HetGNN | 21.5 | 0.13 | 21.8 | 0.13 | 22.1 | 0.14 | |
| EMA | GAT | 41.6 | 0.25 | 42.3 | 0.26 | 42.9 | 0.26 |
| T-GCN | 31.2 | 0.19 | 31.7 | 0.19 | 32.1 | 0.20 | |
| HetGNN | 33.3 | 0.20 | 33.8 | 0.20 | 34.2 | 0.21 | |
| Model | MAE | RMSE | R2 | Infer (s) |
|---|---|---|---|---|
| HetGNN | 46.99 | 70.83 | 0.9914 | 0.20 |
| HetGNN-ΔEv | 113.27 | 154.49 | 0.9536 | 0.17 |
| HetGNN-ΔMHA | 76.22 | 113.33 | 0.9758 | 0.18 |
| HetGNN-ΔEncoder | 68.54 | 99.94 | 0.9805 | 0.25 |
| Missing Ratio | Network | Siouxfalls | EMA | ||
|---|---|---|---|---|---|
| Model | MAE | RMSE | MAE | RMSE | |
| 20% | GAT | 48.35 | 73.69 | 66.81 | 101.45 |
| T-GCN | 43.29 | 65.47 | 59.43 | 89.97 | |
| HetGNN | 38.76 | 58.52 | 52.18 | 78.94 | |
| 30% | GAT | 54.17 | 82.53 | 74.26 | 112.83 |
| T-GCN | 48.92 | 73.86 | 66.58 | 99.34 | |
| HetGNN | 40.12 | 60.78 | 54.73 | 82.61 | |
| 40% | GAT | 59.72 | 91.06 | 79.64 | 120.97 |
| T-GCN | 53.85 | 81.29 | 71.92 | 106.58 | |
| HetGNN | 42.35 | 63.94 | 57.41 | 86.83 | |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Xiao, G.; Xia, T.; Chen, X.; Ni, A. Traffic Assignment of Urban Road Based on Heterogeneous Graph Neural Networks. Sustainability 2026, 18, 5044. https://doi.org/10.3390/su18105044
Xiao G, Xia T, Chen X, Ni A. Traffic Assignment of Urban Road Based on Heterogeneous Graph Neural Networks. Sustainability. 2026; 18(10):5044. https://doi.org/10.3390/su18105044
Chicago/Turabian StyleXiao, Guangnian, Tong Xia, Xinqiang Chen, and Anning Ni. 2026. "Traffic Assignment of Urban Road Based on Heterogeneous Graph Neural Networks" Sustainability 18, no. 10: 5044. https://doi.org/10.3390/su18105044
APA StyleXiao, G., Xia, T., Chen, X., & Ni, A. (2026). Traffic Assignment of Urban Road Based on Heterogeneous Graph Neural Networks. Sustainability, 18(10), 5044. https://doi.org/10.3390/su18105044

