Professional Documents
Culture Documents
Introduction To Genetic Algorithms Theory and Applications
Introduction To Genetic Algorithms Theory and Applications
Roger L. Wainwright
Tulsa, OK 74104-3189
(918) 631-3143
rogerw@penguin.mcs.utulsa.edu
C Copyright RLW 1993
Tutorial Outline
1
Part I Introduction and Concepts of Genetic Algorithms
_ Bibliography
_ GA Definitions
_ Overview of GAs
_ When to Use GAs
_ GA vs Traditional Algorithms
_ GA vs SA
_ Applications of GA
_ The Standard GA (Algorithm)
_ Population Representation
_ Reproduction
_ Example GA Fitness Function
_ Roulette Wheel
_ Crossover
_ Mutation
_ Schema Theory
_ Fundamental Theorem of GA
_ Deception
_ Genetic Programming
Tutorial Outline
2
Part II Example Applications of Genetic Algorithms
3
Primary GA Bibliography (1993)
28.Blanton, J.L. and Wainwright, R.L. "Multiple Vehicle Routing with Time
and Capacity Constraints using Genetic Algorithms", Proceedings of the Fifth
International Conference on Genetic Algorithms (ICGA-93), Stephanie
Forrest, Editor, Morgan Kaufmann Publisher, 1993, pp. 452-459.
34.Prince, C., Wainwright, R.L., Schoenefeld, D.A. and Tull, T., "GATutor: A
Graphical Tutorial System for Genetic Algorithms" to appear in the 25th ACM
SIGCSE Technical Symposium - SIGCSE'94, March, 1994.
Goldberg [8]
10
_ Determining the size of the population is a
crucial factor
_ Choosing a population size too small
increases the risk of converging prematurely to a
local minima, since the population does not have
enough genetic material to sufficiently cover the
problem space.
11
Genetic Algorithms Overview Continued
13
Genetic Algorithms vs Traditional Algorithm
Goldberg [8]
14
Genetic Algorithms vs. Simulated Annealing
SA
_ 1 Feasible Solution
_ Perturbation Function
_ Acceptance Function
_ Temperature Parameter
GA
_ Evaluation Function
_ Selection Bias
_ Reproduction
_ Mutation
15
Applications of Genetic Algorithms
_ Scheduling:
Facility, Production, Job, and Transportation Scheduling
_ Design:
Circuit board layout, Communication Network design,
keyboard layout, Parametric design in aircraft
_ Control:
Missile evasion, Gas pipeline control, Pole balancing
_ Machine Learning:
Designing Neural Networks, Classifier Systems, Learning rules
_ Robotics:
Trajectory Planning, Path planning
_ Combinatorial Optimization:
TSP, Bin Packing, Set Covering, Graph Bisection, Routing,
_ Signal Processing:
Filter Design
_ Image Processing:
Pattern recognition
_ Business:
Economic Forecasting; Evaluating credit risks
Detecting stolen credit cards before customer reports it is stolen
_ Medical:
Studying health risks for a population exposed to toxins
16
The Standard Genetic Algorithm
17
GENETIC ALGORITHMS
Preliminary Considerations
18
A Genetic Algorithm
2. REPEAT
A. Determine the fitness of each member of the population.
(Perform the objective function on each population member)
Fitness Scaling can be applied at this point. Fitness
Scaling adjusts down the fitness values of the super-
performers and adjusts up the lower performers, promoting
competition among the strings. As the population matures,
the really bad strings will drop out. Linear Scaling is
an example.
B. Reproduction (Selection)
Determine which strings are "copied" or "selected" for the
mating pool and how many times a string will be "selected"
for the mating pool. Higher performers will be copied more
often than lower performers. Example: the probability of
selecting a string with a fitness value of f is f/ft, where
ft is the sum of all of the fitness values in the population.
19
Genetic Algorithm Continued
C. Crossover
1. Mate each string randomly using some crossover technique
2. For each mating, randomly select the crossover position(s).
(Note one mating of two strings produces two strings.
Thus the population size is preserved.)
D. Mutation
Mutation is performed randomly on a gene of a chromosome.
Mutation is rare, but extremely important. As an example,
perform a mutation on a gene with probability .005.
If the population has g total genes (g = string length *
population size) the probability of a mutation on any one
gene is 0.005g, for example. This step is a no-op most of
the time. Mutation insures that every region of the problem
space can be reached. When a gene is mutated it is randomly
selected and randomly replaced with another symbol from the
alphabet.
20
Various Population Representations
21
Reproduction (Survival of the fittest)
22
Initial Population P0
No.Times
No.Chromosomexf(x)P(x)Selected *
1100111925.459.1852
201010109.144.0661
3110012531.465.2292
400110612.341.0900
5010111113.518.0981
6101112323.369.1701
70010043.885.0280
8100011718.399.1341
SUM115137.5801.0008
AVE1417.198.1251
MAX2531.465.2292
24
Crossover
_ Causes an exchange of genetic material between
two parents
25
Mutation
_ Adaptive Mutation:
_ Monitor the hamming distance between two parents.
_ The more similar the parents, the more likely mutation
is applied. Whitley, Starkweather [25]
26
Continuation of the fitness function
0 <= x >= 31
PopulationP1
(AfterCrossover.AssumenoMutation)
No.NewParentsCrossoverxf(x)
Chromosome(fromP0)Point
1 01 001 (2,8) 2 9
7.8552
210010(2,8)21823.141
310011(1,6)41925.459
410111(1,6)42323.369
511011(3,5)12728.331
601001(3,5)197.855
710001(1,3)31718.399
811011(1,3)32728.331
SUM149162.740
AVE1820.343
MAX2728.331
f(Pop0)=17.198
f(Pop1)=20.343
27
>>> plot of the function showing
the 8 initial points
of Pop0 and the 8 points of Pop1
28
Schema Theory (John Holland)
_ Order: o(H)
_ Length: delta(H)
29
Fundamental Theorem of Genetic
Algorithms
Where
m - number of schemata
H - schema
t - time or generation
f - fitness function
fave - average fitness value
pc - crossover probability
delta - length
l - string length
pm - mutation probability
o - order
30
Consider H = 1**** in the above problem:
6 >= 6
In Other Words:
31
Deception
but, 111 > 000, 001, 010, 100, 110, 101, 011
32
Overview of Genetic Programming
Koza [11]
Manipulate strings of instructions rather than strings of data.
Koza's initial problem: Given a set of initial predicates and possible actions,
develop (evolve) a computer program (in Lisp) to control the movement of an ant
searching for food. The chromosome is a variable sized Lisp program where the
leaf nodes are actions (left, right, move, etc.), and the internal nodes are predicates
or logic controls (if found food), etc. Each chromosome (program) is used to
control the actions of a simulated ant in searching for food. The evaluation
function for a given chromosome is the amount of food gathered by an ant in a
fixed amount of time.
33
Consider the following two parent computer
programs given as LISP S-expressions.
The first parent has 6 nodes (points) in its S-expression, and the second
parent has 10 points in its S-expression as shown above.
The above crossover fragments are exchanged at node "NOT" in the first
parent, and node "AND" in the second parent to produce the following
two children S-expressions [11].
35
Part II
36
Parent 1 3719 | 645 | 28
****
987654321==>937654821
Reorder a sublist
98 | 76543 | 21 ==> 9 8 | 5 3 4 6 7 | 2 1
TSP1024Cities.
PoolSize500250125
Length_String1024
Trials100000
Bias1.9
RandomSeed 15394157 <same>
<same>
MutateRate0.15
NodeFilecities1024
StatusInterval5000
38
TSP 320 Cities.
PoolSize20001000500250125
Length_String320
Trials100000a
Bias1.9
RandomSeed15394157<same><same><same><same>
MutateRate0.15
NodeFilecities320
StatusInterval1000
RESULTS:
Best:30,761b25,70821,36618,676c23,760d
Worst:35,10228,36623,23518,67623,760
Average:34,20927,86322,88018,67623,760
aApoolsizeof2000for205,000trialsyieldedbestof22,777
bCPUtimeonaSPARC1+wasapproximately100minutes.
cConvergedafter72,000trials
dConvergedprematurelyafter33,000trials
39
TSP 105 Cities.
PoolSize750500250125
Length_String105
Trials70000
Bias1.9
RandomSeed15394157<same><same><same>
MutateRate0.15
NodeFilecities105
StatusInterval1000
RESULTS:
Trialsat
Convergence:109,00061,00032,0009,000
Best:16,50317,19324,07932,370
Worst:16,50317,19324,07932,370
Average:16,50317,19324,07932,370
40
Additional Applications Using GAs
Rotated
Presorted
WithoutGAUsingaGAUsingaGA
NextFitRandom3135%4155%5766%
NextFitContrived4850%5671%6071%
FirstFitRandom36%4149%5363%
FirstFitContrived4153%5659%6777%
42
TablesfromARTpage12and14
43
Set Covering Problem Using GAs [35]
44
Multiple Vehicle Routing with Time
45
Genetic Algorithms and Neural Networks
Fixed Architecture
Example Representation:
Each weight ranges -127 to +127 (8-bits)
Each Chromosome is the concatenated binary weights of the net.
46
Genetic Algorithms and Neural Networks
Unknown Architecture
47
Parallel Genetic Algorithms
Parallel Issues [32]
Migration Interval
1. After 5,10,20,50,100 Generations
2. ADAPTIVE
Migration Rate
1. 10%, 20%, 50% of the population
2. ADAPTIVE
Topology
1. Ring
2. Hypercube dimensions alternation through the dimensions
48
Genetic Algorithm Packages (1993)
49