A hypergraph model shows the carbon reduction potential of effective space use in housing

Residential building floor plan repository
We assembled a reference library of ~ 1444 real-world floor plans, combining award-winning residential floor plans from North American and European contexts from the literature45,46,47 and online databases48 with residential developer plans. The library contains unique real-world floor plans (and their mirrored geometry). Using publicly available data from real-estate brokers and public housing providers, the dataset represents a small subset of a city’s actual apartments. However, we curated the library to encompass a variety of different designs and to represent the prevalent apartment layouts of each city, from studio apartments to large multi-room apartment units and across price ranges from public housing to high-end apartments. From the reference library, dataset floorplans are sampled to map the distribution of a number of bedrooms of the real-world data surveyed in Singapore49, New York50, and Zurich51. As almost 80% of residents in Singapore live in government-provided housing52 that is built in a standardized fashion, there is less variety in the building stock. This is reflected in a smaller dataset than from Zurich or New York. We compare the real-world data with our dataset in Fig. 5.

Distribution of the number of rooms in the cities of Zurich, New York, and Singapore in 2022 by number of bedrooms (a), compared with our reference dataset of analyzed floorplans (b). Histogram plot of apartment area in each city (c) and the area normalized per number of bedrooms in an apartment (d).
Reference apartment buildings for artificial floor plan insertion
To test the artificial generation of floor plans and the application of reference floor plans to new boundary conditions, we gathered reference buildings from three different cities. Four buildings from Singapore, Zurich, and New York were chosen to qualitatively reflect the contemporary residential housing architecture of their city. For reasons of data protection for the residents, as well as the architects, we have anonymized the buildings and refer to them as Buildings A, B, C, and D from their respective cities. The building boundaries, as well as the floor plans from Zurich, New York, and Singapore, that we used to benchmark the artificially generated floor plans, can be accessed via the supplemental material (Supplementary Figs. 8–10).
Creation of hypergraphs
We introduce the hypergraph as a shape descriptor for building floor plans. Graph-based data structures have been applied successfully to represent and generate structured data in biology53, chemistry54, robotics55, building structures56, computer games57, and urban planning58. For the design of building floor plans, graph-based data structures have been deployed to represent wall lines and adjacency graphs14. The presented hypergraphs are a combination between an access graph and a subdivision graph. While previous work used the explicit geometric structure of, for example, a molecule, wall segment, or street intersection, as a part of a graph, the hypergraph here is a combination of explicit geometry through adjacency of specific rooms and implicit geometric representation through the subdivision graph. Both graphs can be accessed and analyzed independently via edge and node type specifications in our custom data format.
The BSP29 tree of the subdivision graph simultaneously represents the final geometry, as well as its step-by-step construction. Each node corresponds to an area (or ratio) and a subdivision angle α, with (directed) edges connecting the child nodes to the parent node that was subdivided (Fig. 6). Our BSP implementation allows for subdivision of polygons with 3 or more boundary vertices and includes convex and (most) concave polygons. In the BSP tree, the root node specifies the overall area of the subdivision graph. Subsequent children (of type “subdivision”) always have degree 2 and assigned areas, as well as a subdivision angle alpha. Leaf nodes of the subdivision graph have a degree 0 on the subdivision graph, and the area is assigned a programmatic type of either (living, bedroom, kitchen, bath, extra, foyer) and a unique ID. The access graph is defined by lists of unique IDs in the leaf nodes. Different hypergraphs are illustrated with annotated edges in Fig. 6 (and additionally in Supplementary Fig. 8). Compared to existing methods, the purely geometric nature of the hypergraph creates a direct relationship between graph and spatial form. It is an explicit and not an iterative or optimization-based process that can be computed in real-time.

