Lecture 4
Lecture 4
Artificial Intelligence
Outline
Genetic Algorithms.
Particle Swarm Optimization.
Ant Colony Optimization.
Genetic Algorithms
History of GAs.
Applications of GAs.
Components of GAs.
General GA evolutionary loop.
Examples.
Genetic Algorithms
Invented by John Holland (1975).
Using population-based approach.
Based on Natural Selection ('survival of the
fittest).
Use usually fixed length and linear
representation of chromosomes.
Genetic Operators for modification:
Crossover and Mutation.
Genetic Algorithms -
Applications
Domain Application Types
Control gas pipeline, pole balancing, missile evasion, pursuit
YES
Are stopping criteria satisfied ? Stop &Report
NO
Select individuals based on fitness
00010110100111010010
Permutation representation for problem 3.
(2 5 7 6 8 1 3 4)
Truncated selection.
0.08
Annealing selection. 0.5
(, ) selection.
(+) selection.
……
Genetic Algorithms -
Crossover and Mutation
Problem 1, 2:
Crossover
01011011110 01011011110
01011011110 01011011110
Mutation
01011011110
01011001110
Genetic Algorithms -
Crossover and Mutation
Problem 3:
Crossover
Mutation
43521 41523
Genetic Algorithms -
Crossover and Mutation
Problem 4:
Crossover
Mutation
Genetic Algorithms -
Parameters
History of PSO
Full PSO model
Aspects of the basic PSO
Performance Measures
INVENTORS
Proposed in 1995 by Eberhart and Kennedy
Used for solving optimization problems of
continuous nonlinear functions
sk 1 gbest k
gbest k
v k 1 d
k
v
k
pbest
k pbest k
s d
Particle Flying Model
k 1 k k 1
s s v
w1 c1 rand ()
w2 c2 rand ()
i i i
sk 1 gbest k
gbest k
k 1 d
k 1 k k v
v i v v
i i
v k
pbest k
k pbest k
s d
Do
Do
For
Foreach
eachparticle
particle
Calculate
Calculatefitness
fitnessvalue
value
IfIfthe
thefitness
fitnessvalue
valueisisbetter
betterthan
thanthe
thebest
bestfitness
fitnessvalue
value(pbest)
(pbest)in
in
history
history
set
setcurrent
currentvalue
valueasasthe
thenew
newpbest
pbest
End
End
Choose
Choosethe theparticle
particlewith
withthe
thebest
bestfitness
fitnessvalue
valueof ofall
allthe
theparticles
particlesas
as
the
thegbest
gbest
For
Foreach
eachparticle
particle
Calculate
Calculateparticle
particlevelocity
velocityaccording
accordingequation
equation(*) (*)
Update
Updateparticle
particleposition
positionaccording
accordingequation
equation(**)(**)
End
End
*
k 1 k k
v
While v
i stopping vi condition is true k 1 k k
While i
k stopping condition k is
k true k k
vi c1 rand () ( pbesti si ) c2 rand () ( gbest si ) ** si si vi
GBEST PSO AND LBEST PSO
Gbest PSO:
Neighbor of particles is
the entire swarm
Lbest PSO:
Neighbor of a particle is
some particles that are
near to the particle.
INITIALISING PSO
The position:
Should be initialized to uniformly cover the
search space
The velocity:
can be initialized to zero: vij (0) 0
STOPPING CONDITIONS
Two guiding
principles:
The stopping coditions
should not cause PSO
to prematurely
The stopping condition
should not lead to
over-calculation of the
fitness values
STOPPING CONDITIONS
There have been some ways to terminate
PSO algorithms
Terminate when a maximum number of
iterations has been exceeded.
Terminate when an acceptable solution has
been found
Terminate when no improvement is observed
over a number of iterations
Terminate when the normalized swarm radius
is close to zero
Terminate when the objective function slope is
approximately zero
BASIC PSO PARAMETERS
Swarm size:
from 10 to 30
Neighborhood size:
Smaller neighborhood sizes
n
Reliability : reliabilit y ( S (t ), )
N
100
A. P. Engelbrecht, Fundamentals of
Computational Swarm Intelligence, John
Wiley & Sons, 2006.
R. C. Eberhart, Swarm Intelligence, Morgan
Kaufmann, 2001.
Ant Colony Optimization
(ACO)
ACO history
ACO applications.
Implementation Steps.
ACO basic algorithms
ACO-History
Goss et al. 1989,
Deneuborg et al.
1990, experiments
with Argentine
ants
Dorigo et al. 1991,
applications to
shortest path
problems
Now: established
method for various
optimization
problems
ACO-Applications
Efficiently Solves NP hard Problems 1
Routing
5
TSP (Traveling Salesman Problem) 2
Vehicle Routing
Sequential Ordering
Assignment 3 4
QAP (Quadratic Assignment Problem)
Graph Coloring
Generalized Assignment
Frequency Assignment
University Course Time Scheduling
ACO-Applications
Scheduling
Job Shop
Open Shop
Flow Shop
Total tardiness (weighted/non-weighted)
Project Scheduling
Group Shop
Subset
Multi-Knapsack
Max Independent Set
Redundancy Allocation
Set Covering
Weight Constrained Graph Tree partition
Arc-weighted L cardinality tree
Maximum Clique
ACO-Applications
Other
Shortest Common Sequence
Constraint Satisfaction
2D-HP protein folding
Bin Packing
Machine Learning
Classification Rules
Bayesian networks
Fuzzy systems
Network Routing
Connection oriented network routing
Connection network routing
Optical network routing
Problem Solving by ACO
costs
States = lists of nodes
edges
Constraints for feasible states, solutions
Daemon
activities
General Ant Colony
Heuristic
Ants generation and
activity: compute
make decision
while resources transition
and move
probabilities
available: create
ant
for each ant:
evaluate
1. initialize the current
update the
state
2. let ant run until a state
solution is found possibly
3. possibly: update update
pheromone
pheromone and
routing table
Ant System (AS)
Used to solve TSP
Transition from city i to j depends on:
1. Tabu list – list of cities not visited
2. Visibility = 1/dij; represents local information –
heuristic desirability to visit city j when in city i.
3. Pheromone trail Tij(t) for each edge – represents
the learned desirability to visit city j when in city i.
k
p (t )
ij
(t ) . ij
(t ) . il
ij
il
J ik
k
p (t )
ij (t ) .
ij
(t ) . il
ij
il
J ik
Q / L (t ) if (i, j ) T (t ) else 0.
k
ij
k k
ij (t ) (1 ). ij (t ) ij (t )
Ant Colony System (ACS)
k
j arg max uJ i { ij (t ) .iu } if q qo j J
Modifications to AS.
New transition rule:
qo is a parameter that can be tweaked
It is similar to tuning temperature in SA.
J is a city randomly selected according to the
probability calculated previously.
This helps ACS to improvise on the best
solutions.
Ant Colony System (ACS)
ij (t ) (1 ). ij (t ) 0
ACO - Further Readings
A. P. Engelbrecht, Fundamentals of
Computational Swarm Intelligence, John
Wiley & Sons, 2006.
E. Bonabeau, M. Dorigo, G. Theraulaz,
Swarm Intelligence: From Natural to
Artificial Systems, Oxford University Press,
1999.
ACO tutorials by Marco Dorigo.