Urban Traffic in Casablanca: A Novel Dataset and Its Application to Congestion Analysis via Fuzzy Clustering †
Abstract
1. Introduction
2. Literature Review
3. Data Description
3.1. Data Collection Method
3.2. Extracting Built Environment Data
3.2.1. (a) Population size, households, and density
3.2.2. (b) Tram and Bus Stations
3.2.3. (c) Type of Roads
3.2.4. (d) Land Use
3.3. Calculating Travel Time
3.3.1. (a) Real-Time Travel
3.3.2. (b) Travel Time Index
4. Use Case: Congestion Analysis in Casablanca Communes Using Fuzzy c-Means
4.1. Fuzzy c-Means Clustering
4.2. Cluster Validity and Selection of Optimal Number of Clusters
- 1.
- Partition Index (PI): This index reflects the compactness of clusters by evaluating the sum of squared membership degrees. A higher PI value indicates stronger cluster cohesion and better membership concentration.
- 2.
- Separation Index (SI): This index measures how well the clusters are separated from each other. Higher SI values indicate greater distances between cluster centers and hence better-defined cluster boundaries.
- 3.
- Xie-Beni Index (XB): The XB index evaluates the ratio between the total intra-cluster variance and the minimum squared distance between cluster centers. It is defined as follows:Lower values of indicate more compact and well-separated clusters.
- 4.
- Dunn Index (DI): The Dunn Index is the ratio of the minimum inter-cluster distance to the maximum intra-cluster distance. A higher Dunn Index implies better clustering quality:where is the distance between cluster centers and is the diameter of cluster k.
4.3. Clustering Results
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Bousouf, A.; Rouky, N.; Benmoussa, O.; Fri, M. Behavioral modeling and prediction in urban multimodal transport: Current techniques and future trends. In Proceedings of the 7th IEEE Congress on Information Science and Technology (CiSt), Agadir, Morocco, 16–22 December 2023; pp. 355–360. [Google Scholar]
- Rizzi, L.; De La Maza, C. The external costs of private versus public road transport in the Metropolitan Area of Santiago, Chile. Transp. Res. Part A Policy Pract. 2017, 98, 123–140. [Google Scholar] [CrossRef]
- El Amrani, A.; Fri, M.; Benmoussa, O.; Rouky, N. The integration of urban freight in public transportation: A systematic literature review. Sustainability 2024, 16, 5286. [Google Scholar] [CrossRef]
- Rouky, N.; Bousouf, A.; Benmoussa, O.; Fri, M. A spatiotemporal analysis of traffic congestion patterns using clustering algorithms: A case study of Casablanca. Decis. Anal. J. 2024, 10, 100404. [Google Scholar] [CrossRef]
- Benjdiya, O.; Rouky, N.; Benmoussa, O.; Fri, M. On the use of machine learning techniques and discrete choice models in mode choice analysis. LogForum 2023, 19, 331–345. [Google Scholar] [CrossRef]
- El Amrani, A.; Fri, M.; Benmoussa, O.; Rouky, N. A deep reinforcement learning framework for last-mile delivery with public transport and traffic-aware integration: A case study in Casablanca. Infrastructures 2025, 10, 112. [Google Scholar] [CrossRef]
- Akhtar, M.; Moridpour, S. A review of traffic congestion prediction using artificial intelligence. J. Adv. Transp. 2021, 2021, 8878011. [Google Scholar] [CrossRef]
- Chawla, P.; Goel, P.; Verma, P.; Jain, S. Real-time traffic congestion prediction using big data and machine learning techniques. World J. Eng. 2024, 21, 140–155. [Google Scholar] [CrossRef]
- Wu, K.T.; Ting, C.C.; Lin, S. Long-term traffic forecasting in smart traffic management: A Taiwan case study based on the informer architecture for highway traffic analysis. In Proceedings of the IET Conference Proceedings CP907, Stevenage, Da Nang, Vietnam, 6–10 November 2024; Volume 2024, pp. 1–6. [Google Scholar]
- Li, Y.; Chen, J.; Wang, T.; Zhao, Y. Estimation and prediction of freeway traffic congestion propagation using tagged vehicle positioning data. Transp. Transp. Dyn. 2024, 12, 2297143. [Google Scholar] [CrossRef]
- Duong, M.T.; Tran, T.; Nguyen, H.; Le, Q. Identifying traffic congestion through vehicle counting and motion estimation. In Proceedings of the International Conference on Green Technology and Sustainable Development, Cham, Switzerland, 14–15 December 2024. [Google Scholar]
- Wei, X.; Zhang, Y.; Li, M.; Huang, R. Exploring the spatiotemporal pattern of traffic congestion performance of large cities in China: A real-time data based investigation. Environ. Impact Assess. Rev. 2022, 95, 106808. [Google Scholar] [CrossRef]
- Kan, Z.; Chen, X.; Chen, Z.; Zhang, X. Measuring exposure and contribution of different types of activity travels to traffic congestion using GPS trajectory data. J. Transp. Geogr. 2024, 117, 103896. [Google Scholar] [CrossRef]
- Shi, Y.; Liu, B.; Chen, D.; Zhou, W. Exploring the nonlinear relationships between human travel and road traffic congestions using taxi trajectory data. Transportation 2024, in press. [Google Scholar] [CrossRef]
- Shang, W.L.; Zhang, Z.; Wang, X.; Li, C. Congestion and pollutant emission analysis of urban road networks based on floating vehicle data. Urban Clim. 2024, 53, 101794. [Google Scholar] [CrossRef]
- Hasabi, R.; Kusuma, G.; Sugiarto, M.; Saputra, D. Urban traffic congestion and its association with gas station density: Insights from Google Maps data. Indones. J. Electr. Eng. Comput. Sci. 2024, 35, 1618–1626. [Google Scholar] [CrossRef]
- Andara, R.; Rivas, J.; González, D. Behavior of traffic congestion and public transport in eight large cities in Latin America during the COVID-19 pandemic. Appl. Sci. 2021, 11, 4703. [Google Scholar] [CrossRef]
- Fulponi, J. Traffic congestion in Buenos Aires: Diagnosis and public policy recommendations for a more sustainable city. Transp. Res. Procedia 2023, 69, 21–28. [Google Scholar] [CrossRef]
- Owusu-Ansah, P.; Boakye, J.; Akoto, S.; Nketiah, E. Effect of traffic congestion on productivity in Ghana: Evidence from Atwima Nwabiagya municipality, Ashanti Region-Ghana. Int. J. Traffic Transp. Eng. 2022, 11, 11–20. [Google Scholar]
- Obiri-Yeboah, A.; Gbeckor-Kove, M.; Oliver-Commey, Y. Overview and recommendations for road traffic data collection methods and applications in Ghana. Int. J. Eng. Res. Appl. 2024, 11, 1–9. [Google Scholar]
- Njuu, K.; Runyoro, A.A.; Dida, M. Towards a smart and transparent road-based vehicle speed detection system in Tanzanian highways: A review of methods, technologies, and systems. Future Transp. 2025, 5, 45. [Google Scholar] [CrossRef]
- Ghosh, S.; Dubey, S. Comparative analysis of k-means and fuzzy c-means algorithms. Int. J. Adv. Comput. Sci. Appl. 2013, 4. [Google Scholar] [CrossRef]






