Page 59 - Algorithm Collections for Digital Signal Processing Applications using MATLAB
P. 59
1. Artificial Intelligence 47
Step 3: Next set of orders selected by the ants is as described below.
• Generate the position sequence randomly
7 8 2 3 6 4 1 5 (say)
Let the order decided by the ant1 be represented as [u1 u2 u3 u4 u5 u6
u7 u8 ]
• The value for the u7 in the order as mentioned above is selected first as
the first number of the randomly generated position sequence is 7.
th
• To select the value for the u7, 7 column of the pheromone matrix is
th
th
used .(Note that 7 column belongs to 7 position of the order generated)
th
• 7 column of the pheromone matrix is rewritten below as Column7
vector arranged in row wise for better clarity.
Column7 = [0 1/C4 0 1/C1+1/C3 1/C2 0 1/C5 0]
th
• Normalized value of the 7 column of the pheromone matrix is given
below as Normalized vector7 arranged in row wise. This is also called as
the probability vector used for selecting the value for the u7 in the order.
S = [0 + 1/C4 + (1/C1+1/C3) + 1/C2 + 1/C5]
Normalized vector7 = (Column 7) / S = [p1 p2 p3 p4 p5 p6 p7 p8] (say)
Select the number corresponding to the position of the lowest value of the
normalized vector. Suppose if p5 is the lowest among the values in the
vector, the number 5 is assigned to the variable u7.
• The next value in the position sequence is 8.Hence the value for the
variable u8 is selected. But the value cannot be 5 as it was already
th
assigned to the variable u7. 8 column of the pheromone matrix except
th
the 5 row is used for selecting the value to be assigned to the variable u8
as described below.
th
• 8 column of the pheromone matrix is rewritten below as Column 8
th
th
vector with 5 row filled up X indicating 5 row is not consider for
selection. The vector is rearranged in row wise as displayed below
Column 8= [ (1/C2 +1/C5) 0 0 0 X 1/C4 0 (1/C1+1/C3) ]
th
• Normalized value of the 8 column of the pheromone matrix is
S= [(1/C2 +1/C5) + 0 + 0 + 0 + 1/C4 + 0 + (1/C1+1/C3)]
Normalized vector8 = (Column 8) / S = [q1 q2 q3 q4 q6 q7 q8]