0% found this document useful (0 votes)
11 views

ML - Unit1 - GA SKG

The document discusses machine learning and genetic algorithms. It provides a history of genetic algorithms and their origins from evolutionary concepts. It then defines genetic algorithms as optimization techniques based on Darwinian principles of natural selection, inheritance, mutation, and recombination. The document proceeds to explain key concepts in genetic algorithms including chromosomes, genes, fitness functions, selection methods, crossover and mutation operators.

Uploaded by

santosh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

ML - Unit1 - GA SKG

The document discusses machine learning and genetic algorithms. It provides a history of genetic algorithms and their origins from evolutionary concepts. It then defines genetic algorithms as optimization techniques based on Darwinian principles of natural selection, inheritance, mutation, and recombination. The document proceeds to explain key concepts in genetic algorithms including chromosomes, genes, fitness functions, selection methods, crossover and mutation operators.

Uploaded by

santosh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 78

Machine Learning

By
Dr. Santosh Kumar
Professor, SCSE
History of Genetic Algorithms
• “Evolutionary Computing” was introduced in the 1960s by I. Rechenberg.

• Professor John Holland at the University of Michigan came up with book


"Adaptation in Natural and Artificial Systems" explored the concept of
using mathematically-based artificial evolution as a method to conduct a
structured search for solutions to complex problems.

• Dr. David E. Goldberg. In his 1989 landmark text "Genetic Algorithms in


Search, Optimization and Machine Learning”, suggested applications for
genetic algorithms in a wide range of engineering fields.

2
What Are Genetic Algorithms
(GAs)?
 Genetic Algorithms are search and optimization techniques based on
Darwin’s Principle of Natural Selection.

“problems are solved by an evolutionary process resulting in a best (fittest) solution (survivor) ,
-In Other words, the solution is evolved”
1. Inheritance – Offspring acquire characteristics
2. Mutation – Change, to avoid similarity
3. Natural Selection – Variations improve survival
4. Recombination - Crossover

3
Chromosome
Genetics
 All Living organisms consists of cells. In each cell there is a same set of Chromosomes.
 Chromosomes are strings of DNA and consists of genes, blocks of DNA.
 Each gene encodes a trait, for example color of eyes.

Reproduction
• During reproduction, recombination (or crossover) occurs first. Genes from parents combine
to form a whole new chromosome. The newly created offspring can then be mutated. The
changes are mainly caused by errors in copying genes from parents.

• The fitness of an organism is measure by success of the organism in its life (survival)
Citation:
http://ocw.mit.edu/NR/rdonlyres/Aeronautics-and-Astronautics/16-888Spring-2004/D66C4396-90C8-49BE-BF4A-4EBE39CEAE6F/0/MSDO_L11_GA.pdf
4
Principle Of Natural Selection
• “Select The Best, Discard The Rest”

 Two important elements required for any problem before a genetic


algorithm can be used for a solution are:

 Method for representing a solution (encoding)


ex: string of bits, numbers, character

 Method for measuring the quality of any proposed solution, using


fitness function
ex: Determining total weight

5
Methodology Associated with GAs

Begin

Initialize
population

Evaluate
Solutions

T =0 (first step)

Optimum N
Solution?

Selection
Y

T=T+1 Stop Crossover


(go to next step)

Mutation

6
Citation: http://cs.felk.cvut.cz/~xobitko/ga/
Nature Vs Computer - Mapping

Nature Computer
Population Set of solutions.
Individual Solution to a problem.
Fitness Quality of a solution.
Chromosome Encoding for a Solution.
Gene Part of the encoding of a solution.
Reproduction Crossover

7
Encoding
• The process of representing the solution in
the form of a string that conveys the
necessary information.

• Just as in a chromosome, each gene controls a


particular characteristic of the individual,
similarly, each element in the string represents a
characteristic of the solution.

8
Encoding Methods
• Binary Encoding – Most common method of encoding. Chromosomes are
strings of 1s and 0s and each position in the chromosome represents a
particular characteristic of the problem.

Chromosome A 10110010110011100101
Chromosome B 11111110000000011111

• Permutation Encoding – Useful in ordering problems such as the