| Communes | ZIP Code | Population Size | Household | Density |
|---|---|---|---|---|
| Echchalalate | 28822 | 153,118 | 27,433 | 10,641.16 |
| Anfa | 20040 | 118,057 | 22,528 | 9013.13 |
| … | … | … | … | … |
| Moulay Youssef | 20060 | 88,758 | 17,080 | 12,660.21 |
| Communes | ZIP Code | Number of Tram Stations | Number of Bus Stations |
|---|---|---|---|
| Echchalalate | 28822 | 0 | 0 |
| Sidi Maarouf | 20192 | 0 | 6 |
| Anfa | 20040 | 8 | 84 |
| … | … | … | … |
| Sidi Bernoussi | 20600 | 6 | 53 |
| Moulay Youssef | 20060 | 0 | 19 |
| Communes | ZIP Code | Number of Primary Roads | Number of Secondary Roads | Number of Highways |
|---|---|---|---|---|
| Echchalalate | 28822 | 6 | 2 | 22 |
| Anfa | 20040 | 143 | 154 | 42 |
| … | … | … | … | … |
| Moulay Youssef | 20060 | 59 | 38 | 20 |
| ZIP Code | Region Area (km2) | Parking Area (ha) | Industrial Area (ha) | Parks Area Area (ha) | Residential Area (ha) | Education Area (ha) | Number of Commercial Buildings |
|---|---|---|---|---|---|---|---|
| 28822 | 68.446 | 3.948 | 112.368 | 13.135 | 78.598 | 0.00 | 1 |
| 20040 | 18.134 | 3.009 | 0.00 | 9.262 | 1471.812 | 5.756 | 42 |
| … | … | … | … | … | … | … | … |
| 20060 | 3.599 | 2.349 | 16.801 | 3.402 | 282.384 | 0.00 | 4 |
| Origin | Destination | Distance (km) | Real-Time Travel at Each Hour (min) | ||||
|---|---|---|---|---|---|---|---|
| 00 | 01 | 02 | … | 23 | |||
| 0 | 1 | 9.954 | 12.583 | 12.583 | 12.583 | … | 10.200 |
| 0 | 2 | 9.098 | 13.267 | 13.267 | 13.267 | … | 13.133 |
| … | … | … | … | … | … | … | … |
| 114 | 113 | 4.845 | 7.100 | 6.150 | 5.367 | … | 6.683 |
| Origin | Destination | 00 | 01 | 02 | … | 23 |
|---|---|---|---|---|---|---|
| 0 | 1 | 1.083 | 1.083 | 1.083 | … | 1.222 |
| 0 | 2 | 1.412 | 1.412 | 1.412 | … | 1.473 |
| … | … | … | … | … | … | … |
| 114 | 113 | 1.541 | 1.562 | 1.358 | … | 1.347 |
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. |
© 2025 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 (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Rouky, N.; Bousouf, A.; Fri, M.; Benmoussa, O.; El Amrani, M.A. Urban Traffic in Casablanca: A Novel Dataset and Its Application to Congestion Analysis via Fuzzy Clustering. Eng. Proc. 2025, 112, 56. https://doi.org/10.3390/engproc2025112056
Rouky N, Bousouf A, Fri M, Benmoussa O, El Amrani MA. Urban Traffic in Casablanca: A Novel Dataset and Its Application to Congestion Analysis via Fuzzy Clustering. Engineering Proceedings. 2025; 112(1):56. https://doi.org/10.3390/engproc2025112056
Chicago/Turabian StyleRouky, Naoufal, Abdellah Bousouf, Mouhsene Fri, Othmane Benmoussa, and Mohamed Amine El Amrani. 2025. "Urban Traffic in Casablanca: A Novel Dataset and Its Application to Congestion Analysis via Fuzzy Clustering" Engineering Proceedings 112, no. 1: 56. https://doi.org/10.3390/engproc2025112056
APA StyleRouky, N., Bousouf, A., Fri, M., Benmoussa, O., & El Amrani, M. A. (2025). Urban Traffic in Casablanca: A Novel Dataset and Its Application to Congestion Analysis via Fuzzy Clustering. Engineering Proceedings, 112(1), 56. https://doi.org/10.3390/engproc2025112056

