Genetic algorithm

26
Genetic Algorithm S.H - Fall 2014

Transcript of Genetic algorithm

Page 1: Genetic algorithm

Genetic Algorithm

S.H - Fall 2014

Page 2: Genetic algorithm

Introduction

GA is a method normally used to generate useful solutions to optimization problems.

Genetic algorithms belong to the larger class of evolutionary algorithms (EA), which generate solutions to optimization problems using techniques inspired by natural evolution.

Page 3: Genetic algorithm

InheritanceCrossover

Page 4: Genetic algorithm

DNA needs to be copied when cells divide, so that each new cell has a complete set of genetic instructions.

The cellular process of copying DNA is full of mechanisms that check and double check the construction of a new DNA molecule. But when changes, or DNA mistakes do occur, it is usually harmful or at best has no effect on the organism.

Page 5: Genetic algorithm

Mutation

Page 6: Genetic algorithm

Based on Darwin’s Theory

Page 7: Genetic algorithm

Population

Individual (Chromosome)

Page 8: Genetic algorithm

Gen

etic

Alg

ori

thm

Creating Initial Population

Encoding

Applying Fitness Function

Genetic Operators

Termination

Decoding

Randomly generated individuals

A previously saved population

A set of solutions provided by a human expert

A set of solutions provided by another heuristic algorithm

Page 9: Genetic algorithm

Gen

etic

Alg

ori

thm

Creating Initial Population

Encoding

Applying Fitness Function

Genetic Operators

Termination

Decoding

Bit strings (0101 ... 1100)

Real numbers (43.2 -33.1 ... 89.2)

Permutations of element (E11 E3 E7 ... E1 E15)

Lists of rules (R1 R2 R3 ... R22 R23)

Page 10: Genetic algorithm
Page 11: Genetic algorithm

Gen

etic

Alg

ori

thm

Creating Initial Population

Encoding

Applying Fitness Function

Genetic Operators

Termination

Decoding

Determines the fitness of each member of the population.

Performs the objective function on each population member.

The most simple fitness function can be the objective function.

Page 12: Genetic algorithm

Gen

etic

Alg

ori

thm

Creating Initial Population

Encoding

Applying Fitness Function

Genetic Operators

Termination

Decoding

Inheritance - Crossover

Mutation

Page 13: Genetic algorithm

Crossover

Page 14: Genetic algorithm
Page 15: Genetic algorithm

Mutation

Page 16: Genetic algorithm

Gen

etic

Alg

ori

thm

Creating Initial Population

Encoding

Applying Fitness Function

Genetic Operators

Termination

Decoding

Page 17: Genetic algorithm

A solution is found that satisfies minimum criteria

Fixed number of generations reached

Allocated budget (computation time/money) reached

The highest ranking solution's fitness is reaching

No improvement in solution quality

Page 18: Genetic algorithm

Gen

etic

Alg

ori

thm

Creating Initial Population

Encoding

Applying Fitness Function

Genetic Operators

Termination

Decoding

Page 19: Genetic algorithm

Decoding

011101001

010001001

10010010

10010001

Page 20: Genetic algorithm

Gen

etic

Alg

ori

thm

Creating Initial Population

Encoding

Applying Fitness Function

Genetic Operators

Termination

Decoding

Selection

Crossover

Mutation

Page 21: Genetic algorithm

Max x2 over {0,1,…,31}(Selection)

Page 22: Genetic algorithm

Roulette Wheel

A C

1/6 = 17%

3/6 = 50%

B

2/6 = 33%fitness(A) = 3

fitness(B) = 1

fitness(C) = 2

Page 23: Genetic algorithm

Max x2 over {0,1,…,31}(Crossover)

Page 24: Genetic algorithm

Max x2 over {0,1,…,31}(Mutation)

Page 25: Genetic algorithm
Page 26: Genetic algorithm