Traveling Salesman Problem (TSP). Example. In TSP, every chromosome
is a string of numbers, each of which represents a city to be visited.

Chromosome A 1 5 3 2 6 4 7 9 8
Chromosome B 8 5 6 7 2 3 1 4 9

9
Encoding Methods (contd.)
• Value Encoding – Used in problems where complicated values, such as
real numbers, are used and where binary encoding would not suffice.
Good for some problems, but often necessary to develop some specific
crossover and mutation techniques for these chromosomes.

Chromosome A 1.235 5.323 0.454 2.321 2.454


Chromosome B (left), (back), (left), (right), (forward)

10
Encoding Methods (contd.)
• Tree Encoding – This encoding is used mainly for evolving programs or
expressions, i.e. for Genetic programming.
• Tree Encoding - every chromosome is a tree of some objects, such as
values/arithmetic operators or commands in a programming language.

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

Citation:
http://ocw.mit.edu/NR/rdonlyres/Aeronautics-and-Astronautics/16-888Spring-2004/D66C4396-90C8-49BE-BF4A-4EBE39CEAE6F/0/MSDO_L11_GA.pdf
11
GA Operators
13
Citation: http://www.ewh.ieee.org/soc/es/May2001/14/GA.GIF
Basic GA Operators

Recombination

Crossover - Looking for solutions near


existing solutions

Mutation - Looking at completely new


areas of search space

14
Fitness function
• quantifies the optimality of a solution (that is,
a chromosome): that particular chromosome
may be ranked against all the other
chromosomes

• A fitness value is assigned to each solution


depending on how close it actually is to solving the
problem.
• Ideal fitness function correlates closely to goal +
quickly computable.
• For instance, knapsack problem
Fitness Function = Total value of the things in the
knapsack 15
Recombination
Main idea: "Select The Best, Discard The Rest”.

The process that chooses solutions to be


preserved and allowed to reproduce and
selects which ones must to die out.

• The main goal of the recombination operator is to


emphasize the good solutions and eliminate the
bad solutions in a population ( while keeping the
population size constant )

16
So, how to select the best?

– Roulette Selection

– Rank Selection

– Steady State Selection

– Tournament Selection

17
Roulette wheel selection
Main idea: the fitter is the solution with the
most chances to be chosen

HOW IT WORKS ?

18
Example of Roulette wheel selection
No. String Fitness % Of Total

1 01101 169 14.4

2 11000 576 49.2

3 01000 64 5.5

10011 361 30.9


4
Total 1170 100.0

Citation: : www.cs.vu.nl/~gusz/ 19
Roulette wheel selection

Chromosome1
Chromosome 2
Chromosome 3
Chromosome 4

All you have to do is spin the ball and grab the chromosome at the
point it stops 
20
Crossover
Main idea: combine genetic material ( bits ) of
2 “parent” chromosomes ( solutions ) and
produce a new “child” possessing
characteristics of both “parents”.

How it works ?

Several methods ….

21
Crossover methods
• Single Point Crossover- A random point is chosen on the individual chromosomes (strings) and the genetic material is exchanged at this point.

Citation: http://www.ewh.ieee.org/soc/es/May2001/14/CROSS0.GIF

22
Crossover methods
• Two-Point Crossover- Two random points are
chosen on the individual chromosomes (strings) and
the genetic material is exchanged at these points.

Chromosome1 11011 | 00100 | 110110

Chromosome 2 10101 | 11000 | 011110

Offspring 1 10101 | 00100 | 011110

Offspring 2 11011 | 11000 | 110110

NOTE: These chromosomes are different from the last example.

23
Crossover methods
• Uniform Crossover- Each gene (bit) is selected
randomly from one of the corresponding genes of
the parent chromosomes.

Chromosome1 11011 | 00100 | 110110

Chromosome 2 10101 | 11000 | 011110

Offspring 10111 | 00000 | 110110

NOTE: Uniform Crossover yields ONLY 1 offspring.

24
Crossover (contd.)
• Crossover between 2 good solutions MAY NOT
ALWAYS yield a better or as good a solution.

• Since parents are good, probability of the child


being good is high.

• If offspring is not good (poor solution), it will be


