A list,

Application background of simulated annealing algorithm

Simulated annealing algorithm was proposed in 1982. Kirkpatrick et al. were the first to recognize the similarities between solid annealing processes and optimization problems. They were also inspired by Metropolis et al. ‘s simulation of the process by which solids reach thermal equilibrium at constant temperature. By introducing Metropolis algorithm into the optimization process, we finally get an iterative optimization algorithm to Metropolis algorithm, which is similar to solid annealing process and is called “simulated annealing algorithm”.

Simulated annealing algorithm is a random search algorithm suitable for solving large-scale combinatorial optimization problems. At present, simulated annealing algorithm has achieved satisfactory results in solving TSP, VLSI circuit design and other combinatorial optimization problems. The combination of simulated annealing algorithm with other computational intelligence methods in modeling and optimization of various complex systems has been paid more and more attention, and has gradually become an important direction of development.

2 introduction to simulated annealing algorithm









3 parameters of simulated annealing algorithm

Simulated annealing is a kind of optimization algorithm, it can’t exist independently, needs to have a applications, of which temperature is simulated annealing to optimize the parameters, if it is applied to clustering analysis, so the clustering analysis has a certain or a few parameters are optimized, and the parameters, or parameter set is represented by the temperature. It could be some index, some correlation, some distance, etc.

Ii. Source code

%% genetic algorithm to solve VRP problem (after redesigning the program for selective operation) %D is the distance matrix, n is the number of population, %C is the stop algebra, and the program stops when the program is inherited to the C generation. The specific value of C depends on the scale of the problem and the time spent. %m is the acceleration index of elimination by adaptive value1.2.3.4% crossover probability Pc, mutation probability Pm %R is the shortest path,Rlength is the path length function VRP t0= cpuTime; % Time starts % initialize myTimeWindows; coor; mydemand; % demand=[0 1 2 - 1 2 - 1 4 2 - 2];
distance;
% D=[ 0 4 6 7.5 9 20 10 16 8;
%     4 0 6.5 4 10 5 7.5 11 10;
%     6 6.5 0 7.5 10 10 7.5 7.5 7.5;
%     7.5 4 7.5 0 10 5 9 9 15;
%     9 10 10 10 0 10 7.5 7.5 10;
%     20 5 10 5 10 0 7 7 7.5;
%     10 7.5 7.5 9 7.5 7 0 0 10;
%     16 11 7.5 9 7.5 9 7 10 10;
%     8 10 7.5 15 10 7.5 10 10 0];

popsize=70;
capacity = 25; % empirical formula m=[σ gi /aq]+1, calculate the number of vehicles a =0.8; % [3】 k1 = round (the sum (abs(demand))./(a*capacity))+1)- 1; % number of vehicles k2 = round((sum(abs(demand))./(a*capacity))+1) +1; % Maximum number of vehicles Original =15;
C=200;
Pc=0.9;
Pm=0.2;

[n,nn] = size(D);
minvalue = 100000;
forK = k1:k2 % One search for each vehicle tempR = zeros(1,n+k);
    R = zeros(1,n+k); [tempR,tempvalue] = Run_VRP(D,demand,popsize,timewindows,k,capacity,original,C,Pc,Pm); % returns the optimal path R and its total distance Rlengthif tempvalue*k < minvalue
        minvalue = tempvalue;
        R = tempR;
        minvehicle = k;
    end
    function [R,minvalue]=Run_VRP(D,demand,popsize,timewindows,k,capacity,original,C,Pc,Pm)
%RUN_VRP Summary of thisfunction goes here % Detailed explanation goes here [N,NN]=size(D); % (31*31) %N is the number of nodes N = N -1;
farm = zeros(popsize,N+k+1);
farm=inatialize(popsize,N,k);
R=farm(1, :); % a random solution (individual)-> store the best solution (shortest path) evalue=zeros(popsize,1); % Storage path length alph =0.9; Anneal decay coefficient counter=0;

while counter < C
    for i = 1:popsize
        evalue(i,1) = myEvalue(D,farm(i,:),k,capacity,original,timewindows,demand); End minValue =min(evalue); Coor =find(evalue==minvalue); % returns the coordinates of the shortest path in len (I,1)
    R=farm(coor(1.1), :); % Update the optimal solutionif counter == 0% Initial annealing temperature t = temp_inatial(evalue, POPsize); end farm = select(farm,evalue,popsize,k,D,capacity,original,timewindows,demand,t); Select crossover(farm,N,k, POPsize,Pc); farm = variation(farm,N,k,popsize,Pm);for i = 1:popsize
        evalue(i,1) = myEvalue(D,farm(i,:),k,capacity,original,timewindows,demand); % computes the target function endCopy the code

3. Operation results

Fourth, note

Version: 2014 a