|
Algorithm 3 Simulated Annealing Algorithm |
|
Let=. |
|
n = length() |
|
|
|
M = 100, % m is the iteration times at different temperatures
|
|
= 1e-3 |
|
Partition = [[];
|
|
While
>
|
|
Temp = zeros(m,n + 1);
|
|
for k = 1:m
|
|
If rand(1) > 0.6
|
|
RC_PNB search algorithm,←neighbor() |
|
else
|
|
PN_VC search algorithm,←neighbor() |
|
end
|
|
If F() < F() |
|
←
|
|
Elseif /(1+
) ≥ random(0, 1):
|
|
←
|
|
End
|
|
temp(k,:) = [, F()]; |
|
end
|
|
[,index] = min(temp(:,end)); %Find the optimal partition at current temperature. |
|
Partition = [partition; temp(index,end)];
|
|
=
; here
is cooling rate
|
|
End
|
|
[
,index1] = min(Partition (:,end));
|
|
= Partition (index1,1:end-1); %the final state is
, optimal value of objective function is
|