4. GA Glossary
Chromosome
A set of genes / parameters representing a complete solution to a
problem being optimized.
Population A set of chromosomes.
Fitness Function
The function used for evaluating how well a chromosome solves the
optimization problem. Outputs a fitness score.
Generation
A complete cycle where the population of chromosomes is evaluated,
and a new population is created using selection, reproduction, and
mutation.
Selection / Rejection
Selects or rejects chromosomes from the population. Elitism is when the
best chromosomes carry over to the next generation.
Reproduction Combining two or more chromosomes to create a new chromosome.
Mutation Changing the value of one or more genes in a chromosome.
Convergence When the GA finds the global optimum or the fitness no longer improves.
5. Messy GA
• Traditional GA: fixed-order genes.
• Messy GA: variable-length, position-independent genes.
• Each gene is appended with an index.
• Positions of the genes in the chromosome can be swapped without
changing the meaning of the chromosome.
• Why?
• Irregular-length solutions.
8. Messy GA: Potential Problems
• Over-Specification: more than one gene with the same index.
• Positional preference: choose the first or last.
• Performance preference: choose the best.
• Under-Specification: one or more indices are missing.
• Random.
• Optimization.
9. Adaptive GA
• Traditional GA: fixed population size, crossover rate, mutation
rate.
• Adaptive GA: variable population size, crossover rate, mutation
rate.
• Example: Mutation+ if population converges; Mutation- if population
diverges.
• Why?
• Control the rate of searching and rate of convergence.
• Exploration: unknown solution space.
• Exploitation: known solution space.
10. Adaptive GA: How to Detect Convergence?
• Criterion: Max fitness – Avg. fitness
Convergence Divergence
Selection
++
Keep more local
optima from known
areas
--
Keep more solutions
from unknown areas
Crossover
++
Look for more
unknown areas
--
Narrow down
searching in known
areas
Mutation
++
Look for more
unknown areas
--
Narrow down
searching in known
areas
12. Parallel GA
• Parallel Chromosomes
• Fitness test multiple chromosomes simultaneously.
• Parallel Populations (i.e. Island Model)
• Optimize multiple populations simultaneously.
• Limited migration between populations.
• Diversity.
13. Independent-Sampling GA
• Traditional GA: search solution space by generating offspring
with selection, crossover, mutation.
• ISGA: search solution space using independent sampling.
• Independent sampling phase.
• Breeding phase.
• Why?
• Better population diversity.
• Adaptive mechanism.
• Fewer parameters to tune.
14. Independent-Sampling GA
• Population initialization and fitness testing as normal.
• Independent Sampling:
• Generate offspring chromosome, one gene at a time, by independent
sampling.
• Evaluate new offspring. If fitness score is higher than the lowest
population fitness, replace the low-fitness chromosome with the offspring.
• Breeding:
• Select two parent chromosomes (i.e. using tournament fitness).
• Generate offspring using crossover, and then fitness test.
• Replace parents if offspring have higher fitness.
15. Real-Coded GA
• Traditional GA: uses binary genes.
• Real-coded GA: uses real floating value genes.
• Why?
• Better precision.
• Solve optimization problems with continuous variables and solution space.
16. Genetic Algorithm variants
GA Variant Advantages Disadvantages
Messy
- Overlapping genes can handle problems
with high epistasis
- Non-binary encoding scheme
- Each gene can contribute to multiple traits, which can
be difficult to interpret
Adaptive
- Adapt to changing problem landscapes
- More efficient than fixed-parameter GAs
in some cases
- Requires a self-adaptive mutation rate, which can be
complex to implement
Parallel
- Speed up the optimization process by
utilizing multiple processors or machines
- Handle large-scale optimization problems
- Requires a suitable parallelization technique and
infrastructure
- Synchronization and communication overheads may
affect performance
Independent
Sampling
- Reduce the risk of getting stuck in local
optima
- Increase the diversity of the final solution
- Requires multiple independent runs, which can be time-
consuming
- Final solution may not be as good as that of a single run
Real-Coded
- Handle continuous variables and improve
search efficiency for certain problems
- Produce more accurate solutions than
binary-coded GAs for certain problems
- Requires a larger search space, which can be
computationally expensive
- More complex to implement than binary-coded GAs
17. Genetic Programming: Principles
• GP uses natural evolution principles for different problem
domains.
1. Multiple individuals form a population. Individuals can reproduce.
2. Reproduction transfers traits from parents to offspring.
3. Many factors affect the survival of individuals.
4. Natural selection favours fit individuals.
• GP evolves computer programs to solve problems, i.e. automatic
programming.
18. Genetic Programming: Program
• Program using tree structure
representation.
• Each node can be:
1. Arithmetic function (i.e. addition, subtraction).
2. Logical function (i.e. AND, NOT).
3. Terminal: input variables, constants.
4. Tree structure: depth, complexity, branches.
19.
20. Genetic Programming
1. Initialize population of computer programs.
2. Fitness test each program.
a) Performance: does the program run? How well does it solve the
problem?
b) Complexity: how big is the program? How long does it run?
3. Create new offspring program:
a) Selection: choose two or more parent programs.
b) Crossover: randomly swap nodes between parents.
c) Mutation: change a node to another type of node.
d) Architecture: modify the architecture of the offspring.
24. Genetic Programming: Characteristics
• High-Return: described using “artificial-to-intelligence ratio”.
• Artificial: how much of the program is automated.
• Intelligence: how much of the program requires human
intervention.
• Examples:
• Deep Blue chess computer.
• High A: very good at playing chess.
• High I: requires years of development by a dedicated team.
• Results: low A-to-I ratio.
25. Genetic Programming: Characteristics
• Routine: how well does the program handle new problems intra-
domain, and inter-domain, with minimal human intervention.
• Machine Intelligence: how well does the program fulfil the three
principles inspired by Turing:
• Logic-driven search: search algorithms, constraints, rule-based systems.
• Cultural search: previously acquired knowledge is stored and used for
solving future problems, i.e. knowledge-based expert systems.
• Genetic or evolutionary search: evolve newer, better solutions from
existing solutions.
Editor's Notes
Messy: designed to handle problems with a high degree of epistasis, which occurs when the effect of a gene depends on the presence or absence of other genes. This is achieved by allowing overlapping genes, so that a single gene can contribute to multiple traits.
Adaptive: dynamically adjusts its parameters during the optimization process. This allows the algorithm to adapt to changes in the problem landscape or to different problem instances.
Hybrid: combines multiple optimization techniques. For example, it can use both local search methods and global search methods to explore the problem space more efficiently. Hybrid GA can also combine genetic algorithm with other optimization methods such as simulated annealing or gradient descent.
Parallel: uses multiple processors or machines to perform the optimization process simultaneously. This can greatly reduce the time required to find the optimal solution. Parallel GA can be implemented using various approaches such as master-slave, island model, or cellular model.
ISGA: uses independent runs to search for the optimal solution. Each run is performed independently, and the best individual from each run is selected as the final solution. This approach can reduce the risk of getting stuck in local optima, as different runs may explore different parts of the problem space.
RCGA: handle problems with continuous variables. It represents each individual as a vector of real values instead of binary strings. Real-Coded GA uses real-valued crossover and mutation operators, and may use gradient-based methods to improve the search efficiency in some cases.
In a “classical” GA, the genes are encoded in a fixed order. The meaning of a single gene is determined by its position inside the chromosome. What happens if the coding is chosen such that couplings occur between distant genes?
Messy GAs try to overcome this difficulty by using a variable-length, position-independent coding. The key idea is to append an index to each gene which allows identifying its position. A gene, therefore, is no longer represented as a single allele value and a fixed position, but as a pair of an index and an allele.
Since with the help of the index we can identify the genes uniquely, genes may be swapped arbitrarily without changing the meaning of the string.
Messy Genetic Algorithms are a powerful optimization technique that can tackle problems with irregular or variable-length structures. They overcome some of the limitations of traditional GAs by using variable-length chromosomes, gene expression, template-based crossover, specialized mutation operators, and a coarse-to-fine search strategy. These features enable mGAs to effectively explore complex search spaces and find high-quality solutions to challenging problems.
With appropriate genetic operations, which also change the order of the pairs, the GA could possibly group coupled genes together automatically.
Owing to the free arrangement of genes and the variable length of the encoding, we can, however, run into problems, which do not occur, in a simple GA.
First of all, it can happen that there are two entries in a string, which correspond to the same index but have conflicting alleles. The most obvious way to overcome this “over-specification” is positional preference – the first entry, which refers to a gene, is taken.
This problem of “under specification” is more complicated and its solution is not as obvious as for over-specification.
One approach could be to check all possible combinations and to take the best one (for k missing genes, there are 2k combinations).
With the objective to reduce this effort, Goldberg et al. have suggested to use so-called competitive templates for finding specifications for k missing genes. It is nothing else than applying a local hill climbing method with random initial value to the k missing genes.
Adaptive GAs are those whose parameters, such as the population size, the crossing over probability, or the mutation probability, are varied while the GA is running. A simple variant could be the following: The mutation rate is changed according to changes in the population – the longer the population does not improve, the higher the mutation rate is chosen. Vice versa, it is decreased again as soon as an improvement of the population occurs.
K2=K4=0.5; prevent the GA from getting stuck at a local optimum.
K1=K3=1.0; ensures that all solutions with a fitness value less than or equal to global optimum compulsorily undergo crossover. The probability of crossover decreases as the fitness value approaches global optimum
It has been established that GA’s efficiency to find optimal solution is largely determined by the population size. With a larger population size, the genetic diversity increases, and so the algorithm is more likely to find a global optimum.
A large population requires more memory to be stored; it has also been proved that it takes a longer time to converge. If n is the population size, the convergence is expected after nlog(n) function evaluations.
Fitness is usually multi-objective.
Fitness is also run multiple times under different test cases.
Mutation in GP can involve one or more of the following changes:
Replace a function node with another function that has the same arity (number of arguments).
Replace a terminal node (variable or constant) with another terminal. c.
Replace a function node with a terminal node, effectively pruning the subtree rooted at that function node. d.
Replace a terminal node with a function node, requiring the addition of a new subtree rooted at the new function node.