removed in the next iteration during “Selection”.

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

• When creating a new population by crossover or


mutation the best chromosome might be lost.

• Forces GAs to retain some number of the best


individuals at each generation.

• Has been found that elitism significantly improves


performance.

26
Mutation
Main idea: random inversion of bits in
solution to maintain diversity in
population set

Ex. giraffes’ - mutations could be beneficial.


Citation: http://www.ewh.ieee.org/soc/es/May2001/14/MUTATE0.GIF
27
Advantages and disadvantages
Advantages:
• 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 (often hardest part)
• Termination Criteria
28
Applications - Genetic
programming and data mining

By: George Iordache

29
What is GA
• A genetic algorithm (or GA) is a search technique
used in computing to find true or approximate
solutions to optimization and search problems.
• Genetic algorithms are categorized as global
search heuristics.
• Genetic algorithms are a particular class of
evolutionary algorithms that use techniques
inspired by evolutionary biology such as
inheritance, mutation, selection, and crossover
(also called recombination).
What is GA
• Genetic algorithms are implemented as a computer simulation
in which a population of abstract representations (called
chromosomes or the genotype or the genome) of candidate
solutions (called individuals, creatures, or phenotypes) to an
optimization problem evolves toward better solutions.

• Traditionally, solutions are represented in binary as strings of


0s and 1s, but other encodings are also possible.
• Genetic algorithms (GAs) are most popular form of EC
• Early work in 1950s and 1960s; influential 1975 book by John
Holland laid foundation for modern implementations
• Dramatic increase in activity in mid-1980s
• Population-based structure well suited to parallel processing
Background: EC (cont’d)
• Motivation for EC: Evolution seems
to work well in nature.…perhaps it Prototype EC Method
can be used in optimization
Initial Population
• Three main types of EC
– Genetic Algorithms (Chap. 9 of Selection
ISSO) Next
Iteration
– Evolution Strategies (Chap. 10)
(Generation) Reproduction
– Evolutionary Programming
(Chap. 10)
Mutation
• Many other types of EC exist (ant
colony, particle swarm, differential
evolution, etc.)

9-32
Role of GAs in Global Problems
• GA largely motivated for global search/optimization problems
– Global problem generally very difficult
– GAs (and related) have long history of success in global
problems
– Some global problems essentially impossible to solve
• Much solid research and applications with GAs
• Unfortunately, more misrepresentations, dubious claims, and
“hype” than other methods. For example, GA software ads:
– “…can handle the most complex problems, including
problems unsolvable by any other method.”
– “…uses GAs to solve any optimization problem!”
• No clear indication of problem class(es) for which GAs are
superior to other methods
9-33
What is GA
• The evolution usually starts from a population of
randomly generated individuals and happens in
generations.

• In each generation, the fitness of every


individual in the population is evaluated, multiple
individuals are selected from the current
population (based on their fitness), and modified
(recombined and possibly mutated) to form a
new population.
What is GA
• The new population is then used in the next
iteration of the algorithm.
• Commonly, the algorithm terminates when
either a maximum number of generations
has been produced, or a satisfactory fitness
level has been reached for the population.
• If the algorithm has terminated due to a
maximum number of generations, a
satisfactory solution may or may not have
been reached.
Key terms
• Individual - Any possible solution
• Population - Group of all individuals
• Search Space - All possible solutions to the
problem
• Chromosome - Blueprint for an individual
• Trait - Possible aspect (features) of an individual
• Allele - Possible settings of trait (black, blond,
etc.)
• Locus - The position of a gene on the
chromosome
• Genome - Collection of all chromosomes for an
individual
Standard GA Operations
• Selection is the mechanism by which the “parents” are
chosen for producing offspring to be passed into next
generation
– Selection tends to pick best population elements as parents
• Elitism passes best chromosome(s) to next generation intact
– Elite chromosomes also eligible for selection as parents
– Inclusion of elitism critical to practical performance of GA
(Holland’s original formulation did not include elitism)
• Crossover takes parent-pairs from selection step and
creates offspring
• Mutation makes “slight” random modifications to some or all
of the offspring in next generation
• Selection, crossover, and mutation discussed below,
followed by the basic steps of a GA….
9-37
Chromosome, Genes and
Genomes
Genotype and Phenotype
• Genotype:
– Particular set of genes in a genome

