Genetic Algorithms II: Advanced Design and Tuning
Making Genetic Algorithms Work Well
Population Size and Rates
Population size, crossover rate, and mutation rate strongly influence performance. Larger populations increase diversity but cost more evaluations. Mutation rates that are too low may stagnate; rates that are too high can destroy useful structure.
Typical Design Trade-offs
| Choice | Benefit | Risk |
|---|---|---|
| Large population | More diversity | Higher computation cost |
| High crossover | More recombination | May disrupt good structures |
| High mutation | More exploration | Can become random search |
| Strong elitism | Preserves best solutions | May reduce diversity |
Constraint Handling Options
-
1
Step 1: Reject invalid solutions and resample.
-
2
Step 2: Add penalty terms to the fitness score.
-
3
Step 3: Repair invalid solutions after mutation or crossover.
-
4
Step 4: Use operators that preserve feasibility by design.
Advanced Pseudocode with Elitism
``text<br>Evaluate population P<br>Keep the top e individuals unchanged<br>While offspring count < desired size:<br> Select parents<br> Recombine parents with probability pc<br> Mutate offspring with probability pm<br> Repair if needed<br>Combine elites and offspring to form next population<br>``
What is a common effect of increasing mutation too much?
Excessive mutation can overwhelm useful structure and make search noisy.
Correct answer: Random search-like behavior
Name one way to handle constraints in a GA.
Any of these can help manage invalid candidates.
Correct answer: Use a penalty function, repair operator, or feasibility-preserving operator.
Why might elitism be useful?
Elitism preserves strong candidates across generations.
Correct answer: It keeps the best solutions from being lost
Tuning Warning
GA parameters are problem-dependent; values that work well on one task may fail on another.
When to Prefer a GA
Genetic algorithms are a strong choice when the solution is discrete, the objective is noisy, or the search landscape has many local optima and weak gradient information.