Clear Sky Science · en

Auto-arrange buildings in urban planning with DQN

· Back to index

Why Smarter Building Layouts Matter

As cities grow taller and denser, it becomes harder to ensure that apartment windows still see the sun and that towers are safely spaced apart. Urban designers typically juggle these demands by hand, running slow computer simulations and tweaking layouts again and again. This study introduces an artificial intelligence (AI) system that can automatically arrange high-rise buildings on a piece of land so that homes get enough winter sunlight and towers keep a safe distance from each other, potentially saving planners enormous time while improving the livability of crowded cities.

Figure 1
Figure 1.

City Growth and the Sunlight Squeeze

Rapid urbanization, especially in megacities like Beijing and Shanghai, pushes buildings closer together and higher into the sky. Yet national rules in China require that homes receive a minimum amount of sunshine on midwinter days and that high-rise buildings be separated by specific safety distances. Today, architects use professional design software to meet these rules, drawing building footprints, running detailed sunlight simulations, and moving towers around until both sunshine and spacing limits are satisfied. This process depends heavily on expert experience and many rounds of trial and error, which makes it slow and hard to scale when many land parcels and design alternatives must be tested.

Teaching a Neural Network to Predict Sunlight

A major obstacle in automating this work is that accurate sunlight simulation is computationally expensive. To overcome this, the researchers first trained a special kind of neural network, called a convolutional auto-encoder, to act as a fast “stand-in” for the simulation tool. They generated more than a thousand sample layouts in Autodesk Revit for Beijing’s midwinter conditions and recorded, for each point on the land, how many minutes of sun it received over the day. These sunlight maps were converted into grayscale images and paired with simple images representing building heights and footprints. The AI learned to translate a building layout image into its corresponding sunlight image, achieving average errors of less than three minutes of sunshine per point while running about one hundred times faster than the original simulation.

Letting an AI Agent Place Buildings Step by Step

With a rapid sunlight predictor in hand, the team tackled the harder problem: automatically deciding where to put each building. They framed this as a step-by-step game for a learning agent. Starting from an empty plot, the agent places one building at a time and can nudge it up, down, left, or right on a grid. After each move, the fast neural network estimates sunshine, and the system computes how close the building is to its neighbors and the plot boundaries. The agent receives a reward when it finds a position that satisfies both the minimum sunlight requirement on the south-facing windows and the minimum distance requirement between buildings, and it is penalized for overlaps or cramped spacing. Over many simulated attempts, a Deep Q-Network—a common reinforcement learning method—learns a strategy that consistently leads to valid, efficient layouts.

How the System Performs Against Other Methods

The researchers tested their approach on dozens of different land parcels containing between five and twelve buildings and compared it with three baselines: random placement, a simple greedy strategy, and a genetic algorithm. Random placement rarely produced workable designs, and even the tailored heuristic and the evolutionary search lagged behind the learning agent. The AI system achieved a 100 percent success rate in producing layouts that met both sunshine and distance rules, needed fewer moves per building, and arranged towers more compactly without sacrificing access to light. On average, its layouts delivered longer sunshine durations at ground-floor windows than the alternatives, and a full arrangement for a parcel could be generated in just a few seconds, making large-scale exploration of options feasible for everyday planning tasks.

Figure 2
Figure 2.

What This Means for Future Urban Design

In essence, the study shows that combining a fast learned model of sunlight with a learning-based decision maker can reliably lay out buildings that satisfy strict regulatory constraints while using land efficiently. Although the current tool focuses only on winter sun and safety spacing—and is tuned to Beijing’s climate—it already serves as a powerful prototype: planners can feed in a set of candidate buildings and obtain multiple compliant layout suggestions almost instantly. Future versions could extend the same idea to include wind, views, noise, or local rules in other cities, turning building arrangement from a slow manual craft into an interactive partnership between human designers and AI assistants.

Citation: Lin, P., Shi, G., Hu, C. et al. Auto-arrange buildings in urban planning with DQN. Sci Rep 16, 11406 (2026). https://doi.org/10.1038/s41598-026-40788-w

Keywords: urban planning AI, building layout, sunlight optimization, reinforcement learning, generative models