msdo 2015 lecture 7 ga

187
7/23/2019 Msdo 2015 Lecture 7 Ga http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 1/187 IN THE NAME OF A THE MOST BENEF THE MOST MER

Upload: hmxa91

Post on 18-Feb-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 1/187

IN THE NAME OF A

THE MOST BENEFTHE MOST MER

Page 2: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 2/187

[email protected] ; 0321-9

 _________________PhD, FLIGHT VEHICLE DESIGNBEIJING UNIVERSITY OF AERONAUTICS AND ASTRONAUTICS, BUAA, P.R.CHINA, 2009

MS, FLIGHT VEHICLE DESIGNBEIJING UNIVERSITY OF AERONAUTICS AND ASTRONAUTICS, BUAA, P.R.CHINA, 2006

BE, MECHANICAL ENGINEERINGNATIONAL UNIVERSITY OF SCIENCE AND TECHNOLOGY, NUST, PAKISTAN, 2000

EMAIL: [email protected] 

[email protected] 

TEL: +92-320-9595510

WEB:  www.ist.edu.pk/qasim-zeeshan LINKEDIN: pk.linkedin.com/pub/qasim-zeeshan/67/554/ba7 

Dr Qasim Zeeshan

Page 3: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 3/187

MULTIDISCIPLISY

DOPTIMIZA

LECTURE # 7

Page 4: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 4/187

STATUS

PHASE-I

Introduction to Multidisciplinary System Design Optimizatio

Terminology and Problem Statement

Introduction to Optimization

Classification of Optimization Problems

Numerical/ Classical Optimization

MSDO Architectures

Practical Applications: Structure, Aero etc

Page 5: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 5/187

STATUS

PHASE-II WEEK 8: Genetic Algorithm

WEEK 9: Particle Swarm Optimization

WEEK 10: Simulated Annealing

WEEK 11: MID TERM

WEEK 12:

Ant Colony Optimization, Tabu Search, Pattern Search

WEEK 13:

LAB, Practical Applications

00

20

40

60

-0.5

0

0.5

1

Page 6: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 6/187

STATUS

PHASE-III WEEK 14: Design of Experiments, Meta-modeling, and Ro

WEEK 15: Multi-objective Optimization

Hybrid Optimization & Hyper Heuristic Optimiz

WEEK 16: Post Optimality Analysis/ Revision & Discussion

WEEK 17: END TERM/ Paper Presentations ?

Page 7: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 7/187

In this LECTURE

GENETIC ALGORITHM HISTORY

TERMINOLOGY/ VOCABULARY

ALGORITHM

APPLICATION IN MATLAB

EXAMPLES

ASSIGNMENT

Page 8: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 8/187

Page 9: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 9/187

M

GENETIC ALGO

Dr. Qasim ZeeshanLECTURE # 7

Page 10: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 10/187

WHAT IS OPTIMIZATION?

● “Making things better”

● “Generating more profit” 

● “Determining the best” 

● “Do more with less” 

● “The determination of values for design variables  wh

(maximize) the objective, while satisfying all constraints” 

Principles of Optimal Design: Modelin

2d Ed. by Panos Y. Papalambros and Douglass J. Wilde, Cambridge University Press, New

Page 11: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 11/187

Search for a doc

(Search)Strategies are of an disordered world

(Search)Strategies need apredictable order of the world

Page 12: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 12/187

RECAP

Local

Multi-Objec

Un-Constrain

Non-GradientGradient Based

Constrained

Single-Objective

Global

Page 13: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 13/187

EVOLUT

Page 14: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 14/187

Evolution

Evolution (also known asbiological or organic evolution) isthe change over time in one ormore inherited traits found inpopulations of organisms

Adaptation is the process that

makes organisms better suited totheir habitat

Adaptation may cause either thegain of a new feature, or the lossof an ancestral feature

Page 15: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 15/187

Evolution means

climbing a fitness-hill

   F   i  t

  n  e  s  s

Page 16: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 16/187

Evolution in Biology

Organisms produce a number of offspring similar to themselves butvariations due to:

Mutations (random changes)

Sexual reproduction (offspring have combinations of features inherited

parent)

Page 17: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 17/187

Evolution in Biology

Some offspring survive, and produce next generations, and some d The organisms adapted to the environment better have higher

survive

Over time, the generations become more and more adapted befittest organisms survive

Page 18: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 18/187

GENALGORI

Page 19: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 19/187

Survival of the Fittest

The main principle of evolution used in GAis “survival of the fittest” 

The good solution survive, while bad ones die!

Page 20: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 20/187

Genetic Algorithms are good at taking large,

huge search spaces and navigating them,

optimal combinations of things, solutions yo

otherwise find in

- Salva

Computer De

Page 21: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 21/187

What are Genetic Algorithms?

Search algorithms based on mechanics of natural selection Based on genetic processes of biological organisms

Result is search algorithm with innovative flair of human search

Efficiently exploit historical information to speculate on new searchexpected improved performance

Bottom line: GAs are Intelligent exploitation of a random search

Page 22: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 22/187

What are Genetic Algorithms?

GA are adaptive methods which may be used to solve search and opproblems

Based on genetic processes of biological organisms

Combine survival of fittest with structured yet randomized information exchange

Result is search algo

Over many generations, populations evolve according to principles of natural selethe fittest => a Darwin type of approach

GAs simulate those processes in natural populations which are essential to

Metaphor underlying GA is that of natural evolution

each species faces search for beneficial adaptations to complicated and changing

“knowledge” each species gain is embodied in the makeup of the chromosomes of

Page 23: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 23/187

Conventional search methods, such as the Descent Method, aincapable of optimizing non-linear multimodal functions. So search method is required.

A GA is a directed random search technique, which can findoptimal solution in complex multi-dimensional search space.

A GA is modeled on natural evolution in that the operators iare inspired by the natural evolution process.

These operators manipulate individuals in a population overgenerations to improve their fitness gradually.

What are Genetic Algorithms?

Page 24: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 24/187

Individuals in a population are likened to chromoso

chromosome has a fitness value associated with it.

GAs do not use much knowledge about the prob

optimized and do not deal directly with the parameproblem. They manipulate codes which represent the pa

What are Genetic Algorithms?

Page 25: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 25/187

Biology vs Optimization

Candidate solutions to the optimization problem play the role oin a population (or chromosomes)

Cost/fitness/objective function determines the environment withsolutions “live” 

Page 26: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 26/187

The Metaphor26

NatuGenetic Algorithm Environment Optimization problem 

Individuals living in

environment 

Feasible solutions 

Individual’s degree

to its surrounding enSolutions quality (fitness function) 

Page 27: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 27/187

The Metaphor (cont)27

NatuGenetic Algorithm A population of org(species) 

A set of feasible solutions 

Selection, recombina

mutation in nature’s process 

Stochastic operators 

Evolution of populatheir environment 

Iteratively applying a set ofstochastic operators on a set of

feasible solutions

Page 28: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 28/187

GENETIC ALG

HISTORICAL PERSP

Page 29: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 29/187

GA

  Invented by John Holland 1975

  Made popular by John Koza 199

Page 30: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 30/187

HISTORICAL PERSPECTIVE

Charles Darwin (1809-1882)

