--- title: Generative Design description: Evolutionary algorithms, multi-objective optimization, design space exploration, fitness function design, population-based methods, and generative workflows for AEC computational design version: 1.0.0 tags: [generative, evolutionary, optimization, genetic-algorithm, NSGA-II, design-space, fitness] auto_activate: true user_invocable: true invocation: /generative-design --- # Generative Design for AEC Computational Design ## 1. Generative Design Paradigm ### 1.1 Definition and Scope Generative design is a computational design methodology in which a designer defines a problem through goals, constraints, and variable parameters, and an algorithmic system autonomously generates, evaluates, and evolves candidate solutions across a defined design space. Unlike traditional design where the human produces every solution manually, generative design shifts the designer's role from direct form-maker to curator of outcomes — defining *what* is desired rather than *how* to achieve it. In the AEC context, generative design applies to problems ranging from single-building floor plan layouts and structural topologies to neighborhood-scale massing studies and infrastructure routing. The common thread is a design space too large for exhaustive manual exploration. ### 1.2 Distinction from Parametric Design The confusion between parametric and generative design is pervasive. The distinction is fundamental: | Aspect | Parametric Design | Generative Design | |---|---|---| | **Core action** | Define relationships between parameters | Explore the solution space algorithmically | | **Designer's role** | Adjust sliders, observe outcomes | Define objectives and constraints, curate results | | **Output** | One solution per parameter state | Population of diverse candidate solutions | | **Search method** | Manual, intuition-driven | Automated, algorithm-driven | | **Model requirement** | Parametric model with exposed variables | Parametric model + fitness function + solver | | **Typical scale** | Dozens to hundreds of manual explorations | Thousands to millions of evaluated candidates | A parametric model is a *prerequisite* for generative design — it provides the mechanism by which the solver manipulates geometry. But parametric design alone does not search; it merely responds to human input. Generative design automates the search. ### 1.3 The Generate-Evaluate-Evolve Loop Every generative design process follows a three-phase loop: 1. **Generate** — The solver creates candidate solutions by sampling or evolving design variable values within defined ranges. In evolutionary approaches, this involves applying genetic operators (crossover, mutation) to parent solutions. 2. **Evaluate** — Each candidate is assessed against one or more fitness functions. This is typically the computational bottleneck: running energy simulations, structural analyses, daylight calculations, or spatial adjacency checks for every individual in every generation. 3. **Evolve** — Based on evaluation results, the solver selects better-performing candidates and uses them to produce the next generation. Over many iterations, the population converges toward high-performing regions of the design space. This loop continues until convergence criteria are met: a generation limit is reached, fitness improvements plateau below a threshold, or population diversity drops below a minimum. ### 1.4 When to Use Generative Design Generative design is appropriate when: - The design space is large (more than 5-10 independent variables) - Multiple conflicting objectives must be balanced simultaneously - Optimal or near-optimal performance is critical (structural efficiency, energy, cost) - The relationship between variables and outcomes is non-linear and non-intuitive - The designer needs evidence-based justification for design decisions - Time exists for computational exploration (hours to days of compute) Generative design is **not** appropriate when: - The problem is well-understood and a known heuristic suffices - Only one or two variables are being tuned (manual slider adjustment is faster) - Evaluation is extremely expensive and no surrogate model is feasible - Aesthetic or experiential qualities dominate and resist quantification - The parametric model is unstable or produces invalid geometry frequently ### 1.5 Design Agency and Authorship The designer retains authorship because they define the problem, construct the fitness landscape, set constraints, and select solutions. The algorithm is a tool with no intent. However, generative design shifts creative decisions upstream: defining what matters (fitness functions), what is possible (variable ranges), and what is acceptable (feasibility thresholds). This demands deeper understanding of design performance than traditional workflows. ### 1.6 Human-in-the-Loop vs. Fully Automated Generation **Fully automated**: Solver runs autonomously from initialization to convergence. Designer intervenes only at setup and selection. Appropriate for well-defined problems with reliable fitness functions. **Human-in-the-loop (IEC)**: Designer evaluates candidates subjectively during optimization, guiding evolution toward aesthetically or experientially desirable outcomes. The hybrid approach — automated fitness for quantifiable metrics, human selection for qualitative criteria — is often most productive in practice. --- ## 2. Evolutionary Algorithm Fundamentals ### 2.1 Genetic Algorithm (GA) — Core Framework The Genetic Algorithm is the foundational evolutionary optimization method used in AEC generative design. Inspired by Darwinian natural selection, it maintains a population of candidate solutions that evolve over generations through selection, crossover, and mutation. #### 2.1.1 Encoding Schemes The encoding (genotype representation) determines how design variables are stored and manipulated: **Binary encoding**: Variables as bit strings (e.g., 8-bit = 0-255). Simple operators but suffers from Hamming cliffs and imprecision for continuous variables. **Real-valued encoding**: Variables as floating-point numbers directly. Standard for AEC — design variables (dimensions, angles, positions) are inherently continuous. Used by all major Grasshopper solvers. **Permutation encoding**: For ordering problems (room sequencing, scheduling). Requires order-preserving operators (PMX, OX, CX). **Tree/graph encoding**: For evolving solution topology itself (bracing patterns, connectivity graphs). Enables topological innovation but complex to implement. #### 2.1.2 Selection Methods Selection determines which individuals become parents for the next generation: **Tournament selection**: Randomly pick *k* individuals (tournament size, typically k=2 to 7), select the best. Larger *k* increases selection pressure. This is the most commonly used method in AEC tools — simple, efficient, no global fitness sorting required. **Roulette wheel (fitness-proportionate) selection**: Selection probability proportional to fitness. Problem: premature convergence when one individual dominates. **Rank-based selection**: Selection probability proportional to rank rather than raw fitness. Avoids scaling issues of roulette wheel. **Stochastic universal sampling (SUS)**: Like roulette wheel but uses equally spaced pointers, reducing selection variance. #### 2.1.3 Crossover (Recombination) Operators Crossover combines genetic material from two parents to produce offspring: **Single-point crossover**: Choose a random point; offspring gets genes from parent A before the point and parent B after. **Two-point crossover**: Two random points; segment between points from one parent, rest from the other. Better gene block preservation. **Uniform crossover**: Each gene independently chosen from either parent with equal probability. Maximum mixing — good when variables are independent. **Simulated Binary Crossover (SBX)**: Standard for NSGA-II. Operates directly on real numbers. Distribution index eta_c (typically 2-20) controls offspring distance from parents. Higher eta_c = offspring closer to parents (exploitation); lower = larger jumps (exploration). **Blend Crossover (BLX-alpha)**: Offspring sampled uniformly from [min(p1,p2) - alpha*d, max(p1,p2) + alpha*d]. Alpha=0.5 is typical. #### 2.1.4 Mutation Operators Mutation introduces random variation to maintain diversity: **Bit-flip mutation**: For binary encoding. Each bit has probability 1/L of flipping. **Gaussian mutation**: For real-valued encoding. Add N(0, sigma) noise to each gene. Most common mutation in AEC problems. Sigma can be fixed or adaptive. **Polynomial mutation**: Used in NSGA-II. Distribution index eta_m (typically 20-100) controls perturbation magnitude. Higher eta_m = smaller perturbations. **Swap / Scramble mutation**: For permutation encoding. Swap exchanges two positions; scramble randomly rearranges a subset. **Adaptive mutation**: Rate or step size adjusts during the run — higher early (exploration), lower later (exploitation). #### 2.1.5 Elitism Elitism ensures the best individual(s) from the current generation survive unchanged into the next generation. Without elitism, the best solution found can be lost through crossover and mutation. Typically, the top 1-5% of the population is preserved. NSGA-II implements elitism through its combined parent+offspring selection scheme. ### 2.2 Population Sizing Population size determines the balance between solution diversity and computational cost: - **Rule of thumb**: 50-200 individuals for most AEC problems - **Small populations (20-50)**: Faster per generation but higher risk of premature convergence and loss of diversity. Acceptable for problems with few variables (<10) and smooth fitness landscapes - **Medium populations (50-200)**: Standard range. Provides sufficient diversity for most problems with 10-50 variables - **Large populations (200-1000)**: Necessary for highly multimodal landscapes, many-objective problems, or when each variable has a large range. Computationally expensive if evaluation is slow - **Adaptive population sizing**: Start small, increase if diversity drops. Some frameworks support this The critical trade-off: larger populations explore more of the design space per generation but require more evaluations per generation. If a single evaluation takes 30 seconds (e.g., energy simulation), a population of 200 requires nearly 2 hours per generation. ### 2.3 Convergence Criteria Optimization terminates when: - **Generation limit**: Fixed number of generations (e.g., 50-500). Simple and predictable but may stop too early or waste time - **Fitness plateau**: Average or best fitness has not improved by more than epsilon over the last N generations. Typical: epsilon = 0.1%, N = 10-20 generations - **Diversity threshold**: Population diversity (measured by genotypic or phenotypic distance) drops below a minimum, indicating convergence - **Computational budget**: Total evaluation count reaches a limit (e.g., 10,000 evaluations). Useful when evaluation cost is the binding constraint - **Target fitness**: A satisfactory fitness value is reached. Rarely used in multi-objective optimization ### 2.4 Exploration vs. Exploitation Balance The fundamental tension in optimization: - **Exploration**: Searching broadly across the design space for promising regions. Promoted by: large populations, high mutation rates, low selection pressure, diverse initialization - **Exploitation**: Intensifying search near known good solutions. Promoted by: small populations, low mutation rates, high selection pressure, elitism Effective optimization requires both. Early generations should favor exploration; later generations should favor exploitation. This can be achieved through: - Adaptive operator rates (decreasing mutation rate over time) - Island models (separate subpopulations with periodic migration) - Restart strategies (re-initialize if stuck) - Niching methods (fitness sharing, clearing) to maintain diverse subpopulations ### 2.5 Schema Theorem and Building Blocks Holland's Schema Theorem: short, low-order, above-average schemata (building blocks) receive exponentially increasing trials in subsequent generations. Implication for encoding: variables that interact strongly should be positioned near each other in the genotype to reduce disruption by crossover. --- ## 3. Multi-Objective Optimization ### 3.1 Pareto Optimality Most AEC design problems involve multiple conflicting objectives. A building cannot simultaneously minimize cost, minimize energy consumption, and maximize floor area — these objectives conflict. Multi-objective optimization acknowledges this and seeks the set of best trade-off solutions. **Pareto dominance**: Solution A dominates solution B if A is at least as good as B in all objectives and strictly better in at least one. A solution that is not dominated by any other solution in the population is called **non-dominated** or **Pareto optimal**. **Pareto front**: The set of all non-dominated solutions forms the Pareto front (or Pareto frontier) in objective space. This front represents the best achievable trade-offs — improving one objective requires worsening another. ### 3.2 Pareto Front Visualization For 2 objectives: a 2D scatter plot with each axis representing one objective. The Pareto front appears as a curve along the boundary of the feasible region. For 3 objectives: a 3D scatter plot or parallel coordinate plot. The Pareto front is a surface. For 4+ objectives: direct visualization is impossible. Use parallel coordinate plots, radar charts, heatmaps, or dimensionality reduction (PCA, t-SNE) to explore the solution set. Wallacei provides built-in multi-dimensional Pareto analytics. ### 3.3 NSGA-II (Non-dominated Sorting Genetic Algorithm II) NSGA-II (Deb et al., 2002) is the most widely used multi-objective evolutionary algorithm in AEC. It is the engine behind Wallacei and many other tools. **Key mechanisms**: 1. **Non-dominated sorting**: The combined parent+offspring population is sorted into fronts. Front 1 contains all non-dominated solutions. Front 2 contains solutions dominated only by Front 1, and so on 2. **Crowding distance**: Within each front, solutions are ranked by crowding distance — a measure of how isolated a solution is in objective space. Solutions with larger crowding distances are preferred to maintain diversity along the Pareto front 3. **Selection**: Binary tournament selection using (front rank, crowding distance) as the comparison key. Lower front rank is better; within the same front, higher crowding distance is better 4. **Elitism**: The next generation is filled by taking solutions front-by-front from the combined population until the population size is reached. The last front that fits may be truncated using crowding distance **Typical NSGA-II parameters for AEC**: - Population size: 50-200 - Crossover: SBX with eta_c = 20, probability = 0.9 - Mutation: Polynomial with eta_m = 20, probability = 1/n (n = number of variables) - Generations: 50-300 ### 3.4 SPEA2 (Strength Pareto Evolutionary Algorithm 2) SPEA2 maintains an external archive of non-dominated solutions. Fitness based on domination strength and density (k-th nearest neighbor distance). Often produces better-distributed Pareto fronts than NSGA-II for many-objective problems. Available in Octopus for Grasshopper. ### 3.5 MOEA/D (Multi-Objective Evolutionary Algorithm based on Decomposition) Decomposes the multi-objective problem into single-objective subproblems using weight vectors. Each subproblem optimized simultaneously with information sharing between neighbors. Efficient for many-objective problems (4+) where NSGA-II's crowding distance becomes less effective. ### 3.6 Trade-Off Analysis and Decision-Making The Pareto front provides options, not answers. Decision-making methods: - **Knee point selection**: Point of maximum curvature where marginal trade-offs are most balanced - **Aspiration-based**: Define acceptable thresholds per objective, select solutions satisfying all - **TOPSIS**: Rank by distance to ideal point and from anti-ideal point - **Clustering**: Group similar Pareto-optimal solutions, select representatives. Wallacei provides K-means and agglomerative clustering - **Designer preference**: Review phenotype geometry and select on qualitative judgment ### 3.7 Weighted Sum vs. Epsilon-Constraint Methods **Weighted sum**: F = w1*f1 + w2*f2 + ... + wn*fn. Simple but cannot find solutions on non-convex Pareto front regions. Galapagos uses this approach. **Epsilon-constraint**: Optimize f1 subject to f2 <= epsilon_2, f3 <= epsilon_3. Can find non-convex Pareto front solutions. Requires choosing which objective to optimize and setting constraint bounds. --- ## 4. Fitness Function Design ### 4.1 The Most Critical Step The fitness function is the single most consequential decision in generative design. It encodes what the designer values. A poorly designed fitness function will efficiently produce solutions that are technically "optimal" but designically irrelevant. The fitness function is the designer's proxy — it must faithfully represent design intent. ### 4.2 Common AEC Fitness Criteria #### Structural Objectives - **Total weight / material volume**: Minimize structural material usage (steel tonnage, concrete volume) - **Maximum deflection**: Minimize peak deflection under service loads (L/360, L/240 limits) - **Stress utilization ratio**: Minimize peak stress/capacity ratio across all members (target: 0.6-0.85 range) - **Material efficiency**: Maximize load-carried-per-unit-material (structural efficiency index) - **Natural frequency**: Maximize first natural frequency to avoid resonance (target: >3 Hz for floors) - **Redundancy**: Maximize structural redundancy (number of alternative load paths) #### Environmental Objectives - **Annual daylight hours**: Maximize useful daylight illuminance (300-3000 lux) across floor area - **Solar heat gain**: Minimize unwanted solar gain in cooling season; maximize in heating season - **Energy use intensity (EUI)**: Minimize annual energy demand per unit floor area (kWh/m2/year) - **View factor**: Maximize percentage of floor area with quality views to exterior - **Daylight autonomy (DA)**: Maximize percentage of occupied hours when daylight exceeds 300 lux - **Useful Daylight Illuminance (UDI)**: Maximize hours in 100-2000 lux range (avoid glare) - **Embodied carbon**: Minimize total embodied CO2 of structural and envelope materials (kgCO2e) #### Spatial Objectives - **Area efficiency**: Maximize net-to-gross floor area ratio (usable area / total area) - **Circulation ratio**: Minimize circulation area relative to total area (target: 15-25%) - **Adjacency satisfaction**: Maximize satisfaction of programmatic adjacency requirements (percentage of required adjacencies achieved) - **Daylight factor**: Maximize average daylight factor across occupied spaces (target: >2%) - **Spatial connectivity**: Maximize/minimize integration values from space syntax analysis - **Room proportion**: Minimize deviation from target aspect ratios (1:1 to 1:1.5 for offices) #### Fabrication Objectives - **Panel planarity**: Minimize maximum deviation of quad panels from planar (target: 300 lux) 3. Minimize material cost — proportional to total louver surface area (cost/m2 of aluminum louver) **Solver**: Wallacei, NSGA-II, population 80, 60 generations. Each evaluation requires a Radiance simulation (~10 seconds) and an EnergyPlus simulation (~30 seconds). Total runtime: approximately 27 hours. **Results**: Pareto front reveals that deeper louvers dramatically reduce cooling load but at diminishing returns beyond 0.6m depth. View and daylight preservation is best achieved with variable-depth zoning — deeper louvers at eye level and shallower louvers above. The cost-optimal region suggests 0.45m depth at 0.6m spacing as the knee point of the cost-performance trade-off. ### 8.3 Structural Form-Finding Optimization **Problem**: Optimize the shape of a long-span roof shell (50m x 50m footprint) for a sports hall. **Variables (12 total)**: - Control point heights for a 4x4 NURBS surface: 16 control points, of which 4 corners are fixed and edge midpoints are symmetric, yielding 12 free variables - Height range: 3m to 20m per control point **Objectives**: 1. Minimize total structural weight (steel shell + supporting structure) — computed via Karamba3D finite element analysis 2. Minimize maximum deflection under dead + live load combination 3. Maintain minimum interior clearance of 8m (constraint, handled via penalty) **Solver**: Octopus (HypE), population 120, 100 generations. Each evaluation requires a Karamba3D analysis (~2 seconds). Total runtime: approximately 6.5 hours. **Results**: The Pareto front shows a clear trade-off between weight and deflection. Minimum-weight solutions tend toward anticlastic (saddle-shaped) surfaces that carry load efficiently through membrane action but have higher deflections. Minimum-deflection solutions tend toward synclastic (dome-like) shapes that are stiffer but heavier. The knee point reveals a hybrid form — a shallow dome with edge curvature — that achieves 85% of the minimum weight at only 120% of the minimum deflection. This form was not intuitively predictable. --- ## 9. Advanced Topics ### 9.1 Interactive Evolutionary Computation (IEC) In IEC, the human designer serves as the fitness function for some or all objectives. Each generation, the designer views rendered phenotypes and selects preferred solutions. Evolution is guided by aesthetic, experiential, or cultural criteria that resist quantification. Challenges: human fatigue limits populations to 10-20 individuals and runs to 20-30 generations. Solutions: pre-filter with computational fitness to reduce the set the human must evaluate; use surrogate models trained on human selections to automate subsequent generations. ### 9.2 Co-Evolution Multiple populations evolve simultaneously, with fitness depending on interactions between populations. Applications in AEC: - **Structure-envelope co-evolution**: The structural system and the facade system evolve in separate populations, with fitness evaluated on the combined design - **Building-landscape co-evolution**: Building massing and site design evolve together - **Supply-demand co-evolution**: Space layouts and circulation networks evolve interdependently Co-evolution can discover emergent synergies between subsystems that would be missed by optimizing them sequentially. ### 9.3 Novelty Search Instead of optimizing fitness, novelty search rewards solutions that are *different* from all previously found solutions. The archive of encountered solutions grows over time, and fitness is defined as the distance from the nearest archived solution in behavior space. Application: when the fitness landscape is deceptive (local optima trap conventional optimization), novelty search explores more broadly and often finds globally optimal solutions as a side effect. In AEC: generating diverse facade patterns, exploring unusual structural topologies, or discovering non-obvious spatial configurations. ### 9.4 MAP-Elites (Quality-Diversity) MAP-Elites divides the design space into a grid of behavioral niches (defined by user-chosen feature dimensions) and seeks the highest-performing solution in each niche. The result is a map of the design space showing the best achievable fitness for every combination of behavioral features. Example: for a tower design, the feature dimensions might be (building height, floor plate aspect ratio). MAP-Elites fills a 2D grid where each cell contains the best-performing tower with that height and aspect ratio. The designer can browse the map to understand how performance varies across the design space, not just at the optimum. ### 9.5 Neuroevolution Using evolutionary algorithms to optimize neural network architectures and weights. Applications in AEC: - Evolving neural network controllers for adaptive building systems (lighting, HVAC) - Evolving generative neural networks (GANs, VAEs) that produce building geometries - Evolving surrogate models that predict simulation outcomes ### 9.6 Transfer Learning Between Design Problems Knowledge from one optimization can bootstrap another. If a floor plan optimization for Building A converges on effective layout strategies, the final population can seed the initial population for Building B's optimization (with modified constraints). This reduces convergence time and improves solution quality for repeated problem types (e.g., a firm designing many office buildings with similar programs). Strategies: - **Population seeding**: Use solutions from a previous run as part of the initial population - **Surrogate transfer**: Train a surrogate model on evaluations from previous runs and use it to guide the new optimization - **Operator transfer**: Learn effective crossover/mutation distributions from previous runs and apply them to the new problem --- ## Quick Reference: Generative Design Decision Tree ``` Is the problem single-objective? YES -> Is evaluation fast (<1 sec)? YES -> Galapagos (GA or SA) NO -> Opossum (surrogate-based) NO -> How many objectives? 2-3 -> Wallacei (NSGA-II) 4+ -> Octopus (HypE/SPEA2) Is evaluation fast (<1 sec)? YES -> Direct evaluation NO -> Surrogate-assisted (Opossum or custom Kriging) Are qualitative criteria important? YES -> Human-in-the-loop (IEC) or hybrid NO -> Fully automated ``` ## Common Pitfalls 1. **Fitness function does not reflect design intent**: The optimizer finds solutions that score well but are designically poor. Solution: iterate on fitness functions with manual spot-checks. 2. **Premature convergence**: Population loses diversity before finding the global optimum. Solution: increase population, add diversity maintenance, check for dominant genes. 3. **Unstable parametric model**: Many evaluations crash or produce invalid geometry. Solution: add robust error handling, constrain variables more tightly, use decoder approaches. 4. **Overfitting to the fitness function**: Solutions exploit weaknesses in the evaluation method. Solution: validate top solutions with independent analysis tools. 5. **Ignoring qualitative criteria**: Generative design optimizes what you measure. If you do not measure aesthetics, the optimizer ignores aesthetics. Solution: human-in-the-loop, post-optimization curation. 6. **Insufficient generations**: Optimization stops before convergence. Solution: monitor convergence metrics, increase generation count. 7. **Too many variables**: Curse of dimensionality prevents effective search. Solution: sensitivity analysis to fix unimportant variables, decompose the problem.