Skip to main content

Thank you for visiting You are using a browser version with limited support for CSS. To obtain the best experience, we recommend you use a more up to date browser (or turn off compatibility mode in Internet Explorer). In the meantime, to ensure continued support, we are displaying the site without styles and JavaScript.

  • Article
  • Published:

Spatial planning of urban communities via deep reinforcement learning


Effective spatial planning of urban communities plays a critical role in the sustainable development of cities. Despite the convenience brought by geographic information systems and computer-aided design, determining the layout of land use and roads still heavily relies on human experts. Here we propose an artificial intelligence urban-planning model to generate spatial plans for urban communities. To overcome the difficulty of diverse and irregular urban geography, we construct a graph to describe the topology of cities in arbitrary forms and formulate urban planning as a sequential decision-making problem on the graph. To tackle the challenge of the vast solution space, we develop a reinforcement learning model based on graph neural networks. Experiments on both synthetic and real-world communities demonstrate that our computational model outperforms plans designed by human experts in objective metrics and that it can generate spatial plans responding to different circumstances and needs. We also propose a human–artificial intelligence collaborative workflow of urban planning, in which human designers can substantially benefit from our model to be more productive, generating more efficient spatial plans with much less time. Our method demonstrates the great potential of computational urban planning and paves the way for more explorations in leveraging computational methodologies to solve challenging real-world problems in urban science.

This is a preview of subscription content, access via your institution

Access options

Buy this article

Prices may be subject to local taxes which are calculated during checkout

Fig. 1: Demonstration of community renovation and a 15-minute city.
Fig. 2: Demonstration of transferring pretrained models to different spatial planning tasks.
Fig. 3: Demonstration of community plans of different styles.
Fig. 4: Comparison and collaboration with professional human designers.

Similar content being viewed by others

Data availability

