Tutorial 3.3: Evolutionary Solvers
This tutorial introduces evolutionary optimization in Grasshopper using Galapagos — an algorithm that automatically searches for the best design solution by adjusting parameters and evaluating a fitness value.
Part 1: Galapagos Fundamentals
Download the Rhino and Grasshopper files to follow along this tutorial to understand how Galapagos works:
🔗 Galapagos in Grasshopper: Step-by-Step Guide — Hopific
Key takeaways from the reading:
- The component is in Params > Util (bright pink icon).
- Genome = the Number Sliders Galapagos adjusts.
- Fitness = a single number it tries to maximize or minimize.
- Connections are wired backwards — drag from the Galapagos component to the sliders/fitness output. Hold Shift for multiple sliders.
- Penalization encodes constraints into the fitness. Multiply a violation count by a large number (e.g. 10,000) and add it to the fitness so invalid solutions are heavily punished.
Part 2: Demo — Optimizing Tree Placement for Summer Shade
Watch the demo video.
Download the .3dm and .gh (starter) files to start.
Galapagos Solar Optimization_To Start.gh
In the demo, we use Galapagos to find optimal tree positions on a plaza to minimize summer sun hours on the pathway. Ladybug calculates sun hours; tree X/Y positions are controlled by sliders that Galapagos adjusts. Trees that land outside the plaza boundary are penalized using Point in Curve.
Part 3 (Optional): Beyond Galapagos — Multi-Objective Optimization
Galapagos only optimizes one fitness value at a time (single-objective). In real design, you often have competing goals — e.g. maximize winter sun and minimize summer sun. Multi-objective tools find a set of trade-off solutions (a Pareto front) instead of a single winner.
Plugins to explore in future work:
- Octopus — the original multi-objective plugin. SPEA-2 algorithm, 3D solution space visualization. 🔗 Octopus
- Wallacei — most widely used in current research. Up to 10 objectives, built-in analytics and clustering. Free. 🔗 Wallacei
- EvoMass — specialized for building massing optimization with solar/daylight/floor-area targets. 🔗EvoMass.
- Tunny — wraps the Optuna framework (Python/ML) for Grasshopper. Supports Bayesian optimization. 🔗 Tunny
Exercise 3.3: Maximize January Radiation
Using the same plaza and tree example from the demo, change the objective: maximize total radiation on the pathway ground in January.
What to Change
- Analysis Period: Change to January (month 1, day 1 → month 1, day 31).
- Fitness Direction: Switch Galapagos from Minimize to Maximize.
- Penalty Logic: Since you are now maximizing (larger = better), the penalty should subtract a large number from the fitness instead of adding. This ensures out-of-bounds trees are punished (their fitness drops dramatically).
- Run Galapagos and observe where the trees end up.
Bonus: Dual-Objective Blended Fitness
What if you want to minimize summer sun hours AND maximize January radiation at the same time, weighted 50/50?
The problem: sun hours (hours) and radiation (kWh/m²) are different measurements with different units and different numerical ranges. You cannot simply add or average them — a raw sun-hour value of 800 and a radiation value of 50 would make the sun-hour term dominate the fitness entirely.
The solution is normalization — remap both values to the same 0-to-1 domain before combining them. Use Remap Numbers (Maths > Domain > Remap Numbers) to map each raw output from its expected range to a 0–1 scale. To find each metric's range, run the simulation once with sliders at extremes and note the approximate min and max.
Once both values are normalized to 0–1:
fitness = 0.5 × norm_summer_sun + 0.5 × (1 − norm_winter_radiation) + penalty
This works because we want summer sun low (small = good) and winter radiation high (so we invert it: 1 − value makes high radiation = small number). Both terms now point in the same direction — minimize the total fitness. Set Galapagos to Minimize.
This is how you solve multi-objective problems with a single-objective solver: normalize, align direction, weight, and sum.
Submit on Canvas (following Friday, 11:59 PM)
- Screenshot of your Rhino viewport showing the optimized tree positions.
- Screenshot of the Galapagos fitness graph showing convergence.
- 2–3 sentences: What did the solver discover? Do the tree positions make sense for maximizing winter sun? How do they differ from the summer result?
- Bonus: If you attempted the dual-objective version, include a second set of screenshots and explain how the blended result differs from the single-objective results.