3. Generative Design
September 22, 2019
Elements of optimization
1. Parameters – a set of variables that can be adjusted
• Continuous – a value within a certain range, represented by a floating point or decimal number
• Categorical – a selection from a limited set of options, represented by an integer or whole number
• Sequence – an ordering of a set of items, represented by a shuffled sequence of whole numbers
2. Objectives - functions representing the goals of the problem
• Minimize value
• Maximize value
3. Constraints - functions representing conditions that make a valid solution
• Must be equal to a certain value
• Must be smaller than a certain value
• Must be greater than a certain value
6. Generative Design
September 22, 2019
Genetic Algorithm
1. Generation – the model’s parameters are randomly varied to create a set of initial design options
2. Selection – based on their objective and constraint values, two ‘parent’ designs are chosen from the population
and subjected to crossover
3. Crossover – the parameters of the two ‘parent’ designs are recombined to create a new ‘child’ design in the next
generation
4. Mutation – the parameters of some ‘child’ designs are randomly changed to introduce new variation into the
optimization process
Steps 2-4 are repeated to create a specified set of generations or until some termination criteria is met.
7. Generative Design
September 22, 2019
Generation
1. Continuous
• Must specify minimum and maximum value the parameter can take, as well as the number of parameters to
generate
• Depending on how parameter is used in the model, can create an infinite number of design variations
2. Categorical
• Must specify number of options to choose from and the number of parameters to generate
• Creates a limited number of design options which can be computed as where o is the number of options
and n is the number of parameters
3. Sequence
• Must specify the number of items to order
• Creates a limited number of design options which can be computed as where n is the number of items.
8. Generative Design
September 22, 2019
Generation
o = number of options
n = number of parameters
number of solutions = o^n
4^5 = 1,024
4^20 = 1,099,511,627,776
9. Generative Design
September 22, 2019
Generation
n = number of cities
number of solutions = n!
10! = 10 * 9 * 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1 = 3,628,800
20! = 2.432902 * 10^18
30! = 2.652529 * 10^32
11. Generative Design
September 22, 2019
Selection
• Typically done in a tournament where two designs are picked randomly from the population and the ‘best’ is
selected to be a parent.
• To create a single child, a total of four random candidate designs must be chosen.
• Picking the ‘best’ design during tournament selection is simple with a single objective, but becomes more
complicated with two or more objectives since one candidate may be better at the first objectives while the other is
better at the second.
13. Generative Design
September 22, 2019
Dominance principle
To pick the ‘best’ design with two or more objectives, we first rank the designs according to the dominance principle.
A. Konak, D. W. Coit, A. E. Smith - Multi-Objective Optimization Using Genetic Algorithms: A Tutorial (2006)
14. Generative Design
September 22, 2019
Dominance principle
A solution A dominates another solution B if A performs at least as well as B in every objective, and better than B in at
least one objective.
A. Konak, D. W. Coit, A. E. Smith - Multi-Objective Optimization Using Genetic Algorithms: A Tutorial (2006)
15. Generative Design
September 22, 2019
Assigning rank
The Pareto optimal set is the collection of solutions which are not dominated by any other solution in the set.
Solutions in this set are assigned a rank of 1.
A. Konak, D. W. Coit, A. E. Smith - Multi-Objective Optimization Using Genetic Algorithms: A Tutorial (2006)
16. Generative Design
September 22, 2019
Assigning rank
By temporarily ignoring the first optimal set, a second optimal set can be formed. Solutions in this set are assigned a
rank of 2.
A. Konak, D. W. Coit, A. E. Smith - Multi-Objective Optimization Using Genetic Algorithms: A Tutorial (2006)
17. Generative Design
September 22, 2019
Assigning rank
This process can be repeated to generate the ranking of all solutions. In a tournament, a design in a higher rank is
considered better than a design in a lower rank and is chosen to be a parent.
A. Konak, D. W. Coit, A. E. Smith - Multi-Objective Optimization Using Genetic Algorithms: A Tutorial (2006)
18. Generative Design
September 22, 2019
Crowding distance
If both designs are in the same rank, we must pick the ‘best’ design based on other criteria. One option is the crowding
distance, which is measured as the distance between the two adjacent solutions in the same rank across all objectives.
Kalyanmoy Deb, et al. - A Fast and Elitist Multiobjective Genetic Algorithm: NSGA-II (2002)
19. Generative Design
September 22, 2019
Crowding distance
Designs with a larger crowding distance are considered better because they represent less explored areas of the
designs space.
Kalyanmoy Deb, et al. - A Fast and Elitist Multiobjective Genetic Algorithm: NSGA-II (2002)
20. Generative Design
September 22, 2019
Feasibility
If constraints are used, the design’s feasibility can be added as another criteria for picking the ‘best’ design option.
Solutions are considered not feasible if they break the conditions of one or more constraints.
Kalyanmoy Deb, et al. - A Fast and Elitist Multiobjective Genetic Algorithm: NSGA-II (2002)
21. Generative Design
September 22, 2019
Selection
Using the three criteria of feasibility, rank, and crowding distance, we can create a multi-stage decision tree for
selecting the ‘best’ design.
Kalyanmoy Deb, et al. - A Fast and Elitist Multiobjective Genetic Algorithm: NSGA-II (2002)
28. Generative Design
September 22, 2019
Crossover
During crossover, the parameters of the two ‘parent’ designs are recombined to create a single new ‘child’ design. How
this is done depends on the type of parameter used:
• With Continuous parameters, a new value is chosen randomly within a ‘window’ formed by the values from the two
parents.
• With Categorical parameters, the child inherits the value from one of the parents randomly.
• With Sequence parameters, we can use the inversion concept to randomly recombine the sequences of both
parents while ensuring that the resulting sequence will be valid1.
1. Göktürk Üçoluk - Genetic Algorithm Solution of the TSP Avoiding Special Crossover and Mutation (2002)
31. Generative Design
September 22, 2019
Mutation
During mutation, the parameters of the new ‘child’ design are randomly varied based on some specified probability.
How this is done depends on the type of parameter used:
• With Continuous parameters, the value can be randomly jittered based on a normal distribution.
• With Categorical parameters, a new option can be randomly chosen.
• With Sequence parameters, we can randomly swap two values in the ordered list a certain number of times.
35. Generative Design
September 22, 2019
Evaluating generative models
1. Bias vs. Variance – describes the total variation produced by the model.
• Models that are so constrained that they do not produce an adequate amount of variation are considered
too biased.
• Models that create so much variation that they can’t be efficiently searched by an optimization algorithm are
considered too variant.
• We can think of this as describing the limits or extents of the design space generated by the model.
2. Complexity vs. Continuity – describes how the model reacts to small changes in its parameters
• The more smoothly the model changes with its parameters the more continuous it is.
• Complex logics in the model can create a more complex relationship between the parameters and the model.
• The more continuous a model, the easier it is to optimize but the less likely you are to get unexpected results.
• We can think of this as describing the internal structure of the design space generated by the model.
36. Generative Design
September 22, 2019
Troubleshooting
Issue Possible cause Possible solution
The optimization process converges too
quickly on a design which may not be
optimal.
The model may be too biased, so it is not able to create the
necessary variation to find the best design options.
Modify the model to create more variation based on the existing
parameters, add more parameters, or try parameters of different
types.
There may not be enough designs in each generation to
produce enough variation among the designs.
Rerun the optimization with a larger number of designs for each
generation.
The mutation rate may too low to introduce enough variation
during the optimization process.
Rerun the optimization with a higher mutation rate.
The optimization process converges too
quickly on a solution which is obvious.
The model may be too continuous with a very direct
relationship between its input parameters and the output goals
and constraints.
The problem the model represents may be too simple and obvious to
make optimization worthwhile. In this case a heuristic solution may be
best.
The optimization process is very slow
and seems to have trouble converging
on the best designs.
The model may be too variant which makes it difficult for the
optimization algorithm to find trends in the design space and
narrow in on the best design strategies.
Constrain the model or limit the number of parameters so it can more
easily be searched by the optimization algorithm.
There is no discernable trend in the
optimization process towards better
designs.
The model may be too complex and discontinuous, which
makes it difficult for the algorithm to find trends and create
better designs.
Reduce or simplify the model’s parameters and make the relationship
between the parameters and the model as direct as possible.
The mutation rate may be so high that it is disrupting the
algorithm’s ability to evolve better designs.
Rerun the optimization with a lower mutation rate.
37. Generative Design
September 22, 2019
5 guidelines for designing better generative models
1. Minimize the number of parameters as much as possible (Occam’s razor)
2. Make the parameters as continuous as possible
3. Limit the design space to only feasible designs as much as possible
4. Make the model computation as fast as possible
5. Minimize randomness in the model as much as possible