• Phenotype:
– Physical characteristic of the genotype
(smart, beautiful, healthy, etc.)
Genotype and Phenotype
GA Requirements
• A typical genetic algorithm requires two things to be
defined:
• a genetic representation of the solution domain, and
• a fitness function to evaluate the solution domain.

• A standard representation of the solution is as an array of


bits. Arrays of other types and structures can be used in
essentially the same way.
• The main property that makes these genetic
representations convenient is that their parts are easily
aligned due to their fixed size, that facilitates simple
crossover operation.
• Variable length representations may also be used, but
crossover implementation is more complex in this case.
• Tree-like representations are explored in Genetic
programming.
Representation
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 ...
GA Requirements
• The fitness function is defined over the genetic representation and
measures the quality of the represented solution.
• The fitness function is always problem dependent.
• For instance, in the knapsack problem we want to maximize the
total value of objects that we can put in a knapsack of some fixed
capacity.
• A representation of a solution might be an array of bits, where
each bit represents a different object, and the value of the bit (0 or
1) represents whether or not the object is in the knapsack.
• Not every such representation is valid, as the size of objects may
exceed the capacity of the knapsack.
• The fitness of the solution is the sum of values of all objects in the
knapsack if the representation is valid, or 0 otherwise. In some
problems, it is hard or even impossible to define the fitness
expression; in these cases, interactive genetic algorithms are
used.
A fitness function
Basics of GA
• The most common type of genetic algorithm works like
this:
• a population is created with a group of individuals
created randomly.
• The individuals in the population are then evaluated.
• The evaluation function is provided by the programmer
and gives the individuals a score based on how well they
perform at the given task.
• Two individuals are then selected based on their fitness,
the higher the fitness, the higher the chance of being
selected.
• These individuals then "reproduce" to create one or
more offspring, after which the offspring are mutated
randomly.
• This continues until a suitable solution has been found or
a certain number of generations have passed,
depending on the needs of the programmer.
General Algorithm for GA
• Initialization
• Initially many individual solutions are randomly
generated to form an initial population. The
population size depends on the nature of the
problem, but typically contains several hundreds
or thousands of possible solutions.
• Traditionally, the population is generated
randomly, covering the entire range of possible
solutions (the search space).
• Occasionally, the solutions may be "seeded" in
areas where optimal solutions are likely to be
found.
Selection
• Parent selection methods based on probability of selection
being increasing function of fitness
• Roulette-wheel selection is common method
– Probability an individual is selected is equal to its fitness divided
by the total fitness in the population
• Problem: Selection probability highly dependent on units and
scaling for fitness function
– May cause premature convergence to local optima
• Rank selection and tournament selection methods reduce
sensitivity to choice of fitness function
– More robust: Only compare which chromosomes are better, not
relative magnitudes of fitness functions
– Often produce better practical results (see, e.g., examples in
Sect. 9.7 of ISSO)

9-47
General Algorithm for GA
• Selection
• During each successive generation, a proportion of the
existing population is selected to breed a new
generation.
• Individual solutions are selected through a fitness-based
process, where fitter solutions (as measured by a fitness
function) are typically more likely to be selected.
• Certain selection methods rate the fitness of each
solution and preferentially select the best solutions.
Other methods rate only a random sample of the
population, as this process may be very time-consuming.
• Most functions are stochastic and designed so that a
small proportion of less fit solutions are selected. This
helps keep the diversity of the population large,
preventing premature convergence on poor solutions.
Popular and well-studied selection methods include
roulette wheel selection and tournament selection.
Crossover
• Crossover provides means of “mixing” two parents (from
selection step) to provide two offspring
• For given parents, crossover occurs with specified
probability  1
– Else, parents placed directly into next generation (clones)
• Examples of crossover operator:
A. One-point crossover
B. Two-point crossover

9-49
Mutation
• Mutation operator introduces spontaneous variability (as in random search algorithms)
• Mutation generally makes only small changes to solution
• Bit-based coding and real (floating point) coding require different type of mutation
– Bit-based mutation generally involves “flipping” bit(s)
– Real-based mutation often involves adding small (Monte Carlo) random vector to
chromosomes
• Example below shows mutation on one element in chromosome in bit-based coding:

