Introduction To Genetic Algorithms Theory and Applications
Introduction To Genetic Algorithms Theory and Applications
Introduction To Genetic Algorithms Theory and Applications
Oklahoma
Symposium
on
Tutorial Outline
1
Artificial
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
Morgan
14:347-361.
23.D. Whitley and J. Kauth, GENITOR: A Different Genetic Algorithm,
Proceedings of the Rocky Mountain Conference on Artificial Intelligence, Denver,
Co., 1988, pp. 118-130.
24.D. Whitley, T. Starkweather, and D. Fuquat, "Scheduling Problems and
Traveling Salesman: The Genetic Edge Recombination Operator", Proceedings of
the Third International Conference on Genetic Algorithms, June, 1989.
25.D. Whitley and T. Starkweather, "GENITOR II: A Distributed Genetic
Algorithm", Journal of Experimental and Theoretical Artificial Intelligence,
2(1990) 189-214.
Grefenstette [16]
"A genetic Algorithm is an iterative procedure maintaining a
population of structures that are candidate solutions to specific
domain challenges. During each temporal increment (called a
generation), the structures in the current population are rated for
their effectiveness as domain solutions, and on the basis of these
evaluations, a new population of candidate solutions is formed using
specific genetic operators such as reproduction, crossover, and
mutation."
Goldberg [8]
"They combine survival of the fittest among string structures with
a structured yet randomized information exchange to form a search
algorithm with some of the innovative flair of human search. In
every generation, a new set of artificial creatures (strings) is created
using bits and pieces of the fittest of the old; an occasional new part
is tried for good measure. While randomized, genetic algorithms
are no simple random walk. They efficiently exploit historical
information to speculate on new search points with expected
improved performance."
_
Genetic Algorithms (GAs) are search
algorithms based on the mechanics of the natural
selection process (biological evolution). The most
basic concept is that the strong tend to adapt and
survive while the weak tend to die out. That is,
optimization is based on evolution, and the "Survival
of the fittest" concept.
_
GAs have the ability to create an initial
population of feasible solutions, and then recombine
them in a way to guide their search to only the most
promising areas of the state space.
_
Each feasible solution is encoded as a
chromosome (string) also called a genotype, and each
chromosome is given a measure of fitness via a
fitness (evaluation or objective) function.
_
The fitness of a chromosome determines its
ability to survive and produce offspring.
_
A finite population of chromosomes is
maintained.
_
GAs use probabilistic rules to evolve a
population from one generation to the next. The
generations of the new solutions are developed by
genetic recombination operators:
_ Biased Reproduction: selecting the fittest to
reproduce)
_ Crossover: combining parent chromosomes to
produce children chromosomes
_ Mutation: altering some genes in a
chromosome.
_ Crossover combines the "fittest" chromosomes
and passes superior genes to the next generation.
_ Mutation ensures the entire state-space will
be searched, (given enough time) and can lead the
population out of a local minima.
_
11
13
14
GA
_ Population of Feasible Solutions
_ Evaluation Function
_ Selection Bias
_ Reproduction
_ Mutation
15
17
GENETIC ALGORITHMS
Preliminary Considerations
1. Determine how a feasible solution should be represented
a) Choice of Alphabet. This should be the smallest alphabet
that permits a natural expression of the problem.
b) The String Length. A string is a chromosome and each
symbol in the string is a gene.
18
A Genetic Algorithm
19
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.
UNTIL Maximum number of generation is reached.
20
21
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
_ Crossover point(s) is determined stochastically
_ The Crossover Operator is the most important feature
in a GA
Single Point Crossover Example
Parent 1
Parent 2
100
001
1001010
0110111
Child 1
Child 2
100
001
0110111
1001010
110100
010110
1001
0010
011
101
Child 1
Child 2
110100
010110
0010
1001
011
101
25
Mutation
_ The Mutation operator guarantees the entire state-space
will be searched, given enough time.
_ Restores lost information or adds information to the population.
_ Performed on a child after crossover.
_ Performed infrequently (For example, 0.005 probability of
altering a gene in a chromosome)
Child 1
1101 0 00010011
after mutation 1 1 0 1 1 0 0 0 1 0 0 1 1
26
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
28
29
Fundamental
Algorithms
Theorem
of
Genetic
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
4 * 25.753 / 17.198
6 >=
In Other Words:
Theorem: The number of representatives of any schema, S,
increases in proportion to the observed relative performance of S.
31
Deception
What Problems are Difficult for GAs
Example: an order-3 deception [25]
"information represented by the schemata in the search space leads
the search away from the global optimum, and instead directs the
search toward the binary string that is the complement of the global
optimum. The search space is order-3 deceptive .. if the following
relationships hold for the [three-bit] schemata:"
0** > 1**
*0* > *1*
**0 > **1
and
and
and
but, 111 > 000, 001, 010, 100, 110, 101, 011
Example: f(000) = 28 f(100) = 14
f(001) = 26 f(101) = 10
f(010) = 22 f(110) = 5
f(011) = 20 f(111) = 30
Chaotic, noisy and "needle in a haystack" functions
GA-easy, GA-hard problems
32
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
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
Example Applications of Genetic Algorithms
Order-Based Genetic Algorithms
Parent 1
3719 | 645 | 28
Parent 2
4785 | 392 | 16
( 6 <--> 3 )
( 4 <--> 9 )
( 5 <--> 2 )
Child 1
6714 | 392 | 58
Child 2
9782 | 645 | 13
Reorder a sublist
98 | 76543 | 21
==> 9 8 | 5 3 4 6 7 | 2 1
38
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
40
Capacity
Unknown
packages
Evaluation: Height returned by the Next Fit of First Fit Heuristic
Crossover: Order2, Cycle, PMX, and Random Swap
Mutation: Adaptive, swap 2 packages and rotate on one axis.
42
TablesfromARTpage12and14
43
44
45
46
47
48
49