Professional Documents
Culture Documents
Mod 3
Mod 3
FITNESS
FUNCTION
SELECTION
CROSSOVER
MUTATION
OPTIMIZED?
New Velocity
Application of ACO
Shortest paths and routing
Assignment problem
Set Problem
• PSO clustering algorithm avoid the problems that arise with Kmeans
clustering such as terminating at local minimum, generating empty
clusters and sensitivity to noisy data and outliers.
Law of Gravity: each particle attracts every other particle and the
gravitational force between two particles is directly proportional to the
product of their masses and inversely proportional to power p of the distance
between them, R^p.
Law of Motion: the current velocity of any particle is equal to the sum of the
fraction of its previous velocity and the variation in the velocity. Variation in
the velocity or acceleration of any particle is equal to the force acted on the
system divided by its mass.
objects
• Position
solution of the problem
Law of gravity
N
2
Law of motion 1 2
Meeting end of
Criterion?
.Evaluation .Evaluation
.Evaluation .Mass calculation .Mass calculation
.Mass calculation .F, a, V .F, a, V
.Calculation of F, a, V .X=X+V .X=X+V
.X=X+V
t : time / iteration
Thursday, 01 December 2022 Instructor: Dr. Kovendan AKP 25
Initialization
• At the first iteration, each agents is randomly
allocated in the search space.
• xd,hi and xd,low are the boundaries of the variable d.
x id (t 1) ~ U(x d, low , x d, hi )
xid xid ,lo xid , hi xid ,lo xin for d 1, 2, ..., m
i 1,2,..., N
qi (t )
M i (t )
N
q j (t )
j 1
M (t ) M (t ) M (t ) M (t )
ai pi ii i
Thursday, 01 December 2022 Instructor: Dr. Kovendan AKP 28
Mass calculation
• In minimization problems:
• In maximization problems:
G (t ) G (G0 , t )
t
G (t ) G0 e T
M (t ) M (t )
d aj pi d (t ) x d (t ) )
F (t ) G (t ) ( x
ij R (t ) P j i
ij
d 1, 2, , m and i 1, 2, , N
i=1,…,N d=1,…,m
d d d
vi (t 1) randi vi (t ) ai (t )
d d d
xi (t 1) xi (t ) vi (t 1)
Player 2 Player 2
0 1 1
0
0 1 0 1 0 1 0 1
-1 -1 -1 1 -1 1 1 -1
Player 1’s
Thursday, 01 utility
Decemberis2022
in the leaves; player 2’s utility
Instructor: is the
Dr. Kovendan AKPnegative of this 38
Backward induction (aka. minimax)
• From leaves upward, analyze best decision for player at node, give
node a value
– Once we know values, easy to find optimal action (choose best value)
1 Player 1
0 1
Player 2 Player 2
-1 1
0 1 1
0
0 1 0 1 0 1 0 1
-1 -1 -1 1 -1 1 1 -1
Thursday, 01 December 2022 Instructor: Dr. Kovendan AKP 39
Modified game
• From leaves upward, analyze best decision for
player at node, give node a value
6 Player 1
0 1
Player 2 Player 2
-1 6
0 1 1
0
0 1 0 1 0 1 0 1
-1 -2 -3 4 -5 6 7 -8
Thursday, 01 December 2022 Instructor: Dr. Kovendan AKP 40
A recursive implementation
• Value(state)
• If state is terminal, return its value
• If (player(state) = player 1)
– v := -infinity
– For each action
• v := max(v, Value(successor(state, action)))
– Return v
• Else
– v := infinity Space? Time?
– For each action
• v := min(v, Value(successor(state, action)))
– Return v
Thursday, 01 December 2022 Instructor: Dr. Kovendan AKP 41
Thursday, 01 December 2022 Instructor: Dr. Kovendan AKP 42