9-50
General Algorithm for GA
• In roulette wheel selection, individuals are
given a probability of being selected that is
directly proportionate to their fitness.

• Two individuals are then chosen randomly


based on these probabilities and produce
offspring.
General Algorithm for GA
Roulette Wheel’s Selection Pseudo Code:
for all members of population
sum += fitness of this individual
end for
for all members of population
probability = sum of probabilities + (fitness / sum)
sum of probabilities += probability
end for
loop until new population is full
do this twice
number = Random between 0 and 1
for all members of population
if number > probability but less than next probability
then you have been selected
end for
end
create offspring
end loop
General Algorithm for GA
• Reproduction
• The next step is to generate a second generation
population of solutions from those selected through
genetic operators:
crossover (also called recombination), and/or mutation.
• For each new solution to be produced, a pair of "parent"
solutions is selected for breeding from the pool selected
previously.
• By producing a "child" solution using the above methods
of crossover and mutation, a new solution is created
which typically shares many of the characteristics of its
"parents". New parents are selected for each child, and
the process continues until a new population of solutions
of appropriate size is generated.
General Algorithm for GA
• These processes ultimately result in the next
generation population of chromosomes that
is different from the initial generation.

• Generally the average fitness will have


increased by this procedure for the
population, since only the best organisms
from the first generation are selected for
breeding, along with a small proportion of
less fit solutions, for reasons already
mentioned above.
Crossover
• the most common type is single point crossover. In
single point crossover, you choose a locus at which you
swap the remaining alleles from on parent to the other.
This is complex and is best understood visually.
• As you can see, the children take one section of the
chromosome from each parent.
• The point at which the chromosome is broken depends
on the randomly selected crossover point.
• This particular method is called single point crossover
because only one crossover point exists. Sometimes
only child 1 or child 2 is created, but oftentimes both
offspring are created and put into the new population.
• Crossover does not always occur, however. Sometimes,
based on a set probability, no crossover occurs and the
parents are copied directly to the new population. The
probability of crossover occurring is usually 60% to 70%.
Crossover
Mutation

• After selection and crossover, you now have a new


population full of individuals.
• Some are directly copied, and others are produced by
crossover.
• In order to ensure that the individuals are not all exactly
the same, you allow for a small chance of mutation.
• You loop through all the alleles of all the individuals, and if
that allele is selected for mutation, you can either change it
by a small amount or replace it with a new value. The
probability of mutation is usually between 1 and 2 tenths of
a percent.
• Mutation is fairly simple. You just change the selected
alleles based on what you feel is necessary and move on.
Mutation is, however, vital to ensuring genetic diversity
within the population.
Mutation
General Algorithm for GA
• Termination
• This generational process is repeated until a
termination condition has been reached.
• Common terminating conditions are:
– 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 or
has reached a plateau such that successive iterations
no longer produce better results
– Manual inspection
– Any Combinations of the above
GA Pseudo-code
Choose initial population
Evaluate the fitness of each individual in the population
Repeat

Select best-ranking individuals to reproduce

Breed new generation through crossover and mutation


(genetic operations) and give birth to offspring

Evaluate the individual fitnesses of the offspring

Replace worst ranked part of population with offspring

Until <terminating condition>


Symbolic AI VS. Genetic
Algorithms
• Most symbolic AI systems are very static.
• Most of them can usually only solve one given
specific problem, since their architecture was
designed for whatever that specific problem was
in the first place.
• Thus, if the given problem were somehow to be
changed, these systems could have a hard time
adapting to them, since the algorithm that would
originally arrive to the solution may be either
incorrect or less efficient.
• Genetic algorithms (or GA) were created to
combat these problems; they are basically
algorithms based on natural biological evolution.
A Simple Example

The Traveling Salesman Problem:

Find a tour of a given set of cities so that


– each city is visited only once
– the total distance traveled is minimized
Representation
Representation is an ordered list of city
numbers known as an order-based GA.
1) London 3) Dunedin 5) Beijing 7) Tokyo
2) Venice 4) Singapore 6) Phoenix 8) Victoria

