3. Introduction
• Mimics Theory of Evolution
• GAs as a general purpose learning algorithm
• Solving a complex problem of problems
• Uses Natural Selection or Survival of the Fittest
9. Basic GA algorithm
1. [Start] Generate random population of n chromosomes (suitable solutions for the problem)
2. [Fitness] Evaluate the fitness f(x) of each chromosome x in the population
3. [New population] Create a new population by repeating following steps until the new population is
complete
1. [Selection] Select two parent chromosomes from a population according to their fitness (the
better fitness, the bigger chance to be selected)
2. [Crossover] With a crossover probability cross over the parents to form a new offspring (children).
If no crossover was performed, offspring is an exact copy of parents.
3. [Mutation] With a mutation probability mutate new offspring at each locus (position in
chromosome).
4. [Accept] Place new offspring in a new population
5. [Replace] Use new generated population for a further run of algorithm
6. [Test] If the end condition is satisfied, stop, and return the best solution in current population
[Loop] Go to step 2
11. GA Cycle of Reproduction
Reproduction Modification
EvaluationPopulation
Discard
Children
Modified
Children
Evaluated
Children
Deleted
Members
Parents
12. GA Operators
1. Reproduction: aka selection operator, usually the first
operator applied on the population. Chromosomes are
selected from the population to cross over and produce
offspring
2. Crossover: After reproduction population is enriched
with better individuals.
3. Mutation: Happens after crossover, causing a random
change in the offspring.
13. Chromosomes could be:
– Bit strings (0101 ... 1100)
– Real numbers (43.2 -33.1 ... 0.0 89.2)
– Permutations of element (E11 E3 E7 ... E1 E15)
– Lists of rules (R1 R2 R3 ... R22 R23)
– Program elements (genetic programming)
– Any data structure ...
18. GA: Encoding
• Binary Encoding
• example Knapsack problem
• Permutation Encoding
• example Travelling Salesman problem
Chromosome A 101100101100101011100101
Chromosome B 111111100000110000011111
Chromosome A 1 5 3 2 6 4 7 9 8
Chromosome B 8 5 6 7 2 3 1 4 9
19. GA: Encoding
• Value Encoding
• example finding weights
for neural network
• Tree Encoding
• example finding a function
from given values
Chromosome A 1.2324 5.3243 0.4556 2.3293 2.4545
Chromosome B ABDJEIFJDHDIERJFDLDFLFEGT
Chromosome C (back), (back), (right), (forward), (left)
Chromosome A Chromosome B
( + x ( / 5 y ) ) ( do_until step wall )
20. • Binary Encoding: Crossover
• Single Point Crossover
• Two Point Crossover
Crossover & Mutation
11001011+11011111 = 11001111
11001011 + 11011111 = 11011111
32. Applications of GAs
• GAs used to solve NP-hard
problems, but also for art,
evolving pictures and music
• In the first represented image,
a binary tree type of encoding
is used to generate the
images through mathematical
operations:
Source: [http://www.algosome.com/articles/genetic-algorithm-evolution-art.html]
33. Applications of GAs
• Data analysis
• Designing Neural Networks
• Robot trajectory
• Evolving LISP programs
• Strategy Planning
• Finding the shape of protein
molecules
• Sequence Scheduling
• Functions for creating images
34. Issues for GAs
• Choosing basic implementation issues:
• representation
• population size, mutation rate, ...
• selection, deletion policies
• crossover, mutation operators
• Termination Criteria
• Performance, scalability
• Solution is only as good as the evaluation function (often
hardest part)
35. Strengths of GAs
• Concept is easy to understand
• Modular, separate from application
• Supports multi-objective optimization
• Good for “noisy” environments
• Always an answer; answer gets better with time
• Inherently parallel; easily distributed
36. Strengths of GAs
• Many ways to speed up and improve a GA-based
application as knowledge about problem domain is
gained
• Easy to exploit previous or alternate solutions
• Flexible building blocks for hybrid applications
• Substantial history and range of use
37. When to use GAs
• Alternate solutions are too slow or overly complicated
• Need an exploratory tool to examine new approaches
• Problem is similar to one that has already been
successfully solved by using a GA
• Want to hybridize with an existing solution
• Benefits of the GA technology meet key problem
requirements