Step-by-step generation of the subdivision graph (a) from area O, represented by the gray point (graph root). It is subsequently divided into areas A1 and A2 with the angle αa, A2 is divided into B1 and B2 with angle α, B2 is divided into C1 and C2 with angle αc, and A1 is divided into D1 and D2 with angle αd. The access between rooms is converted into a bidirectional graph (b) where edges connect the nodes of the rooms that are accessible between one another. Different layout subdivisions and their corresponding hypergraphs are shown in (c).
The outermost child nodes, therefore, represent the rooms in the final floor plan, while inner nodes correspond to the intermediate parent areas in the subdivision process. Even though the room adjacencies are defined geometrically through the subdivision, the access graph represents the spatial adjacency by (undirected) edges that connect the room nodes (e.g., through a door or an open wall). This dual representation of the internal organization can be captured from any given floor plan boundary. Furthermore, a mapping of both graph nodes of the subdivision and adjacency graphs to the resulting rooms allows for the recording of secondary information, such as room type. The procedure is fully reversible, meaning that a spatial floor plan layout can be encoded in a graph, and the same floor plan layout will emerge given a graph and the original boundary polygon.
Preprocessing and data preparation of floor plans
The apartment floor plans were sourced as raster images. They were input into the computer-aided design (CAD) software Rhino, where the images were traced and rooms annotated with their respective program, circulation access, façade with lists of lines, and room access (doors). We deploy the inverse of the subdivision algorithm to find the corresponding subdivision graph, and the points in the door locations to determine access via the access graph. Both graphs are combined into a hypergraph and stored together with façade, circulation, and boundary lines in a JSON database.
Implementation and visualization
We implement the geometric floor plan placement process in the commercial architectural CAD software Rhino via a custom geometry library in C# through the scripting platform Grasshopper59. For this, we utilize and extend the functionalities of the open-source linear algebra library Math.NET60 and the 2D polygon clipping and offsetting library Clipper261. For the visualization and representation of the hypergraphs, we convert the graph data structure to a NetworkX62 graph and visualize it with the force-based Kamada-Kawai algorithm63 that is applied to the nodes of the subdivision graph. The full code of the implementations, as well as sample files showcasing hypergraph creation and analysis, can be accessed via the supplementary software submission.
Limitations of the BSP subdivision graph representation
In the current BSP tree implementation, we can represent almost any geometric polygon and subdivision. Even though we were able to represent the studied buildings, there are certain limitations for apartment geometry and configuration that currently cannot be captured in the data format. Failure cases of the subdivision algorithm include highly complex non-convex boundary geometries, as well as polygonal boundaries with holes. While convex boundary geometries are guaranteed to produce a feasible result, highly concave boundary conditions do not. Typical apartment layouts, and those that we observed in our database, fall into the former category, however, this is not guaranteed, especially for synthetic datasets. On an architectural level, we limited the scope of the current implementation to single-story floor plans of multi-unit residential buildings while excluding duplex apartments and single-family homes.
Apartment validity heuristic
Even though the subdivision algorithm produces a geometrically feasible floor plan, the resulting geometry might not be spatially valid. Different failure cases exist where apartment boundaries are subdivided and produce architecturally infeasible rooms that are inaccessible or do not have access to daylight (Supplementary Fig. 2). For creating artificial floor plans that would be further used in a design context, a visual inspection of the results together with placed furniture items that visualize the scale of rooms, proved to be useful. However, for analysis of large-scale datasets automatic procedures are needed to identify feasible results. Since all hypergraphs are created from a geometrically feasible reference floor plan, we can compare the room geometry of the artificially created floor plan with the original reference floor plan. For this comparison to be computationally efficient, we utilize a scoring method that is computed from the perimeter of the room polygons. The perimeter difference score (Eq. 1) can be applied to single-room polygons (Supplementary Fig. 3), as well as whole apartment floor plans (Supplementary Fig. 4) to determine geometric changes between target and reference. It is a computationally efficient indicator of fit. For more accurate control, a more computationally intensive pathway and geometry analysis could be envisioned48. Furthermore, we can use the furniture placement algorithm to verify if an apartment is feasible by comparing the minimum required furniture to the placed furniture (Supplementary Fig. 7).
$${\delta }_{p}=\left|1-\frac{{{{\rm{L}}}}_{{SA}}{{{\rm{L}}}}_{B}\,}{{{{\rm{L}}}}_{A}{{{\rm{L}}}}_{{SB}}}\right|$$
(1)
Equation 1: Perimeter difference score δp, where LA is the perimeter of polygon A, LSA is the perimeter of the square polygon with the same area as A, LB is the perimeter of polygon B, and LSB is the perimeter of the square polygon with the same area as B.
Environmental evaluation workflow
The automated workflow was implemented in the commercial architectural CAD software Rhino and its integrated scripting platform Grasshopper59 where the generated floor plan geometry can be automatically converted to be used by the energy simulation software EnergyPlus64 and the lighting simulation tool Radiance through the Climate Studio package65. The simulations were conducted on a Windows computer with the following specifications: 64 GB Ram, Nvidia GeForce GTX 1080 Graphics card, Intel(R) Core (TM) i7-6700 K @ 4.0 GHz Processor. The full daylight and energy simulation required > 10 s of calculation time per apartment. Settings for the energy simulation of each city and settings for high and standard-performing building envelopes are listed in Table 1. For each apartment we calculated the EUI in kWh/m2/yr for both a standard and high-performance building envelope. To only compare building geometry related factors, we kept the HVAC system the same, even though in a standard building energy retrofit, a more efficient HVAC system could be installed. In the BEM, all rooms were modeled as zones with equal loads according to the ASHRAE and SIA energy templates (Table 1). In typical BEM approaches for early-stage design, zoning, and set point schedules are not differentiated by rooms in a dwelling because of the uncertainty of MEP systems and operational decisions. However, in some cities and regions, it is common to have individualized systems and controls that can be operated independently in different spaces within an apartment (e.g., bedroom cooled at night, living room cooled during the day). In these cases, the layout of the floorplan and its occupancy could impact energy use because of interactions between building physics and systems operations. While our main results do not model this scenario, we tested the impact on a few example cases to show how differentiated zoning could be modeled with our approach. As shown in Supplementary Fig. 15, the impact is relatively modest for the cases we considered. To calculate the sDA (indicating the fraction of space with more than 300 lux of daylight on average), we only looked at specific rooms in an apartment that require daylight, excluding bathrooms and extra (storage) space (Supplementary Fig. 5). Furthermore, we created a sDA score of each apartment by weighing the area of each room (Eq. 2).
$${d}_{{tot}}=\frac{{\sum }_{i=1}^{n}\left({d}_{i} * \,{A}_{i}\right)}{{\sum }_{i=1}^{n}\left({A}_{i}\right)}$$
(2)
Equation 2: To get the apartments overall daylight score \({d}_{{tot}}\) we multiply the area of each daylit space with its sDA value from our radiance simulation and divide it by the sum of the area of all daylit spaces.
Furniture placement
To spatially evaluate a floor plan, we test fit of the layout with furniture. In the computer graphics discipline, furniture placement algorithms have been widely explored using machine learning and procedural techniques20,66,67,68. The use of furniture blocks to test spatial feasibility has been used in the architectural discipline and building codes in defining minimum planning standards in different countries, especially when it comes to affordable housing69. A room is deemed feasible if it fits a certain number of predefined furniture blocks. However, the planning standards are only visual guides meant for manual placement of furniture blocks by architecture professionals and are not automated digital procedures. Inspired by the spatial scoring system developed by the City of Berlin’s public housing provider30 and the City of London’s planning standard70, we translate the manual workflow to an automated digital approach and procedurally place furniture blocks (Fig. 7a) into a floor plan, where furniture blocks are placed recursively along the boundary geometry of each room (Fig. 7b). By grouping furniture items inside a program, we can provide different simple configurations using a faster, less computationally intensive, procedural method.