CityList1 (3 5 7 2 1 6 4 8)
CityList2 (2 5 7 6 8 1 3 4)
Crossover
Crossover combines inversion and
recombination:
* *
Parent1 (3 5 7 2 1 6 4 8)
Parent2 (2 5 7 6 8 1 3 4)

Child (5 8 7 2 1 6 3 4)

This operator is called the Order1 crossover.


Mutation
Mutation involves reordering of the list:

* *
Before: (5 8 7 2 1 6 3 4)

After: (5 8 6 2 1 7 3 4)
TSP Example: 30 Cities

120

100

80

y 60

40

20

0
0 10 20 30 40 50 60 70 80 90 100
x
Solution i (Distance = 941)
TSP30 (Performance = 941)

120

100

80

y 60

40

20

0
0 10 20 30 40 50 60 70 80 90 100
x
Solution j(Distance = 800)
44
62 TSP30 (Performance = 800)
69
67 120
78
64 100
62
54
80
42
50
40 y 60
40
38 40
21
35
67 20
60
60 0
40 0 10 20 30 40 50 60 70 80 90 100
42 x
50
99
Solution k(Distance = 652)
TSP30 (Performance = 652)

120

100

80

y 60

40

20

0
0 10 20 30 40 50 60 70 80 90 100
x
Best Solution (Distance = 420)
42
38 TSP30 Solution (Performance = 420)
35
120
26
21
35 100
32
7
80
38
46
44 y 60
58
60 40
69
76
20
78
71
69 0
67 0 10 20 30 40 50 60 70 80 90 100
62 x
84
94
Overview of Performance
TSP30 - Overview of Performance

1800

1600

1400

1200
e
c 1000
n
a
t
s
i 800
D
600

400

200

0 Best
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31
Worst
Generations (1000)
Average
Example
• f(x) = {MAX(x2): 0 <= x <= 32 }
• Encode Solution: Just use 5 bits (1 or 0).
• Generate initial population.
A 0 1 1 0 1

B 1 1 0 0 0

C 0 1 0 0 0

D 1 0 0 1 1

• Evaluate each solution against objective.


Sol. String Fitness % of Total
A 01101 169 14.4
B 11000 576 49.2
C 01000 64 5.5
D 10011 361 30.9
Example Cont’d
• Create next generation of solutions
– Probability of “being a parent” depends on the fitness.
• Ways for parents to create next generation
– Reproduction
• Use a string again unmodified.
– Crossover
• Cut and paste portions of one string to another.
– Mutation
• Randomly flip a bit.
– COMBINATION of all of the above.
Checkboard example
– We are given an n by n checkboard in which every
field can have a different colour from a set of four
colors.
– Goal is to achieve a checkboard in a way that there
are no neighbours with the same color (not diagonal)
1 1

2 2

3 3

4 4

5 5

6 6

7 7

8 8

9 9

10 10

1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10
Checkboard example Cont’d
– Chromosomes represent the way the checkboard is
colored.
– Chromosomes are not represented by bitstrings but by
bitmatrices
– The bits in the bitmatrix can have one of the four values 0,
1, 2 or 3, depending on the color.
– Crossing-over involves matrix manipulation instead of
point wise operating.
– Crossing-over can be combining the parential matrices in
a horizontal, vertical, triangular or square way.
– Mutation remains bitwise changing bits in either one of
the other numbers.
Checkboard example Cont’d
• This problem can be seen as a graph with n
nodes and (n-1) edges, so the fitness
f(x) is defined as:

f(x) = 2 · (n-1) ·n
Checkboard example Cont’d
• Fitnesscurves for different cross-over rules:
Lower-Triangular Crossing Over Square Crossing Over
180 180

170 170

160 160
Fitness

150 150

140 140

130 130
0 100 200 300 400 500 0 200 400 600 800

Horizontal Cutting Crossing Over Verical Cutting Crossing Over


180 180

170 170

160 160
Fitness

150 150

140 140

130 130
0 200 400 600 800 0 500 1000 1500
Generations Generations
THANK YOU

You might also like