Upload
dagmar-monett-diaz
View
1.001
Download
1
Embed Size (px)
DESCRIPTION
Online lecture at the School of Computer Science, University of Hertfordshire, Hatfield, UK, as part of the 10th Europe Week from 3rd to 7th March 2014.
Citation preview
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
Genetic Algorithms and
Ant Colony Optimisation
- An Introduction -
Prof. Dr. Dagmar Monett Díaz Computer Science Dept.
Faculty of Cooperative Studies
Berlin School of Economics and Law
Europe Week, 3rd – 7th March 2014
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield 2
Can you guess what it is?
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
By Roger Alsing
At http://rogeralsing.com/2008/12/07/genetic-programming-evolution-of-mona-lisa/
After 904 314 iterations, the evolution of only 50 semi-
transparent polygons is almost perfect to Mona Lisa!!
Evolution of Mona Lisa
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield 10
Agenda
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield 11
Agenda
Where does the major content come from?
What are metaheuristics?
What is to be optimised?
Examples of metaheuristics
What do GA and ACO have in common?
Genetic Algorithms
Ant Colony Systems
Metaheuristics: current trends
Further reading, sources of inspiration, and more…
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield 12
©
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
Genetic Algorithms in
Search, Optimization, and
Machine Learning
David E. Goldberg
432 pp.
Addison-Wesley, 1989
ISBN-13: 978-0201157673
What I also use in my lectures at the HWR…
13
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
Genetic Algorithms
+ Data Structures
= Evolution Programs
Zbigniew Michalewicz
3rd, revised and extended Edition
Springer-Verlag, 1999
ISBN-13: 978-3540606765
What I also use in my lectures at the HWR…
14
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
Ant Colony Optimization
Marco Dorigo and Thomas Stützle
MIT Press, Cambridge, MA, 2004
ISBN-13: 978-3540606765
15
Further reading
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
Further reading
M. Dorigo, M. Birattari and T. Stützle (2006): “Ant Colony
Optimization: Artificial Ants as a Computational Intelligence
Technique”.
Available at
http://iridia.ulb.ac.be/IridiaTrSeries/rev/IridiaTr2006-
023r001.pdf
M. Dorigo and K. Socha (2007): “An Introduction to Ant
Colony Optimization”.
Available at
http://iridia.ulb.ac.be/IridiaTrSeries/rev/IridiaTr2006-
010r003.pdf
16
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield 17
What are metaheuristics?
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
A metaheuristic is…
„[…] a master strategy that guides and modifies
other heuristics (like local search procedures) to
produce solutions beyond those that are normally
generated in a quest for local optimality.“
18
According to Laguna (2002)
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield 19
What is to be optimised?
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
Bowled function
20
Z = X.^2 + Y.^2
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
Mexican hat
21
Z = sin(sqrt(X.^2+Y.^2)) ./ sqrt(X.^2+Y.^2)
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
The peaks surface
22
[X,Y,Z] = peaks(30);
surfc(X,Y,Z)
colormap hsv Image © http://www.mathworks.de/de/help/matlab/ref/surfc.html
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
TSP example nr. 1
23
By Dantzig, Fulkerson, and
Johnson (1954)
Solved instance:
42 cities in USA
Image © http://www.tsp.gatech.edu
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
TSP example nr. 2
24
By Groetschel and Holland
(1987)
Solved instance:
666 interesting
places in the world
Image © http://www.tsp.gatech.edu
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
TSP example nr. 3
25
By Applegate, Bixby,
Chvatal, and Cook
(2001)
Solved instance:
15,112 German cities
Image © http://www.tsp.gatech.edu
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield 26
By Applegate, Bixby,
Chvatal, Cook, and
Helsgaun (2004)
Solved instance:
24,978 cities in
Sweden
Image © http://www.tsp.gatech.edu
TSP ex. nr. 4
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield 27
By Nagata (2009)
Solved instance:
100,000 cities
(Mona Lisa TSP)
Image © http://www.tsp.gatech.edu
TSP ex. nr. 5
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
TSP ex. nr. 6
28
By Helsgaun
(2009)
Solved instance:
1,904,711 cities
(World TSP)
Image © http://www.tsp.gatech.edu
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
Other domains
29
Quadratic assignment problems
Scheduling problems
Vehicle routing
Routing in communication networks
Graph colouring
Design problems in engineering
And many, many more!
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield 30
Examples of metaheuristics
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
Metaheuristics
31
Traditional approaches:
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
Metaheuristics
32
Traditional approaches:
EC (Evolutionary Computation)
• GA (Genetic Algorithms), ES (Evolution
Strategies), GP (Genetic Programming), etc.
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
Metaheuristics
33
Traditional approaches:
EC (Evolutionary Computation)
• GA (Genetic Algorithms), ES (Evolution
Strategies), GP (Genetic Programming), etc.
SA (Simulated Annealing), TS (Tabu Search),
ANN (Artificial Neural Networks), EDA (Estimation
of Distribution Algorithms), ACO (Ant Colony
Optimization), etc.
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
Metaheuristics
34
Traditional approaches:
EC (Evolutionary Computation)
• GA (Genetic Algorithms), ES (Evolution
Strategies), GP (Genetic Programming), etc.
SA (Simulated Annealing), TS (Tabu Search),
ANN (Artificial Neural Networks), EDA (Estimation
of Distribution Algorithms), ACO (Ant Colony
Optimization), etc.
Hybrid metaheuristics recent approaches!
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield 35
What do GA and ACO have in
common?
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
GA and ACO
36
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
GA and ACO
37
Nature-inspired algorithms
GA (Holland, 1975): simulates the process of
natural selection (i.e. Darwin’s theory of evolution)
ACO (Dorigo, 1991): simulates behaviour of ant
colonies
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
GA and ACO
38
Nature-inspired algorithms
GA (Holland, 1975): simulates the process of
natural selection (i.e. Darwin’s theory of evolution)
ACO (Dorigo, 1991): simulates behaviour of ant
colonies
Population-based algorithms
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
GA and ACO
39
Nature-inspired algorithms
GA (Holland, 1975): simulates the process of
natural selection (i.e. Darwin’s theory of evolution)
ACO (Dorigo, 1991): simulates behaviour of ant
colonies
Population-based algorithms
Stochastic search methods (probabilities are used)
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
GA and ACO
40
Nature-inspired algorithms
GA (Holland, 1975): simulates the process of
natural selection (i.e. Darwin’s theory of evolution)
ACO (Dorigo, 1991): simulates behaviour of ant
colonies
Population-based algorithms
Stochastic search methods (probabilities are used)
Near-optimal solutions are to be found (global
convergence is not guaranteed)
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
GA and ACO
41
Nature-inspired algorithms
GA (Holland, 1975): simulates the process of
natural selection (i.e. Darwin’s theory of evolution)
ACO (Dorigo, 1991): simulates behaviour of ant
colonies
Population-based algorithms
Stochastic search methods (probabilities are used)
Near-optimal solutions are to be found (global
convergence is not guaranteed)
Parameter tuning plays an important role
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield 42
Genetic Algorithms
– Pseudo code –
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
GA pseudo code
43
begin GA;
t = 0;
random P( t );
evaluate P( t );
statistics P( t );
while not done {
t = t+1;
P' = select P( t );
recombine P'( t );
evaluate P'( t );
P = survive P( t ), P'( t )
statistics P( t );
}
end GA;
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
GA pseudo code
44
begin GA;
t = 0;
random P( t );
evaluate P( t );
statistics P( t );
while not done {
t = t+1;
P' = select P( t );
recombine P'( t );
evaluate P'( t );
P = survive P( t ), P'( t )
statistics P( t );
}
end GA;
Initialize a usually random
population of individuals
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
GA pseudo code
45
begin GA;
t = 0;
random P( t );
evaluate P( t );
statistics P( t );
while not done {
t = t+1;
P' = select P( t );
recombine P'( t );
evaluate P'( t );
P = survive P( t ), P'( t )
statistics P( t );
}
end GA;
Evaluate the fitness of all
individuals
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
GA pseudo code
46
begin GA;
t = 0;
random P( t );
evaluate P( t );
statistics P( t );
while not done {
t = t+1;
P' = select P( t );
recombine P'( t );
evaluate P'( t );
P = survive P( t ), P'( t )
statistics P( t );
}
end GA;
Compute statistics, keep
the best individual so far,
etc.
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
GA pseudo code
47
begin GA;
t = 0;
random P( t );
evaluate P( t );
statistics P( t );
while not done {
t = t+1;
P' = select P( t );
recombine P'( t );
evaluate P'( t );
P = survive P( t ), P'( t )
statistics P( t );
}
end GA;
Test for termination criteria
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
GA pseudo code
48
begin GA;
t = 0;
random P( t );
evaluate P( t );
statistics P( t );
while not done {
t = t+1;
P' = select P( t );
recombine P'( t );
evaluate P'( t );
P = survive P( t ), P'( t )
statistics P( t );
}
end GA;
Select a sub-population for
offspring production
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
GA pseudo code
49
begin GA;
t = 0;
random P( t );
evaluate P( t );
statistics P( t );
while not done {
t = t+1;
P' = select P( t );
recombine P'( t );
evaluate P'( t );
P = survive P( t ), P'( t )
statistics P( t );
}
end GA;
Stochastically perturb
genes of selected
parents (apply mutation
operators) and recombine
them (apply crossover
operators)
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
GA pseudo code
50
begin GA;
t = 0;
random P( t );
evaluate P( t );
statistics P( t );
while not done {
t = t+1;
P' = select P( t );
recombine P'( t );
evaluate P'( t );
P = survive P( t ), P'( t )
statistics P( t );
}
end GA;
Evaluate the new fitness
of all individuals
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
GA pseudo code
51
begin GA;
t = 0;
random P( t );
evaluate P( t );
statistics P( t );
while not done {
t = t+1;
P' = select P( t );
recombine P'( t );
evaluate P'( t );
P = survive P( t ), P'( t );
statistics P( t );
}
end GA;
Select the survivors for
next generations. Should
you apply elitism?
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
GA pseudo code
52
begin GA;
t = 0;
random P( t );
evaluate P( t );
statistics P( t );
while not done {
t = t+1;
P' = select P( t );
recombine P'( t );
evaluate P'( t );
P = survive P( t ), P'( t )
statistics P( t );
}
end GA;
Compute new statistics
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield 53
What are the basic components
in a GA?
What should be defined?
Image © renjith krishnan at http://www.freedigitalphotos.net/
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield 54
Genetic Algorithms
– Basic components –
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
Basic components
55
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
Basic components
56
A genetic representation of solutions to the
problem,
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
Basic components
57
A genetic representation of solutions to the
problem,
a way to create an initial population of solutions,
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
Basic components
58
A genetic representation of solutions to the
problem,
a way to create an initial population of solutions,
an evaluation function (i.e., the environment),
rating solutions in terms of their ‘fitness’
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
Basic components
59
A genetic representation of solutions to the
problem,
a way to create an initial population of solutions,
an evaluation function (i.e., the environment),
rating solutions in terms of their ‘fitness’
‘genetic’ operators that alter the genetic
composition of children during reproduction, and
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
Basic components
60
A genetic representation of solutions to the
problem,
a way to create an initial population of solutions,
an evaluation function (i.e., the environment),
rating solutions in terms of their ‘fitness’
‘genetic’ operators that alter the genetic
composition of children during reproduction, and
values for the parameters (population size,
probabilities of applying genetic operators, etc.)
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield 61
Genetic Algorithms
– Genetic operators –
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
Example of crossover operator
62
Single point crossover (Also “Simple crossover”)
Parents:
Offspring:
Crossover point: kth position
. . . . . .
1 k k+1 q
P1=(x1, …, xq)
P2=(y1, …, yq)
O1=(x1, …, xk, yk+1, …, yq)
O2=(y1, …, yk, xk+1, …, xq)
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
Example of mutation operator
63
Boundary mutation
When using floating point representation: assign the new
allele the value of one of the boundaries:
if r < 0.5 then
NewAllele := LowerBound;
else NewAllele := UpperBound;
with r generated at random in [0, 1]
LowerBound UpperBound
NewAllele = or
OldAllele
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield 64
Genetic Algorithms
– Other issues –
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
Other issues
65
Representation of individuals
Selection mechanisms
Parallel implementations
Adaptive Genetic Algorithms
Other evolutionary algorithms
Application domains
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield 66
Ant Colony Optimization
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
ACO
67
Strategies of real ants (e.g. to find food) are used
to solve optimisation problems
The behaviour of the system (swarm) emerges as
a result of the indirect communication of individuals
through the environment (‘stigmergy’)
Ants lay and follow pheromone trails
Deposited pheromone on a path depends on the
quality of that solution. It evaporates with time.
Ants collectively search the solution space
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield 68
Ant Colony Optimization
– Pseudo code –
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
ACO pseudo code (i)
69
© Dorigo & Di Caro at http://informatics.indiana.edu/jbollen/I501F13/readings/dorigo99ant.pdf
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
ACO pseudo code (i)
70
© Dorigo & Di Caro at http://informatics.indiana.edu/jbollen/I501F13/readings/dorigo99ant.pdf
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
ACO pseudo code (i)
71
© Dorigo & Di Caro at http://informatics.indiana.edu/jbollen/I501F13/readings/dorigo99ant.pdf
Ant lifecycle
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
ACO pseudo code (i)
72
© Dorigo & Di Caro at http://informatics.indiana.edu/jbollen/I501F13/readings/dorigo99ant.pdf
The pheromone trail intensity
automatically decreases over time
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
ACO pseudo code (i)
73
© Dorigo & Di Caro at http://informatics.indiana.edu/jbollen/I501F13/readings/dorigo99ant.pdf
E.g., activation of a local
optimisation procedure
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
ACO pseudo code (ii)
74
© Dorigo & Di Caro at
http://informatics.indiana.edu/jbollen/
I501F13/readings/dorigo99ant.pdf
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
ACO pseudo code (ii)
75
© Dorigo & Di Caro at
http://informatics.indiana.edu/jbollen/
I501F13/readings/dorigo99ant.pdf
Where to go next?
E.g., go to nearest
node or follow
more intense
pheromone trail?
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
ACO pseudo code (ii)
76
© Dorigo & Di Caro at
http://informatics.indiana.edu/jbollen/
I501F13/readings/dorigo99ant.pdf
Update pheromone
trail locally
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
ACO pseudo code (ii)
77
© Dorigo & Di Caro at
http://informatics.indiana.edu/jbollen/
I501F13/readings/dorigo99ant.pdf
Update pheromone
trail after constructing
a complete solution
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
ACO pseudo code (ii)
78
© Dorigo & Di Caro at
http://informatics.indiana.edu/jbollen/
I501F13/readings/dorigo99ant.pdf
Free allocated
resources
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield 79
Metaheuristics: current trends
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
Current trends
Combination of aspects from different
metaheuristics, Artificial Intelligence, Operations
Research techniques, etc.
Parallel algorithms to distribute the
computational effort.
Optimization of parameters (i.e. configuration
process) is a relevant issue
Application to other domains
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
Configuration of algorithms
(or “fine-tuning” of algorithms)
Not all metaheuristic algorithms are auto-adaptive (in particular the hybrid approaches)
Usually, control parameters are set by hand or in the spirit of brute-force mechanisms; time-consuming task
Few published research works; not yet an established research area
Distributed, remote or parallel execution of configuration algorithms: not existing (?)
Shortcomings:
Special topic in most recent conferences and workshops; current open question!!
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield 82
Homework:
“Search for implementations of GA
and ACO that simulate their
functioning and evaluate them!”
Image © renjith krishnan at http://www.freedigitalphotos.net/
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield 83
Assessment
Image © renjith krishnan at http://www.freedigitalphotos.net/
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
Questions
84
Mention and comment three similarities
between Genetic Algorithms and Ant Colony
Optimisation!
Mention and comment three differences!
PLEASE ANSWER AT:
https://docs.google.com/forms/d/1Mog_vgm1hFV4CLnM1XjYUYVmPlepH6iu9OTeivKONQA/viewform
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield 85
References
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
Others…
86
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
Further reading and sites…
Metaheuristics Network, at
http://www.metaheuristics.net/
Ant Colony Optimization, official Web site of the
ant colony metaheuristic, at http://www.aco-
metaheuristic.org/
87
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield 88
Can you guess what it is?
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
516 – 7
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
1 013 – 9
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
2 520 – 15
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
3 519 – 16
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
5 012 – 21
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
7 015 – 21
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
10 016 – 24
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
15 017 – 25
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
20 039 – 27
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
35 008 – 38
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
51 479 – 52
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
160 768 – 86
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
356 051 – 103
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
1 008 736 – 140
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield 103
?
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield
Timmy
D. Monett – Europe Week 2014, University of Hertfordshire, Hatfield 105
Slides of the talk per request:
Prof. Dr. Dagmar Monett Díaz
monettdiaz
@dmonett
http://monettdiaz.com