Controversial and very influential book (1859) On the

origin of species by means of natural selection, or the

preservation of favored races in the struggle for life

Observations:

Species are continually developing Homo sapiens and apes have common ancestors

Variations between species are enormous

Huge potential for production of offspring, but only asmall/moderate percentage survives to adulthood

Evolution = natural selection of inheritable variations

Page 31: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 31/187

HISTORICAL PERSPECTIVE

Gregor Mendel (1822-1884) Investigated the inheritance of

characteristics (“traits”) 

Conducted extensive experimentswith pea plants

Examined hybrids from differentstrains of plant

Character (gene) for tallness isdominant

Character (gene) for shortness isrecessive

Page 32: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 32/187

HISTORICAL PERSPECTIVE

Rechenberg (1960)

Idea of evolutionary computing was introduced in the1960s by I. Rechenberg in his work "Evolution strategies"(Evolutions strategie in original).

German computer scientist and professor (born January 20,1934 in Berlin). Rechenberg is a pioneer of the fields ofevolutionary computation and artificial evolution. In the1960s and 1970s he invented a highly influential set ofoptimization methods known as evolution strategies (fromGerman Evolutions strategie).

http://www.bionik.tu-berlin.de/institut/xn2rechenb.html 

Page 33: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 33/187

HISTORICAL PERSPECTIVE

Rechenberg (1960)

His group successfully applied the new algorithms tochallenging problems such as aerodynamic wing design.These were the first serious technical applications ofartificial evolution

His idea was then developed by other researchers.

Page 34: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 34/187

HISTORICAL PERSPECTIVE

John Holland (1970)

Genetic Algorithms (GAs) were invented by JohnHolland and developed by him and his students andcolleagues.

This lead to Holland's book "Adaption in Natural and

Artificial Systems" published in 1975

Page 35: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 35/187

HISTORICAL PERSPECTIVE

John Holland (1970)

Developed by John Holland, his colleagues andstudents at University of Michigan (1970’s) 

To understand processes in natural systems

To design artificial systems retaining the robustness

and adaptation properties of natural systems Goals

To abstract and rigorously explain the adaptiveprocess of the natural system

Design artificial systems software that retains the

important mechanisms of natural systems

Page 36: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 36/187

HISTORICAL PERSPECTIVE

John Holland (1970)

Holland’s original GA is known as the simple

genetic algorithm(SGA)

Provide efficient techniques for optimization andmachine learning applications

Widely used in business, science and engineering

Page 37: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 37/187

HISTORICAL PERSPECTIVE

KOZA (1992)

John R. Koza received his Ph.D. in computer science from theUniversity of Michigan in 1972, working under John Holland. From1973 through 1987, he was co-founder, chairman, and CEO ofScientific Games Inc. where he co-invented the rub-off instant lotteticket used by state lotteries.

In 1992 John Koza has used genetic algorithm to evolve programs toperform certain tasks.

He called his method "genetic programming" (GP).

LISP programs were used, because programs in this language canexpressed in the form of a "parse tree", which is the object the GA woon.

Page 38: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 38/187

HISTORICAL PERSPECTIVE

David Edward Goldberg (born 1953) is an American computer scientist, andprofessor at the department of Industrial and Enterprise Systems Engineering(IESE) at the University of Illinois at Urbana-Champaign and is most noted for hisseminal works in the field of genetic algorithms. He is the director of Illinois genealgorithms laboratory (IlliGAL) and also the chief scientist of Nextumi Inc.

He is also the author of "Genetic Algorithms for Search, Optimization, and MachineLearning", which is one of the most cited books in computer science.

David E. Goldberg received a PhD degree in civil engineering in 1983 fromUniversity of Michigan and his advisors were E. Benjamin Wylie and John HenHolland. He is one of the most connected scientists in the evolutionary computatiofield, having collaborated, among others, with Kalyanmoy Deb and Jeff Horn.

In 2003 David Goldberg was appointed as the first holder of Jerry S. DobrovolnProfessorship in Entrepreneurial Engineering at the University of Illinois at Urbana

Champaign

Page 39: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 39/187

HISTORICAL PERSPECTIVE

Central theme is ROBUSTNESS 

Balance between efficiency and efficacy needed for survival in manyenvironments

Robustness

If you look at biological systems one can only marvel at its robustnessflexibility

Includes

self repair

self guidance

reproduction

These features barely exist in sophisticated artificial systems

Page 40: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 40/187

GENETIC ALGOR

 _______________________VOCABU

TERMINO

Page 41: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 41/187

Page 42: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 42/187

Page 43: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 43/187

Page 44: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 44/187

Terminology

CHROMOSOME  (genotypes): a string representing a solution

problem. 

GENES  (phenotypes): a coding representing the chromosome.

 ALLELES : the various values that a gene can take. 

LOCI : the position of a given allele in the chromosome. 

 POPULATION (gene-pool): the set of chromosomes used in a ggeneration (iteration).

Page 45: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 45/187

Some Terminology

