ECI770-Intelligent Systems - Week 03
ECI770-Intelligent Systems - Week 03
• Evolutionary computation
• a group of problem-solving techniques
• theory of biological evolution,
• genetic inheritance and natural selection..
• Integer Representation
Population Initialization
Swap Mutation
• In swap mutation, we select two positions on the chromosome at random, and
interchange the values. This is common in permutation based encodings.
Survivor Selection
• The Survivor Selection Policy determines which individuals are to be kicked
out and which are to be kept in the next generation. It is crucial as it should
ensure that the fitter individuals are not kicked out of the population, while
at the same time diversity should be maintained in the population.
• Age based Selection
• Fitness based Selection
Termination Condition
1. Representing individuals
2. Generating the initial population
3. Applying fitness function
4. Selecting parents for mating in accordance with their fitness
5. Crossover of parents to produce new generation
6. Mutation of new generation to produce diversity
Step 1: Representing individuals
• Item: 1 2 3 4 5 6 7
• Benefit: 5 8 3 2 7 9 4
• Weight: 7 8 4 10 4 6 4
• Knapsack holds a maximum of 22 pounds
• Fill it to get the maximum benefit
Genetic Algorithm
Outline of the Basic Genetic Algoritm
1. [Start]
✓ Encoding: represent the individual.
✓ Generate random population of n chromosomes
(suitable solutions for the problem).
2. [Fitness] Evaluate the fitness of each chromosome.
3. [New population] repeating following steps until
the new population is complete.
4. [Selection] Select the best two parents.
5. [Crossover] cross over the parents to form a new
offspring (children).
Genetic Algorithm
Outline of the Basic Genetic Algoritm Cont.
Item. 1 2 3 4 5 6 7
Chro 1 0 1 0 1 1 0
Exist? y n y n y y n
=> Items taken: 1, 3 , 5, 6.
• Generate random population of n chromosomes:
a) 0101010
b) 1100100
c) 0100011
Basic Steps Cont.
Fitness & Selection
✓
b) 1100100: Benefit= 20, Weight= 19. ✓
c) 0100011: Benefit= 21, Weight= 18.
=> We select Chromosomes b & c.
Basic Steps Cont.
Crossover & Mutation
Parent 1 1 1 0 0 1 0 0
Parent 2 0 1 0 0 0 1 1
Child 1 1 1 0 0 0 1 1
Child 2 0 1 0 0 1 0 01 Mutation
Basic Steps Cont.
Accepting, Replacing & Testing