The geographic data of communities used in this work is collected from OpenStreetMap ( using Python 3.8.0 with packages osmnx>=1.1.2 and geopandas>=0.11.1. We provide the data for the three adopted communities in our experiments. The data supporting the results of this study is available on Zenodo ( and GitHub ( Source data are provided with this paper.

Code availability

The code used in this research can be found at Zenodo ( and Github (


  1. Xu, Y., Olmos, L. E., Abbar, S. & González, M. C. Deconstructing laws of accessibility and facility distribution in cities. Sci. Adv. 6, eabb4112 (2020).

    Article  Google Scholar 

  2. Weiss, D. J. et al. A global map of travel time to cities to assess inequalities in accessibility in 2015. Nature 553, 333–336 (2018).

    Article  Google Scholar 

  3. Nouvellet, P. et al. Reduction in mobility and Covid-19 transmission. Nat. Commun. 12, 1090 (2021).

    Article  Google Scholar 

  4. Moreno, C., Allam, Z., Chabaud, D., Gall, C. & Pratlong, F. Introducing the “15-minute city": sustainability, resilience and place identity in future post-pandemic cities. Smart Cities 4, 93–111 (2021).

    Article  Google Scholar 

  5. Ferrer-Ortiz, C., Marquet, O., Mojica, L. & Vich, G. Barcelona under the 15-minute city lens: mapping the accessibility and proximity potential based on pedestrian travel times. Smart Cities 5, 146–161 (2022).

    Article  Google Scholar 

  6. Allam, Z., Nieuwenhuijsen, M., Chabaud, D. & Moreno, C. The 15-minute city offers a new framework for sustainability, liveability, and health. Lancet Planet. Health 6, e181–e183 (2022).

    Article  Google Scholar 

  7. Allam, Z., Bibri, S. E., Chabaud, D. & Moreno, C. The ‘15-minute city’concept can shape a net-zero urban future. Humanit. Soc. Sci. Commun. 9, 126 (2022).

    Article  Google Scholar 

  8. Weng, M. et al. The 15-minute walkable neighborhoods: measurement, social inequalities and implications for building healthy communities in urban China. J. Transp. Health 13, 259–273 (2019).

    Article  Google Scholar 

  9. Balletto, G., Ladu, M., Milesi, A. & Borruso, G. A methodological approach on disused public properties in the 15-minute city perspective. Sustainability 13, 593 (2021).

    Article  Google Scholar 

  10. Noworól, A., Kopyciński, P., Hałat, P., Salamon, J. & Hołuj, A. The 15-minute city—the geographical proximity of services in Krakow. Sustainability 14, 7103 (2022).

    Article  Google Scholar 

  11. Merrell, P., Schkufza, E. & Koltun, V. Computer-generated residential building layouts. ACM Trans. Graph. 29, 181 (2010).

    Article  Google Scholar 

  12. Landes, J. In Artificial Intelligence in Urban Planning and Design (eds As, I. et al.) Ch. 14 (Elsevier, 2022).

  13. Forrester, J. W. Urban Dynamics Vol. 11 (MIT Press, 1970).

  14. Lowry, I. S. A model of metropolis. Santa Monica, CA. RAND Corporation (1964).

  15. Wilson, A. G. Models in urban planning: a synoptic review of recent literature. Urban Stud. 5, 249–276 (1968).

    Article  Google Scholar 

  16. Batty, M. Big data, smart cities and city planning. Dialogues Hum. Geogr. 3, 274–279 (2013).

    Article  Google Scholar 

  17. Harris, B. & Batty, M. Locational models, geographic information and planning support systems. J. Plan. Educ. Res. 12, 184–198 (1993).

    Article  Google Scholar 

  18. Wang, D., Fu, Y., Wang, P., Huang, B. & Lu, C.-T. Reimagining city configuration: automated urban planning via adversarial learning. In Proc. 28th International Conference on Advances in Geographic Information Systems 497–506 (Association for Computing Machinery, 2020).

  19. Dahal, K. R. & Chow, T. E. A GIS toolset for automated partitioning of urban lands. Environ. Model. Softw. 55, 222–234 (2014).

    Article  Google Scholar 

  20. Mnih, V. et al. Human-level control through deep reinforcement learning. Nature 518, 529–533 (2015).

    Article  Google Scholar 

  21. Agostinelli, F., McAleer, S., Shmakov, A. & Baldi, P. Solving the Rubik’s cube with deep reinforcement learning and search. Nat. Mach. Intell. 1, 356–363 (2019).

    Article  Google Scholar 

  22. Fan, C., Zeng, L., Sun, Y. & Liu, Y.-Y. Finding key players in complex networks through deep reinforcement learning. Nat. Mach. Intell. 2, 317–324 (2020).

    Article  Google Scholar 

  23. Novati, G., de Laroussilhe, H. L. & Koumoutsakos, P. Automating turbulence modelling by multi-agent reinforcement learning. Nat. Mach. Intell. 3, 87–96 (2021).

    Article  Google Scholar 

  24. Wang, Z., Xu, Y., Wang, D., Yang, J. & Bao, Z. Hierarchical deep reinforcement learning reveals a modular mechanism of cell movement. Nat. Mach. Intell. 4, 73–83 (2022).

    Article  Google Scholar 

  25. Silver, D. et al. Mastering the game of Go without human knowledge. Nature 550, 354–359 (2017).

    Article  Google Scholar 

  26. Segler, M. H., Preuss, M. & Waller, M. P. Planning chemical syntheses with deep neural networks and symbolic AI. Nature 555, 604–610 (2018).

    Article  Google Scholar 

  27. Fawzi, A. et al. Discovering faster matrix multiplication algorithms with reinforcement learning. Nature 610, 47–53 (2022).

    Article  MATH  Google Scholar 

  28. Mirhoseini, A. et al. A graph placement methodology for fast chip design. Nature 594, 207–212 (2021).

    Article  Google Scholar 

  29. Xue, J. et al. Quantifying the spatial homogeneity of urban road networks via graph neural networks. Nat. Mach. Intell. 4, 246–257 (2022).

    Article  Google Scholar 

  30. Boeing, G. OSMnx: new methods for acquiring, constructing, analyzing, and visualizing complex street networks. Comput. Environ. Urban Syst. 65, 126–139 (2017).

    Article  Google Scholar 

  31. Vich, G., Gómez-Varo, I. & Marquet, O. in Resilient and Sustainable Cities (eds Allam, Z. et al.) Ch. 3 (Elsevier, 2023).

  32. Kabisch, N., Strohbach, M., Haase, D. & Kronenberg, J. Urban green space availability in European cities. Ecol. Indic. 70, 586–596 (2016).

    Article  Google Scholar 

  33. Cui, Y., Yu, Y., Cai, Z. & Wang, D. Optimizing road network density considering automobile traffic efficiency: theoretical approach. J. Urban Plan. Dev. 148, 04021062 (2022).

    Article  Google Scholar 

  34. Liao, S.-M., Cheng, C.-H. & Chen, L.-S. The planning and construction of a large underpass crossing urban expressway in Shanghai: an exemplary solution to the traffic congestions at dead end roads. Tunn. Undergr. Space Technol. 81, 367–381 (2018).

    Article  Google Scholar 

  35. Goto, A. & Nakamura, H. A study on appropriate road spacing for the functionally hierarchical network planning. Transp. Res. Procedia 25, 3817–3825 (2017).

    Article  Google Scholar 

  36. Thornton, L. E. et al. Operationalising the 20-minute neighbourhood. Int. J. Behav. Nutr. Phys. Act. (2022).

    Article  Google Scholar 

  37. Lynch, K. & Rodwin, L. A theory of urban form. J. Am. Inst. Plann. 24, 201–214 (1958).

    Article  Google Scholar 

  38. Campbell, S. Green cities, growing cities, just cities?: urban planning and the contradictions of sustainable development. J. Am. Plann. Assoc. 62, 296–312 (1996).

    Article  Google Scholar 

  39. Burton, E. The compact city: just or just compact? A preliminary analysis. Urban Stud 37, 1969–2006 (2000).

    Article  Google Scholar 

  40. Jabareen, Y. R. Sustainable urban forms: their typologies, models, and concepts. J. Plan. Educ. Res. 26, 38–52 (2006).

    Article  Google Scholar 

  41. Oliveira, V. & Pinho, P. Evaluation in urban planning: advances and prospects. J. Plan. Lit. 24, 343–361 (2010).

    Article  Google Scholar 

  42. Lichfield, N., Kettle, P. & Whitbread, M. Evaluation in the Planning Process: The Urban and Regional Planning Series Vol. 10 (Elsevier, 2016).

  43. Christiano, P. F. et al. Deep reinforcement learning from human preferences. Adv. Neural Inf. Process. Syst. 30 (2017).

  44. Koster, R. et al. Human-centred mechanism design with democratic AI. Nat. Hum. Behav. 6, 1398–1407 (2022).

  45. Zheng, S., Trott, A., Srinivasa, S., Parkes, D. C. & Socher, R. The AI economist: taxation policy design via two-level deep multiagent reinforcement learning. Sci. Adv. 8, eabk2607 (2022).

  46. Mohammadi, N. & Taylor, J. E. Thinking fast and slow in disaster decision-making with smart city digital twins. Nat. Comput. Sci. 1, 771–773 (2021).

    Article  Google Scholar 

  47. Schulman, J., Wolski, F., Dhariwal, P., Radford, A. & Klimov, O. Proximal policy optimization algorithms. Preprint at (2017).

  48. Yao, J., Murray, A. T., Wang, J. & Zhang, X. Evaluation and development of sustainable urban land use plans through spatial optimization. Trans. GIS 23, 705–725 (2019).

    Article  Google Scholar 

  49. Kipf, T. N. & Welling, M. Semi-supervised classification with graph convolutional networks. International Conference on Learning Representations (2017).

  50. Zheng, Y. tsinghua-fib-lab/drl-urban-planning: Release v0.1 Zenodo (2023).

Download references


This work was supported in part by the National Key Research and Development Program of China under grant 2020AAA0106000 to Y.L. and the National Natural Science Foundation of China under U1936217, U20B2060 and 61971267 to Y.L. This work was supported in part by Tsinghua-Toyota Joint Research Institute Inter-disciplinary Program to L.Z. and Tsinghua-Cambridge Joint Research Initiative Fund to L.Z. The funders had no role in the study design, data collection and analysis, decision to publish or preparation of the manuscript. We are also grateful for the insightful discussion with Y. Yuan and S. Zheng at Tsinghua University.

Author information

Authors and Affiliations



Y.Z., L.Z. and Y. Li jointly launched this research. Y.Z., Y. Lin, L.Z. and Y. Li contributed ideas. Y.Z., Y. Lin and Y. Li designed the research methods and provided the research outline. Y.Z. developed the DRL framework. Y.Z. and Y. Lin performed the experiments. Y. Lin, L.Z., T.W., D.J. and Y. Li provided critical revisions. D.J. and Y. Li managed the project. All authors jointly analyzed the results and participated in the writing of the manuscript.

Corresponding author

Correspondence to Yong Li.

Ethics declarations

Competing interests

The authors declare no competing interests.

Peer review

Peer review information

Nature Computational Science thanks Paolo Santi, Weinan Zhang, Thomas W. Sanchez and the other, anonymous, reviewer(s) for their contribution to the peer review of this work. Primary Handling Editor: Fernando Chirigati, in collaboration with the Nature Computational Science team. Peer reviewer reports are available.

Additional information

Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Extended data

Extended Data Fig. 1 Problem formulation of community-level spatial planning.

The community-level spatial planning is formulated as a two-stage sequential decision-making problem. In the first stage of land use planning, the agent places different functionalities and open spaces until all the planning needs are satisfied. A reward rL regarding the layout efficiency of all the land use as a whole is returned after the entire community is filled. The result of land use planning serves as the initial conditions of the second stage of road planning, where one land use boundary is selected at each step and planned as a road segment. After a predefined termination step, a reward rR considering the efficiency of road transportation is returned, and all intermediate steps have a reward of 0. Please refer to Supplementary Table 1 for the meaning of different colors.

Extended Data Fig. 2 Reformulation of community spatial planning with a contiguity graph.

a, Land use planning. A graph is constructed based on the contiguity relationship between urban geographical elements. Nodes consist of three different categories, including land (L), segment (S), and junction (J). Land can be vacant land to be planned or already planned land use. Segment can be a road or a land use boundary. Junction is the intersection between roads and land use boundaries. Two nodes are connected with an edge if the underlying geographical elements touch each other. There are five categories of edges in total, including L-L, L-S, L-J, S-S, and S-J. In the stage of land use planning, the agent selects one L-J edge that decides the location to place a given land use type. In the figure as an example, we select the edge between L2 and J4, thus a block in L2 and near J4 is sliced and assigned as a newly planned land use type. After each step, new urban geographical elements are added and contiguity relationships change, thus a different graph with a distinct topology will be constructed at the next step. b, Road planning. Graph in the road planning task is defined in the same way as the land use planning task. At each step, the agent selects one S node that is currently a land use boundary, and plans a road at its location. In the figure, for example, we select S10, which is the boundary of L2 and L4 from three feasible candidates (S9, S10, and S12), and replace it with a road segment. In the next step, the node attribute of S10 changes, that is, its type changes from boundary to road, and two feasible candidates are left (S9 and S12).

Extended Data Fig. 3 Overview of the proposed framework.

Our framework consists of two separate policy networks (b and d) that take actions for the land use planning task (e) and road planning task (f) respectively, and share a GNN state encoder (a) with a value network (c) that estimates the effect of the current planning result. a, A GNN-based state encoder takes the contiguity graph states as input and learns representations of nodes, edges, and the whole graph. b, A land use policy network utilizes the obtained edge embeddings and scores each edge with a MLP for edge selection. d, Similarly, a road policy network scores each node from the obtained node embeddings. c, A value network containing one fully-connected layer predicts the performance of the current spatial plan with the graph embedding. e, The spatial planning environment receives actions on the contiguity graph, places land use or road accordingly in actual geographical space, and transforms it into states in a graph form.

Supplementary information

Supplementary Information

Supplementary notes, Figs. 1–16 and Tables 1–5.

Reporting Summary

Peer Review File

Source data

Source Data Fig. 1

Statistical source data.

Source Data Fig. 2

Statistical source data.

Source Data Fig. 3

Statistical source data.

Source Data Fig. 4

Statistical source data.

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Zheng, Y., Lin, Y., Zhao, L. et al. Spatial planning of urban communities via deep reinforcement learning. Nat Comput Sci 3, 748–762 (2023).

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI:

This article is cited by


Quick links

Nature Briefing AI and Robotics

Sign up for the Nature Briefing: AI and Robotics newsletter — what matters in AI and robotics research, free to your inbox weekly.

Get the most important science stories of the day, free in your inbox. Sign up for Nature Briefing: AI and Robotics