CHILDREN: the generated chromosomes from the current pop

 PARENTS : the chromosomes that form the children (current chr

FITNESS : a value of the function to optimize under a given ch

OPERATORS : transformations that generate new solutions bas

current ones; the way of reproduction of new solutions. Selection, crossover, mutation, and inversion

Page 46: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 46/187

GA: VOCABULARY

CHROMOSOME All living organisms consist of cells. In each cell there is

the same set of chromosomes. Chromosomes are strings of DNA and serves as a

model for the whole organism. A chromosome consist of genes, blocks of DNA. Each

gene encodes a particular protein. Basically can be said, that each gene encodes a trait,

for example color of eyes. Possible settings for a trait(e.g. blue, brown) are called alleles.

Each gene has its own position in the chromosome. Thisposition is called locus.

Page 47: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 47/187

GA: VOCABULARY

Complete set of genetic material (all chromosomes) is

called genome.

Particular set of genes in genome is called genotype.

The genotype is with later development after birthbase for the organism's phenotype, its physical and

mental characteristics, such as eye color, intelligenceetc.

GA VOCABULARY

Page 48: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 48/187

GA: VOCABULARY

REPRODUCTION

During reproduction, first occurs recombination (orCrossover).

Genes from parents form in some way the whole newchromosome.

The new created offspring can then be mutated.

 Mutation means, that the elements of DNA are a bitchanged. This changes are mainly caused by errors incopying genes from parents.

The fitness of an organism is measured by success ofthe organism in its life.

GA VOCABULARY

Page 49: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 49/187

GA: VOCABULARY

 SEARCH SPACE

If we are solving some problem, we are usually looking for some solution, best among others. The space of all feasible solutions (it means objects amdesired solution is) is called search space (also state space).

Each point in the search space represent one feasible solution. Each feasib"marked" by its value or fitness for the problem. We are looking for our so

one point (or more) among feasible solutions - that is one point in the sear

GA VOCABULARY

Page 50: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 50/187

GA: VOCABULARY SEARCH SPACE

The looking for a solution is then equal to a looking for some extreme (minmaximum) in the search space..

The problem is that the search can be very complicated. One does not knofor the solution and where to start.

There are many methods, how to find some suitable solution (ie. not necess

solution), for example hill climbing, tabu search, simulated annealing and g

S h S

Page 51: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 51/187

Search Space51

If we are solving some problem, we are usually looking for some solution, which will others. The space of all feasible solutions (it means objects among those the desiredsearch space (also state space). Each point in the search space represent one feasibfeasible solution can be "marked" by its value or fitness for the problem.

 Initialization: Initially many individual solutions are randomly generated to form an incovering the entire range of possible solutions (the search space)Each point in the search space represents one possible solution marked by its value(

 Selection: A proportion of the existing population is selected to bread a new bread

Reproduction: Generate a second generation population of solutions from those seleoperators: crossover and mutation.

Termination: A solution is found that satisfies minimum criteria Fixed number of generations found Allocated budget (computation, time/money) reached The highest ranking solution’s fitness is reaching or has reached 

GA VOCABULARY

Page 52: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 52/187

GA: VOCABULARY

Should be obvious by now that GAs use vocabulary borrowed from

Genotype 

Individuals in population

also called structures, strings, or chromosomes

Genes 

Unit or section of genotype (chromosome) Arranged in linear succession

also called features, characters, or decoders

GA VOCABULARY

Page 53: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 53/187

GA: VOCABULARY

Loci

String positions

Locations of genes

 Allele

Value of a particular loci in a gene

GA VOCABULARY

Page 54: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 54/187

GA: VOCABULARY

Population of individuals

The individuals are solutions to problem

Population dynamics

Births

Deaths

“Survival of the fittest”  Only the fittest survive to mate

Inheritance

Features of fittest inherited by offspring

GA VOCABULARY

Page 55: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 55/187

GA: VOCABULARY

 Population of individuals

Genetic representation for potential solutionsWay to create initial population of potential solution

 Population dynamicsTraits of “good” individuals passed on Traits of “bad” individuals die off 

 “Survival of fittest” Evaluation process to measure each individualSelection process

 InheritanceNeed to pass on traits they were selected for

Genetic operators that alter composition of children

GA Elements

Page 56: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 56/187

GA Elements

Page 57: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 57/187

GENETIC ALGO

 ______________________POPULATION OPERA

Page 58: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 58/187

Page 59: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 59/187

Page 60: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 60/187

Page 61: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 61/187

GA: Population operators

Page 62: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 62/187

GA: Population operators

REPRODUCTION:

Exact copy/copies of individual

CROSSOVER:

Randomly exchange genes of different parents

Many possibilities: how many genes, parents, children … 

MUTATION: Randomly flip some bits of a gene string

Used sparingly, but important to explore new designs

GA: Population operators

Page 63: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 63/187

GA: Population operators

CROSSOVER:

1 1 0 1 0 0 1 0 1 1 0 0 1 0 1 0 1 1 0 1 0 0 1 0 1

Parent 1 Parent 2

0 1 1 0 0 0 1 0 1 1 0 0 1 0 1

Child 1 Child 2

1 1 0 1 1 0 0 1 0 1

● MUTATION:

1 1 0 1 0 0 1 0 1 1 0 0 1 0 1

1 1 0 1 0 1 1 0 1 1 0 0 1 0 1

Page 64: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 64/187

GENETIC ALGOR _______________________

ALGOR

The GA Algorithm

Page 65: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 65/187

The GA Algorithm

1. Initialize a population of chromosomes (a set of solutions).2. Evaluate each chromosome in the population.

3. Create new chromosomes by mating current chromosomes usi

operators.

4. Delete some old chromosomes to maintain the size of the pop

5. Evaluate the new chromosomes and insert them into the popu

6. If certain stopping criteria are met, stop; otherwise go to ste

GA: Basic Algorithm

Page 66: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 66/187

GA: Basic Algorithm

REPRODUCTION

Algorithm is started with a set of solutions (represented by chromosopopulation.

Solutions from one population are taken and used to form a new pop

This is motivated by a hope, that the new population will be better tha

Solutions which are selected to form new solutions (offspring) are selto their fitness - the more suitable they are the more chances they hav

This is repeated until some condition (for example number of popula

improvement of the best solution ) is satisfied.

GA: Basic Algorithm

Page 67: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 67/187

GA: Basic Algorithm

[Start] Generate random population of n chromosomes (suitable solutions

[Fitness] Evaluate the fitness f(x) of each chromosome x in the population [New population] Create a new population by repeating following steps

population is complete [Selection] Select two parent chromosomes from a population according to the

fitness, the bigger chance to be selected) [Crossover] With a crossover probability cross over the parents to form a new

If no crossover was performed, offspring is an exact copy of parents. [Mutation] With a mutation probability mutate new offspring at each locus (po

chromosome). [Accepting] Place new offspring in a new population

[Replace] Use new generated population for a further run of algorithm [Test] If the end condition is satisfied, stop, and return the best solution in [Loop] Go to step 2 

GA flowchart

Page 68: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 68/187

GA flowchart

Create initial

population Evaluate fitnessof all individuals

Test termincriteria

Select individualsfor reproduction

Create new population

Crossover Mutation Reproduction

Termination criteria can be fixed number of generations, a certain required fitness level is reached, no

ti

Flowchart of a simple GA

Page 69: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 69/187

Flowchart of a simple GA

Initial population

Evaluation

Selection

Crossover

Mutation/ Inversion

GA: Basic Algorithm

Page 70: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 70/187

GA: Basic Algorithm

[Start] Generate random population of n chromosomes (suitable solutions

[Fitness] Evaluate the fitness f(x) of each chromosome x in the population [New population] Create a new population by repeating following steps

population is complete [Selection] Select two parent chromosomes from a population according to the

fitness, the bigger chance to be selected) [Crossover] With a crossover probability cross over the parents to form a new

If no crossover was performed, offspring is an exact copy of parents. [Mutation] With a mutation probability mutate new offspring at each locus (po

chromosome). [Accepting] Place new offspring in a new population

[Replace] Use new generated population for a further run of algorithm [Test] If the end condition is satisfied, stop, and return the best solution in [Loop] Go to step 2 

Methodology Associated with GA

Page 71: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 71/187

Begin

Initialize Population

Optimum

Solution?

T=T+1

(go to next step)

Se

Cro

Mu

N

Evaluate Solutions

Y

Stop

T =0 (first step)

Creating a GA on Computer

Page 72: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 72/187

Simple_Genetic_Algorithm()

{ Initialize the Population;

Calculate Fitness Function;

While(Fitness Value != Optimal Va

{

Selection;//Natural Selection, Surv

Crossover;//Reproduction, PropagMutation;//Mutation

Calculate Fitness Fun

}

}

Nature Vs Computer - Mapping

Page 73: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 73/187

73

p pp g

Nature 

Computer 

Population

Individual

Fitness

Chromosome

Gene

Reproduction 

Set of solutions.

Solution to a problem.

Quality of a solution.

Encoding for a Solution.

Part of the encoding of a solution.

Crossover 

Nature Vs Computer - Mapping

Page 74: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 74/187

p pp g

Classical Algorithm Genetic Algorith

Generates a single point at eachiteration.

The sequence of pointsapproaches an optimal solution.

Selects the next point in the sequenceby a deterministic computation.

Generates a population ofeach iteration.

The best point in thepopulation approaches an

solution.

Selects the next populationcomputation which uses rannumber generators. 

Page 75: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 75/187

GENETIC ALGOR _______________________

ENCOD

ENCODING

Page 76: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 76/187

The process of representing the solution in the form of aconveys the necessary information.

Just as in a chromosome, each gene controls a particularcharacteristic of the individual, similarly, each element in

represents a characteristic of the solution.

Encoding Methods

Page 77: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 77/187

Binary Encoding – Most common method of encoding. Chromoso

strings of 1s and 0s and each position in the chromosome represparticular characteristic of the problem.

Permutation Encoding – Useful in ordering problems such as theSalesman Problem (TSP). Example. In TSP, every chromosome is anumbers, each of which represents a city to be visited.

11111110000000011111Chromosome B

10110010110011100101Chromosome A

8 5 6 7 2 3 1 4 9Chromosome B

1 5 3 2 6 4 7 9 8Chromosome A

g

Encoding Methods

Page 78: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 78/187

Value Encoding – Used in problems where complicated valuesnumbers, are used and where binary encoding would not suffic

Good for some problems, but often necessary to develop crossover and mutation techniques for these chromosomes.

(left), (back), (left), (right), (forwChromosome B

1.235 5.323 0.454 2.321 2Chromosome A

g

GA Elements

Page 79: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 79/187

Citation:

http://ocw.mit.edu/NR/rdonlyres/Aeronautics-and-Astronautics/16-888Spring-2004/D66C4396-90C8-49BE-BF4A-4EBE39CEAE6F/0/M

Encoding Methods (contd.)

Page 80: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 80/187

Tree Encoding –is used mainly for evolving programs or expressions, i.e. for Genetic p

Tree Encoding -  every chromosome is a tree of some objects, such as values/arith

commands in a programming language.

( + x ( / 5 y ) ) ( do_until step wall )

Characterizing a GA Via an Examp

Page 81: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 81/187

g p

Explain the main elements that form a GA using an illustratmaximize F ( x) = x2

s.t.  x

 [0, 31]

Main elements of GAs

Coding a chromosome (representation)

Creation of initial population

Genetic operators

Control parameters

Representation (Coding a Chromosome

Page 82: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 82/187

p g

The parameters to be optimized are usually represented in a string

genetic operators are suitable for this type of representation.

The method of representation has a major impact on the perfor

GA.

Two common representation methods for numerical optimization pr

The preferred method is the binary string representation method

The second is to use a vector of integers or real numbers, with ea

real number representing a single parameter.

Representation (Coding a Chromosome

Page 83: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 83/187

When a binary representation scheme is employed, an impo

to decide the number of bits used to encode the parameters.

The length of the coding string that needs to be used has to b

Each parameter should be encoded with the optimal number of bits

possible solutions in the solution space. When too few or too many bits are used the performance can be a

affected.

Binary String Representation of an Integer Nu

Page 84: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 84/187

Any integer number can be written in decimal system x = 2,765 can be written as

2,765 = 2.103 + 7.102 + 6.101 +5.100

It is also possible to code a number in binary form

 x = 39 = 1.25 + 0.24 + 0.23 + 1.22 + 1.21 + 1.20

or simply x can be represented by a string of 6 bits as

 x = (100111)

Binary String Representation of an Integer Nu

Page 85: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 85/187

Estimation on the length of the binary string for an integer numberan integer variable x  [a, b]

Length of binary string > log2(b-a) 

For example, x  [0, 31]

len> log2(31-0) = log231 = 5 

Binary String Representation of a ContinuousFunction

Page 86: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 86/187

222 1

b a

For functional optimization

Maximize F ( x) where x  [a, b]

Generate a bit string of length k, say 22.

For instance, this gives x'  = (01011 . . . 0110), hence

 x'   [0, 222 -1]

Translate x'  into x  [a, b]

precision or accuracy=12

22

  ab

 xa x

Binary String Representation of a ContinuousFunction

Page 87: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 87/187

Accuracy estimation

A continuous variable x  [a, b]Length of binary string = m

Accuracy = (b-a)/(2m-1)

Estimation on the length of the binary string

For example, x  [4.1, 6.8], accuracy required=10-4

len> log2[(6.8-4.1)/10-4 ]= log217000 = 14.1

2log accuracy requir

b alength

 

Binary String Representation of a ContinuousFunction

Page 88: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 88/187

In the example of the continuous function optimizatiomaximize F ( x) = x2 where  x  [0, 31]

we use a binary coding, set accuracy=1, then the stri

length is 5.

maximum x = 31 can be represented by (11111

31= 24 + 23 + 22 + 21 + 20

Page 89: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 89/187

GENETIC ALGOR _______________________

INITIALIZAT

INITIALIZATION

Page 90: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 90/187

90

Start with a population of randomly generated individuals, o

 A previously saved population

 A set of solutions provided by a human expert

 A set of solutions provided by another heuristic algorithm

POPULATION

Page 91: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 91/187

A population is all the organisms that both belong to the same spe

the same geographical area. The area that is used to define the population is such that inter-bre

possible between any pair within the area and more probable thabreeding with individuals from other areas.

Normally breeding is substantially more common within the area thborder

CREATION OF INITIAL POPULA

Page 92: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 92/187

Two ways of forming an initial population

Using a random number generator to produce solutions randomly

preferred for problems about which no a prior knowledge exists or for performance of an algorithm.

Employing a prior knowledge about the given problem to obtain a requirements, and solutions satisfying those requirements are collect

initial population.

the GA starts the optimization with a set of approximately known solutiotherefore converges to an optimal solution in short time.

GENETIC OPERATORS

Page 93: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 93/187

Three common genetic operators: selection, crossover and mutation.

An additional reproduction operator: inversion.

It is not necessary to employ all of these operators in a GA becausfunctions independently of the others.

The choice or design of operators depends on the problem and

representation scheme employed. For instance, operators designed for binary strings cannot be directly used

coded with integers or real numbers.

SELECTION

Page 94: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 94/187

Natural selection is the process by which biologic traits b

more or less common in a population due to consistent e

upon the survival or reproduction of their bearers.

It is a key mechanism of evolution.

SELECTION

Page 95: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 95/187

The aim of the selection mechanism is to reproduce more copies of

individuals whose fitness values are higher than those whose fitnessare low.

The selection procedure has a significant influence on driving the setowards a promising area and finding good solutions in a short tim

There are several selection mechanisms. Two ways used extensively

RANKING-BASED SELECTION

PROPORTIONAL SELECTION 

METHODS of SELECTION

Page 96: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 96/187

There are many different techniques which a genetic algorithm can useindividuals to be copied over into the next generation, but listed below

most common methods. Some of these methods are mutually exclusive, and often are used in combination. Elitist selection 

Fitness-proportionate selection 

Roulette-wheel selection

Scaling selection 

Tournament selection

Rank selection

Generational selection

Steady-state selection

Hierarchical selection 

METHODS of SELECTION

Page 97: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 97/187

Elitist selection: The most fit members of each generation are guaranteed t(Most GAs do not use pure elitism, but instead use a modified form where a few of the best, individuals from each generation are copied into the nein case nothing better turns up.)

Fitness-proportionate selection: More fit individuals are more likely, but not selected.

Roulette-wheel selection: A form of fitness-proportionate selection in which

individual's being selected is proportional to the amount by which its fitnesthan its competitors' fitness. (Conceptually, this can be represented as a gaeach individual gets a slice of the wheel, but more fit ones get larger sliceThe wheel is then spun, and whichever individual "owns" the section on whictime is chosen.)

METHODS of SELECTION

Page 98: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 98/187

 Scaling selection: As the average fitness of the population increases, the strselective pressure also increases and the fitness function becomes more dismethod can be helpful in making the best selection later on when all indivirelatively high fitness and only small differences in fitness distinguish one f

Tournament selection: Subgroups of individuals are chosen from the larger members of each subgroup compete against each other. Only one individusubgroup is chosen to reproduce.

Rank selection: Each individual in the population is assigned a numerical rafitness, and selection is based on this ranking rather than absolute differenadvantage of this method is that it can prevent very fit individuals from gaearly at the expense of less fit ones, which would reduce the population's and might hinder attempts to find an acceptable solution.

METHODS of SELECTION

Page 99: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 99/187

Generational selection: The offspring of the individuals selected from each become the entire next generation. No individuals are retained between g

 Steady-state selection: The offspring of the individuals selected from each gback into the pre-existing gene pool, replacing some of the less fit membegeneration. Some individuals are retained between generations.

 Hierarchical selection: Individuals go through multiple rounds of selection eaLower-level evaluations are faster and less discriminating, while those that

levels are evaluated more rigorously. The advantage of this method is thatcomputation time by using faster, less selective evaluation to weed out the individuals that show little or no promise, and only subjecting those who surto more rigorous and more computationally expensive fitness evaluation.

Ranking-based selection

Page 100: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 100/187

The diversity of the population must be maintained to avoid p

convergence and to reach the global optimal solution.

One way to prevent premature is to limit the number of offsprings individual, so that no individual generates too many offsprings.

Ranking-based selection chooses a certain number of parents

the ranks of their fitness values, and not on the magnitudes. This number can be fixed a priori or variable depending on the po

average fitness.

Roulette Wheel selection

Page 101: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 101/187

This is a way of choosing members from the population of

chromosomes in a way that is proportional to their fitness. It does not guarantee that the fittest member goes through

to the next generation, merely that it has a very goodchance of doing so. It works like this:

Imagine that the population’s total fitness score is

represented by a pie chart, or roulette wheel. Now youassign a slice of the wheel to each member of thepopulation.

The size of the slice is proportional to that chromosomesfitness score. i.e. the fitter a member is the bigger the sliceof pie it gets. Now, to choose a chromosome all you haveto do is spin the ball and grab the chromosome at thepoint it stops.

The Roulette Wheel Selection

Page 102: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 102/187

Proportional selection is usually called “roulette wheel” selecti

its mechanism is reminiscent of the operation of a roulette wh

Fitness values of individuals represent the widths of slots on t

wheel.

After a random spinning of the wheel to select an individuanext generation, individuals in slots with large widths represe

high fitness values will have a higher chance to be selected.

The Roulette Wheel Selection 

Page 103: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 103/187

For each parent k, the probability of being selected can be cF( x)/F where x is the corresponding value for parent k. 

The values for all the parents are arranged in a roulette wheparent to choose is recorded according to the outcome.

These values can be put in a list from 0 to 1, a random number in [0

and for whichever range contains such a number, the associated paselected.

This process is repeated until the new generation is completed.

The Roulette Wheel Selection

Page 104: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 104/187

String No. Current

Population

x  value F (x ) P[select] Expec

count

1 01101 13 169 0.14 0.58

2 11000 24 576 0.49 1.97

3 01000 8 64 0.06 0.22

4 10011 19 361 0.31 1.23

sum 1170 1.00 4.00

Average(F) 293 0.25 1.00 Maximum 579 0.49 1.97

P[select] = F (x )/ Sum

Expected count = F (x )/F

Actual count = number found by roulette wheel or simply the nearest integer of the expected count.

Red denotes the fittest chromosome.

The Roulette Wheel Selection

Page 105: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 105/187

Chromosomes that fail to pass the test (an expected count

least 1), say Nf , will be removed from the current populati

More formally the number of dropped chromosomes can b

expressed as Nd  = Max {K 0, Nf }

 K 0 is the minimum number that has to be dropped from one gen

the next. Nf  can be found as |{k   Population st: P[select k] < , say = 0.

where | E | denotes the cardinality of the set E. 

The Roulette Wheel Selection 

Page 106: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 106/187

The threshold can vary from problem to problem

For instance, parent 3 can be removed and replaced by a new

which can be formed from the current remaining parents or s

generated completely afresh.

The new parent is generated via some operators inclucrossover, mutation and inversion.

Local Tournament Selection107

Page 107: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 107/187

Extracts k individuals from the population with uniform pr

(without re-insertion) and makes them play a “tournamen

the probability for an individual to win is generally propor

fitness

Selection pressure is directly proportional to the number

participants 

Page 108: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 108/187

GENETIC ALG

 ___________________CRO

109

CROSSOVER

Page 109: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 109/187

Main idea:

combine genetic material ( bits ) of 2 “parent” chrom

( solutions ) and produce a new “child” possessing

characteristics of both “parents”. 

How it works ?

Several methods …. 

CROSSOVER

Page 110: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 110/187

Crossover operator is used to create two new individuals

(children) from two existing individuals (parents) pickedfrom the current population by the selection operation.

Crossover process can be repeated until a suitable

stopping criterion is met. The selection of parents for

mating is critical to the success of GA.

Some common crossover operations: one-point crossover,

two-point crossover, cycle crossover, and uniform crossover. 

GA: Population operators

Page 111: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 111/187

CROSSOVER:

1 1 0 1 0 0 1 0 1 1 0 0 1 0 1 0 1 1 0 1 0 0 1 0 1 Parent 1 Parent 2

0 1 1 0 0 0 1 0 1 1 0 0 1 0 1

Child 1 Child 2

1 1 0 1 1 0 0 1 0 1

Why does crossover work?

Page 112: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 112/187

A lot of theory about this and some controversy

Holland introduced “Schema” theory 

The idea is that crossover preserves “good bits” from different

combining them to produce better solutions

A good encoding scheme would therefore try to preserve “goo

during crossover and mutation

CROSSPVER: TECHNIQUES

Page 113: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 113/187

ONE-POINT CROSSOVER

A single crossover point on both parents' organism stringsis selected. All data beyond that point in either organismstring is swapped between the two parent organisms. Theresulting organisms are the children:

TWO-POINT CROSSOVER Two-point crossover calls for two points to be selected on

the parent organism strings. Everything between the twopoints is swapped between the parent organisms,rendering two child organisms:

CROSSPVER: TECHNIQUES

U if C d H lf U if C

Page 114: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 114/187

Uniform Crossover and Half Uniform Crossover The Uniform Crossover uses a fixed mixing ratio between two parents. Unlike, on

crossover, the Uniform Crossover enables the parent chromosomes to contribute rather than the segment level. If the mixing ratio is 0.5, the offspring has approthe genes from first parent and the other half from second parent, although crobe randomly chosen as seen below

The Uniform Crossover evaluates each bit in the parent strings for exchange wit0.5. Even though the uniform crossover is a poor method, empirical evidence sugmore exploratory approach to crossover than the traditional exploitative appro

maintains longer schemata. This results in a more complete search of the design maintaining the exchange of good information.

One-point Crossover

Page 115: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 115/187

Two individuals are randomly selected as parents from the p

individuals formed by the selection procedure and cut at a rachosen point. The tails, which are the parts after the cutting pswapped and two new individuals (children) are produced.

Child 1 and child 2 are different from their parents and thesmore diversification leading to new solutions.

Parent 1: 10001|001111

Parent 2: 01101|100011

Child 1: 10001100011

Child 2: 01101001111

One-point Crossover

Page 116: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 116/187

The one-point crossover operator may have no effect on the s

Each child was found to be exactly the same as his or her pathe genes associated with both parents after the crossover po

to be the same.

Parent 1: 10001|001111

Parent 2: 01101|001111

Child 1: 10001001111

Child 2: 01101001111

One-point Crossover

Page 117: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 117/187

The other parents unfortunately lost their best genes to

produce less fit children.

Those two less fit chromosomes will die away and will be

replaced by two other ones, which are either selected randomly

or copied directly from the best current chromosomes.

By keeping the best fit chromosomes in the population, we

are hoping to make even fitter chromosomes.

Two-point Crossover

Page 118: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 118/187

Parent 1: 101|0001|1010

Parent 2: 011|0111|1011

Child 1: 10101111010 

Child 2: 01100011011 

Crossover (contd.)

Page 119: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 119/187

Crossover between 2 good solutions MAY NOT Ayield a better or as good a solution.

Since parents are good, probability of the childgood is high.

If offspring is not good (poor solution), it will be in the next iteration during “SELECTION”. 

Page 120: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 120/187

GENETIC ALGO _____________________

E

122

ELITISM

Page 121: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 121/187

Main idea: copy the best chromosomes (solutions) population before applying crossover and mutation

When creating a new population by crossover or mutation the bchromosome might be lost.

Forces GAs to retain some number of the best individuals at eac

Has been found that elitism significantly improves performanc

Page 122: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 122/187

GENETIC ALGOR

MUTA

MUTATION

Page 123: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 123/187

In molecular biology and genetics, mutations are changes in

genomic sequence: the DNA sequence of a cell's genome or t

or RNA sequence of a virus.

They can be defined as sudden and spontaneous changes in

Mutations are caused by radiation, viruses, and mutagenic chas well as errors that occur during meiosis or DNA replication

MUTATION

Page 124: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 124/187

All individuals are checked bit by bit and the bit values are rando

according to a specified rate. Unlike crossover, a child string is prosingle parent string.

The mutation operator forces the algorithm to search new areas, h

premature convergence and find the global optimal solution.

Parent 1 : 1 1 0 0 0 1 0 1 1 1 0

child 1 : 1 1 0 0 1 1 0 1 1 1 0

MUTATION

Page 125: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 125/187

For each bit in each string a random number is generated, sa

If  <  (fixed acceptance probability value, say  = 0.005the value of that bit (allele) may mutate as this will take a va0 or 1 randomly.

Note that the value of that bit may not necessarily change although

passed the first probability test. If  >  this particular bit is kept unchanged and the next bi

string is tested and the process is repeated.

MUTATION

Page 126: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 126/187

The new population has a different spread of solutions.

According to these results both the third and the fourth chrom

will die away and be replaced by two other ones.

The old second chromosome has lost some of its fitness, where

old fifth chromosome has increased its fitness by inverting theat loci 3 of this string from 0 to 1.

GENETIC ALGOR _______________________

Page 127: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 127/187

CROSSO

MUTA

n-point crossover

Choose n random crossover points

Page 128: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 128/187

Choose n random crossover points

Split along those points

Glue parts, alternating between parents

Generalisation of 1 point (still some positional bias)

Uniform crossover

Assign 'heads' to one parent, 'tails' to the other

Page 129: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 129/187

Assign heads to one parent, tails to the other

Flip a coin for each gene of the first child

Make an inverse copy of the gene for the second child Inheritance is independent of position

CROSSOVER OR MUTATION?

Decade long debate which one is better / necessary / main backg

Page 130: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 130/187

Decade long debate: which one is better / necessary / main-backg

Answer (at least, rather wide agreement):

it depends on the problem, but

in general, it is good to have both

both have another role

mutation-only-EA is possible, crossover-only-EA would not work

Exploration Discovering promising areas in the search spac

Crossover OR mutation? (cont’d)

Page 131: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 131/187

Exploration: Discovering promising areas in the search spac

information on the problemExploitation: Optimising within a promising area, i.e. using

There is co-operation AND competition between them

 Crossover is explorative, it makes a big jump to an area

“in between” two (parent) areas  Mutation is exploitative, it creates random small diversio

staying near (in the area of ) the parent

Crossover OR mutation? (cont

Page 132: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 132/187

Only crossover can combine information from two paren

Only mutation can introduce new information (alleles)

Crossover does not change the allele frequencies of the

(thought experiment: 50% 0’s on first bit in the populati

after performing n crossovers)

To hit the optimum you often need a ‘lucky’ Mutation

Page 133: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 133/187

GENETIC ALGO _____________________

INVE

Inversion works on a single chromosome

INVERSION

Page 134: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 134/187

 Inversion works on a single chromosome

It generates two positions in the string (locus) randomly or vand then all the elements between those two points will hav

inverted (from 0 to 1 and vice versa).

Parent 1 : 1 0 0 1  0 0  1  1

Child 1 : 1 0 0 0 1 1 0  1

INVERSION

Page 135: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 135/187

Populati on After

Reproduction  

I nversion Points

(Chosen Randomly )

New Populati on   x Value   F (x ) P[s

0 1 1 0 1 2 3 0 0 0 0 1 1 1 0.0

1 1 0 0 0 3 4 1 1 1 1 0 30 900 0.8

0 1 0 0 0 2 3 0 0 1 0 0 4 16 0.0

1 0 0 1 1 1 2 0 1 1 0 0 12 144 0.1

Sum 1061 1.0

Average (F ) 265 0.2

Maximum 900 0.8

Page 136: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 136/187

GENETIC ALGOR _______________________

CONTROL PARAME

CONTROL PARAMETERS

Page 137: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 137/187

Important control parameters of a simple GA include

POPULATION SIZE

CROSSOVER RATE

MUTATION RATE 

Population Size

Page 138: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 138/187

A large population size means the simultaneous handlin

solutions and increases the computation time per iteratio

Since many samples from the search space are used, th

probability of convergence to a global optimal solution

than when using a small population size.

Cross Over Rate

Page 139: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 139/187

The crossover rate determines the frequency of the crossover

operation.

It is useful at the start of optimization to discover a promising regio

A low crossover frequency decreases the speed of convergence to

such an area.

If the frequency is too high, it leads to saturation around one solutio

MUTATION RATE

Page 140: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 140/187

A high mutation rate introduces high diversity in the pop

and might cause instability.

It is usually very difficult for a GA to find a global opti

solution with too low a mutation rate.

Research in GA concentrates on several sensitive parts o

Future Research in GA

Page 141: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 141/187

Research in GA concentrates on several sensitive parts o

how to better represent a solution of a given problem

the development of new operators

how to integrate operators with the choice of the par

mating

Hybridization with other search algorithms

Page 142: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 142/187

GENETIC ALGOR _______________________

MULTI ISLAND

MIGA

Genetic algorithms work well because they incorporate randomness in thei

Page 143: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 143/187

A more proficient GA called “Multi-island Genetic Algorithm (MIGA)” is us

research.

MIGA originated from the traditional genetic algorithm (GA), which involveGA

It gives the algorithm the ability to correct deterministic search bottlenecksby the reasoning in the “space sampling” methods like Simulated Annealing

gradient methods

MIGA algorithm divides the population into several islands, performs tradioperations on each island separately, and then migrates individuals betwesearches many designs and multiple locations of the design space.

MIGA

Individual 

Parameter 

Page 144: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 144/187

Migration 

Individual Island

Population 

Traditional GA

Operations on

each island 

Size of sub-

population

Number of

Population

Number of

generations

Total individ

Rate of cros

Rate of mut

Rate of mig

MIGA

MIGA allows preservation of the best individuals from the previous generalt ti " liti "

Page 145: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 145/187

alteration, elitism .

Elitism guarantees that the best genetic material is carried over to the child

The selection operation in MIGA employs the "tournament selection" schemindividuals are selected not from the whole population, but rather from a srandomly selected individuals.

Main feature of MIGA that distinguishes it from traditional GAs is the fact

population of individuals is divided into several subpopulations called "isla

All traditional genetic operations are performed separately on each sub-p

MIGA The exchange of individual information, termed “migration”, is carried out peri

sub-populations.

Page 146: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 146/187

Migration is performed according to a migration policy, which defines where aindividuals move.

Simple migration policy consists of a migration interval, which is the number of occur between migrations, and a migration topology, which determines where imigrate.

The following experimental design decisions have to be made to define the isla

Number of Sub populations: 2, 3, 4 .. Size of Sub Population: uniform or non uniform

Connectivity Topology: ring, star, fully connected, random

Migration Mechanism

MIGA

The motivation for using MIGA is two fold

Page 147: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 147/187

Firstly, we need to improve the speed of evolutionary processes by con

concurrent evaluations of individuals in a population.

Secondly, we need to improve the problem solving process by overcomsuch as premature convergence.

Page 148: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 148/187

CONCLUD

REMA

ISSUES

Page 149: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 149/187

GA: COMPUTATIONAL ISSUES

Population size

Representation of individual

Page 150: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 150/187

Representation of individual

Phenotypic: problem specific; real representation Genotypic: domain independent; encoding

How to produce offspring Mutation Crossover

Selection Worst Preserve the best Fitness proportional Block or group selection / deletion

GA: COMPUTATIONAL ISSUES

  Population size

correlation between population size and behavior of GA

Page 151: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 151/187

correlation between population size and behavior of GA

  Phenotype

The observable physical or biochemical characteristics of an organism, aboth genetic makeup and environmental influences

  Genotype

The genetic constitution of an organism or a group of organisms.

  Allele

One member of a pair or series of genes that occupy a specific position chromosome.

GA: COMPUTATIONAL ISSUES Measuring evaluation and fitness

Measure each individual separately

Page 152: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 152/187

Context sensitive - compare against others How to handle noise and constraints

Use as problem solvers Have new populations generating but how to use them

Population 1 Population 2 Population 3 Popu

Generation 1 Generation 2 Generation 3 Gen

Concluding Remarks

Differ from traditional search/optimization methods:

Page 153: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 153/187

/ p

GAs search a population of points in parallel, not only a single

GAs use probabilistic transition rules, not deterministic ones

GAs work on an encoding of the design variable set rather thavariables themselves

GAs do not require derivative information or other auxiliary knonly the objective function and corresponding fitness levels infl

Concluding Remarks

stochastic, directed and highly parallel search technique basprinciples of population genetics

Page 154: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 154/187

p p p p g

Difference with traditional search techniques: Coding of the design variables as opposed to the design va

themselves, allowing both discrete and continuous variables

Works with population of designs as opposed to single desireducing the risk of getting stuck at local minima

Only requires the objective function value, not the derivativeaspect makes GAs domain-independent

GA is a probabilistic search method, not deterministic, makinsearch highly exploitative.

COMMENTS on GA

Can successfully deal with a wide range of problem areas

Including those which are difficult for other methods to solve

Page 155: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 155/187

Including those which are difficult for other methods to solve

Not guaranteed to find the global optimum solutions

Common with all heuristics

Generally good at finding “acceptably good” solutions “acceptab

Do not require much in the way of mathematical requirements

Quite easy to “hybridize”  Will cover such approaches in later lectures

COMMENTS on GA

Any population-based model that uses selection and recombinationgenerate new sample points in a search space

Page 156: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 156/187

GAs work with a coding of the solutions (versus the actual solution) GAs search using a population of solutions (versus a single point)

GAs do not derivative for the search

GAs use probabilistic transition rules (versus deterministic)

Advantages and disadvantag159

Advantages:

Page 157: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 157/187

Always an answer; answer gets better with time Good for “noisy” environments 

Inherently parallel; easily distributed

Issues:

Performance

Solution is only as good as the evaluation function Termination Criteria

Page 158: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 158/187

GENETIC ALGO _____________________

M

MATLAB

SYNTAX

x = ga(fitnessfcn nvars)

Page 159: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 159/187

x = ga(fitnessfcn,nvars)

x = ga(fitnessfcn,nvars,A,b)

x = ga(fitnessfcn,nvars,A,b,Aeq,beq)

x = ga(fitnessfcn,nvars,A,b,Aeq,beq,LB,UB)

x = ga(fitnessfcn,nvars,A,b,Aeq,beq,LB,UB,nonlcon)

x = ga(fitnessfcn,nvars,A,b,Aeq,beq,LB,UB,nonlcon,options)

MATLAB

Fitnessfcn Fitness functionNvars Number of design variables

Page 160: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 160/187

Aineq A matrix for linear inequality constraintsBineq b vector for linear inequality constraintsAeq A matrix for linear equality constraintsBeq b vector for linear equality constraintsLb Lower bound on xUb Upper bound on x

Nonlcon Nonlinear constraint functionRandstate Optional field to reset rand stateRandnstate Optional field to reset randn stateSolver 'ga'Options Options structure created using gaoptimset

MATLAB nvars = 17; % NUMBER OF VARIA

fitnessFunction = @MY_FUNCTION; options = gaoptimset; % %Start with default options  %Modify some param

Page 161: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 161/187

options = gaoptimset(options,'PopInitRange' ,[lb;ub]); % options = gaoptimset(options,'InitialPop options = gaoptimset(options,'PopulationSize' ,100); % POPU

options = gaoptimset(options,'Generations' ,100); % NUMB options = gaoptimset(options,'StallGenLimit' ,50); % STALL options = gaoptimset(options,'StallTimeLimit' ,200000000); % STALL

options = gaoptimset(options,'TolFun' ,1e-9); % FUNCT options = gaoptimset(options,'TolCon' ,1e-9); % CONS options = gaoptimset(options,'CrossoverFcn' ,@crossovertwopoint); % CROSS options = gaoptimset(options,'CrossoverFraction' ,0.8); % CROSS options = gaoptimset(options,'SelectionFcn' ,{ @selectiontournament 4 });  % SELEC options = gaoptimset(options,'MutationFcn' ,{ @mutationuniform 0.25641 }); % MUTA options = gaoptimset(options,'Display' ,'iter'); % DISPLA  [X,FVAL,REASON,OUTPUT,POPULATION,SCORES] = ga(fitnessFunction,nvars,options); %Run GA

MATLABThe genetic algorithm uses the following conditions to determine when to stop:

Generations —  The algorithm stops when the number of generations reaches thGenerations.

Page 162: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 162/187

Time limit —  The algorithm stops after running for an amount of time in seconds Fitness limit —  The algorithm stops when the value of the fitness function for th

current population is less than or equal to Fitness limit.

Stall generations —  The algorithm stops when the weighted average change in tvalue over Stall generations is less than Function tolerance.

Stall time limit —  The algorithm stops if there is no improvement in the objectiveinterval of time in seconds equal to Stall time limit.

Function Tolerance —  The algorithm runs until the weighted average change in tover Stall generations is less than Function tolerance.

Nonlinear constraint tolerance —  The Nonlinear constraint tolerance is not usedIt is used to determine the feasibility with respect to nonlinear constraints 

MATLABRastrigin's Function

This section presents an example that shows how to find the minimum

Page 163: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 163/187

function, a function that is often used to test the genetic algorithm. For two independent variables, Rastrigin's function is defined as

MATLAB

Page 164: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 164/187

MATLAB

Page 165: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 165/187

GENETIC ALGOR

Page 166: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 166/187

 _______________________

EVOLUTIONARY STRAT

Evolution-Strategy

Page 167: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 167/187

ES-]),/(,/[                  

Wright Haldane Fisher  '  = Number of offsp

  '  = Number of pop

 '  = Number of pare

= Number of pare

= Number of offsp = Generations of

  '  = Mixing number

  = Mixing number

carnation

EVOLUTIONARY STRATEGY

Evolution-strategic optimization is based on the hypothesis that

Page 168: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 168/187

biological evolution the laws of heredity have been developedphylogenetic adaptation.

Evolution-Strategies (ES) imitate, in contrast to the genetic algoeffects of genetic procedures on the phenotype.

The presumption for coding the variables in the ES is the realiz

sufficient strong causality (small changes of the cause must creachanges of the effect).

EVOLUTIONARY STRATEGY

The (environmental) selection in evolution strategies is deterministic and onthe fitness rankings, not on the actual fitness values. The resulting algorithm

Page 169: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 169/187

invariant with respect to monotonic transformations of the objective functioevolution strategy operates on a population of size two: the current point the result of its mutation. Only if the mutant's fitness is at least as good asone, it becomes the parent of the next generation. Otherwise the mutant iThis is a (1 + 1)-ES. More generally, λ mutants can be generated and comparent, called (1 +  λ )-ES. In (1 , λ)-ES the best mutant becomes the parengeneration while the current parent is always disregarded.

Contemporary derivatives of evolution strategy often use a population ofalso recombination as an additional operator, called (  μ / ρ+,  λ )-ES. This mprone to get stuck in local optima

Page 170: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 170/187

Elementary Evolution-Strategic Algorit

(1 + 1)-ES

Page 171: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 171/187

D ARWINs theory at the

level of maximum abstraction

(1 ,  )-ES

  = 6

Page 172: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 172/187

Evolution Strategy

with more than one offspring

(  ,  )-ES

  = 7  = 2

Page 173: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 173/187

Evolution Strategy with

more parents and more offspring

(     ,  )-ES

  = 8

  = 2   = 2

Page 174: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 174/187

Evolution Strategy

with mixing of variables

ES]),(,[  

    

    

2 1 

5 4  

New founder popula

Page 175: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 175/187

The Nested

Evolution Strategy

The notation

Page 176: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 176/187

will be an algebraic scheme

When to Use GA’s vs. ES’s 

Genetic Algorithms

Evolution Strategie “Good enough” solu

Page 177: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 177/187

More important to findoptimal solution (GA’s more

likely to find globalmaximum; usually slower)

Problem parameters can be

represented as bit strings(computational problems)

acceptable (ES’s usufaster; can readily fmaximum)

Problem parameters

numbers (engineerinproblems)

GENETIC ALGOR

Page 178: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 178/187

 _______________________

APPLICAT

GENETIC ALGORITHM

Page 179: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 179/187

Question: ‘If GAs are so smart, why ain’t they rich?’ 

Answer: ‘Genetic algorithms are rich - rich in application alarge and growing number of disciplines.’ 

- David E. Goldberg, Genetic Algorithms in Searc

Optimization and Machine

Some GA Application TypesDomain  Application Types 

Control  gas pipeline, pole balancing, missile evasion, pu

Page 180: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 180/187

Design  semiconductor layout, aircraft design, keyboardcommunication networks 

Scheduling  manufacturing, facility scheduling, resource allo

Robotics  trajectory planning 

Machine Learning  designing neural networks, improving classificatclassifier systems 

Signal Processing  filter design 

Game Playing  poker, checkers, prisoner’s dilemma 

Combinatorial Optimization  set covering, travelling salesman, routing, bin pacolouring and partitioning 

PROS AND CONS OF GABENEFITS ISSUES

Applicable on mixed, discrete, continuous problems It is still and art and requires signi

Page 181: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 181/187

Require little information about problem Can be computationally expensive

No gradients required Convergence behavior dependentpopulation size, selection, crossoveSimple to understand setup and implement

Always an answer; gets better with time (Robust) Termination criteria

Support multi-objective

Good for noisy environments

Easy to improve after learning about problem

Sustainable history and range of use

Page 182: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 182/187

REFEREN

REFERENCE BOOKS

Page 183: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 183/187

Page 184: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 184/187

ASSIGNM

ASSIGNMENT No. 2 (Individual Study any paper on implementation of SQP

Identify Problem Statement

Id if P bl F l i

Page 185: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 185/187

Identify Problem Formulation Identify Design Variables

Identify Design Objectives

Identify Design Constraints

Explain Results

Solve any CONSTRAINED optimization problem ofusing SQP fmincon in MATLAB

USE AIAA Paper format please

SUBMISSION DEADLINE: 4 MAY 2013

ASSIGNMENT No. 3 (Individual Study any paper on implementation of GA

Identify Problem Statement

Id if P bl F l i

Page 186: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 186/187

Identify Problem Formulation Identify Design Variables

Identify Design Objectives

Identify Design Constraints

Explain Results

Solve any CONSTRAINED optimization problem ofusing GA Toolbox in MATLAB

USE AIAA Paper format please

SUBMISSION DEADLINE: 4 MAY 2013

Page 187: Msdo 2015 Lecture 7 Ga

7/23/2019 Msdo 2015 Lecture 7 Ga

http://slidepdf.com/reader/full/msdo-2015-lecture-7-ga 187/187

THANK YOU FOR YOUR INT