Furniture blocks that have to be placed inside an apartment to create a valid 1-bedroom unit are shown in (a). A sample placement of furniture for a bedroom is shown in (b–f), where a bed and storage are placed along a room boundary, and two storage units remain unplaceable, rendering the layout infeasible. A sample layout with feasible furniture placement is shown in (g) and one with infeasible placement in (h).
Each apartment has a minimal number of furniture items that need to fit to be a valid floor plan (Supplementary Fig. 7). In the case of bedrooms and bathrooms, we distinguish between a primary room, such as a bathroom with a bathtub, and a secondary bathroom, with toilet and sink only, in the larger apartments. We used the same minimal furniture to assess floor plans from Zurich, Singapore, and New York. The workflow is very flexible and could be adjusted to include more nuanced cultural requirements. An example floor plan subdivision is valid if all required furniture can be placed (Fig. 7g). If the furniture placement is infeasible (Fig. 7h), that is an indication that the hypergraph subdivision did not create a feasible layout.
Excess area and emission delta
To show the carbon impact of excess area, and to compare it to the potential energy savings of building envelope upgrades, we compute an emission delta for each floor plan. To calculate the excess carbon from excess area, we use a floor plan furnished with a minimum furniture area. After placement of the furniture, we sum up the total furniture area and compare it to the minimum furniture area of the corresponding apartment size (Supplementary Fig. 7). We derive the total excess area from a subdivision of the furniture area with the total apartment area and the carbon emissions from excess space by multiplying the excess area with the local grid carbon content and EUI (Eqs. 3–6). This value indicates how much carbon could have been saved if the apartment was built in a more compact size with the same number of bedrooms. The emission delta of excess area and envelope upgrade (\({\varDelta }_{e}\)) is derived from Equation 7, using the EUI results of the environmental simulation. If the emission delta\({\varDelta }_{e}\) is positive, the emissions from excess space exceed the emissions that could have been saved through a high-performance building envelope. In this research, we derive excess areas by comparing apartments to their standard-sized equivalent with the same number of rooms. In addition, an occupant-centric approach can be used to derive an emission delta (\({\varDelta }_{e}\)) for different numbers of inhabitants in an apartment (Supplementary Note 1.8).
$${F}_{{tot}}=\sum_{n=1}^{n}\left({F}_{n}\right)$$
(3)
Equation 3. Furniture area. \({F}_{{tot}}\) is the total furniture area (in m2) sum of all furniture areas \({F}_{n}\) of all furniture objects inside the apartment (extra rooms count as furniture, foyer rooms do not). If the \({F}_{{tot}}\) is smaller than the minimum furniture area (Supplementary Fig. 7). If the furnishing was unsuccessful and \({F}_{{tot}}\) is clamped at the minimum furniture area.
$${A}_{e}={A}_{{apt}}-\left({F}_{{tot}} * M\right)$$
(4)
Equation 4. Excess area. \({A}_{e}\) is the excess area (in m2) derived from subtracting the sum of all furniture areas \({F}_{{tot}}\) from the total apartment area \({A}_{{apt}}\) with a multiplier buffer. A positive \({A}_{e}\) indicates an excess area (an apartment exceeding sufficiency), a value close to 0 indicates a good fit, and a value of less than 0 indicates no excess area and a compact apartment. The multiplier (M) can be adjusted to cultural contexts. We use M = 1.6 to create apartments with target areas according to the German public housing standard30: Studio 34 m2, 1 Bed 53.6 m2, 2 Bed 72.6 m2, 3 Bed 93.1 m2, 4 Bed 105.9 m2, 5 Bed 118.7 m2.
$${C}_{e}={A}_{e} * {{EUI}}_{s} * {g}_{{cc}}$$
(5)
Equation 5. Carbon emissions from excess area. \({C}_{e}\) is the excess carbon emitted from an apartment per annum (kgCO2e/a), where \({A}_{e}\) is the excess area (m2) (Eq. 4), the energy use intensity (EUI) (kWh/m2/a) derived from the energy simulation of the apartment with the standard building envelope, and \({g}_{{cc}}\) the local grid carbon content (kgCO2e/kWh).
$${\varDelta }_{e}={C}_{e}-(A * {{EUI}}_{s} * {g}_{{cc}}-A * {{EUI}}_{{hp}} * {g}_{{cc}})$$
(6)
Equation 6. Emission delta. \({\varDelta }_{e}\) is the difference between the carbon emitted from an apartment from excess space \({C}_{e}\,({{\rm{Equation}}}5),\) and the excess carbon emitted from not having an envelope upgrade, where \({A}\) is the apartment area (m2), \({{EUI}}_{s}\) the EUI in (kWh/m2/a) of the apartment with a standard envelope and \({{EUI}}_{{hp}}\) the EUI (kWh/m2/a) of the apartment with high-performance building envelope, and \({g}_{{cc}}\) the local grid carbon content (kgCO2e/kWh).
Integration of the hypergraph method with automated design workflows
Buildings are highly complex assemblies with both qualitative and quantitative attributes. Their design requires professional expertize from various disciplines, including architecture, structural engineering, and building physics, and has to balance conflicting requirements without a single, optimal solution. Spatial layout generation via the hypergraph is a first step towards automated exploration of diverse geometric layouts that can give insights into a building’s performance and artificially generate design solutions. In this research, apartments were studied in isolation from the whole building and evaluated only from a spatial, energy, and daylighting perspective. For whole building simulations, mechanical, electrical, and plumbing (MEP) and structural constraints could further influence the design and the selection of appropriate layouts.
In Supplementary Fig. 14, we outline how the hypergraph method can fit into larger architectural workflows. In the current scope of the work on multi-story residential buildings, it is assumed that apartments with the same floor plan are stacked on top of each other, similar to what we find in most real-world designs. This implies that any movement of vertical supply shafts or structural walls for different apartment layouts would apply across multiple floors and, therefore, would not be a geometric constraint that applies to an individual apartment unit. The BEM created by the hypergraph can be used to dimension and size heating, ventilation, and cooling (HVAC) systems and test different zone configurations to select configurations with favorable stacking of bathroom and kitchen zones.
Further research should address non-standard, multi-story construction and building retrofits where the stacking of layouts and structure is often not given. On a structural level, the current hypergraph implementation is limited by not differentiating the load-bearing capacity of walls inside a building layout. The structure can interface with the spatial geometric layout of an apartment on different levels. Depending on the construction system, partial sub-graphs inside the hypergraph could be used to represent non-load-bearing internal walls that divide the space or represent shear walls inside a floor plan. For this, the hypergraph could be extended, where nodes could store information beyond the area and program, such as window-to-wall ratio or material. Additional types of edges between nodes could describe physical links between room nodes, such as the structural properties of dividing wall elements.
link