Algorithm 1 Ant Colony Optimization algorithm (ACO). |
-
1:
-
2:
Random generation of L vectors from the domain of solving problem (the so-called pheromone spots): .
-
3:
Calculating the value of the objective function for each of the pheromone spot (for each solution vector).
-
4:
Sorting the set of solutions in descending order by the quality of solutions (the lower the value of the objective function, the better the solution). Each solution is assigned an index.
-
5:
-
6:
for iteration = 1, 2, …, I
do
-
7:
Each pheromone spot (solution vector) is assigned a probability according to the formula:
where are weights related to the solution index l and expressed by the formula:
-
8:
for k = 1, 2, …, M do
-
9:
Ant randomly chooses the l-th solution with a probability of .
-
10:
Then ant transforms each of the coordinates ( ) of the selected solution using Gauss function:
where .
-
11:
end for
-
12:
M new solutions are obtained. Divide set of new solutions into groups and calculate value of objective function J for each solution in each group in separate thread.
-
13:
From the two sets of solutions (new one and previous one) remove M worst solutions and rest sort according to the quality (value of objective function).
-
14:
end for
|