完全图哈密尔顿圈的遗传模拟退火算法matlab通用源程序
给出了遗传模拟退火算法的matlab源程序的
% maxpop 给定群体规模
% pop 群体
% newpop 种群
%t0 初始温度
function [codmin,finmin]=fc0(cc,v0,t0) N=length(cc(1,:));
%定群体规模
if N>50
maxpop=2*N-20;
end
if N<=40
maxpop=2*N;
end
%产生初始群体
pop=zeros(maxpop,N);
pop(:,1)=v0;
finmin=inf;
codmin=0;
for i=1:maxpop
Ra=randperm(N);
Ra(find(Ra==v0))=Ra(1);
Ra(1)=v0;
pop(i,:)=Ra;
end
t=t0;
while t>0
%用模拟退火产生新的群体
pop=fc1(maxpop,pop,N,cc,v0,t);
%转轮赌选择种群
f=zeros(1,maxpop);
for i=1:maxpop
for j=1:N-1
x=pop(i,j);
y=pop(i,j+1);
fo1=cc(pop(i,j),pop(i,j+1));
f(i)=f(i)+fo1;
end
f(i)=f(i)+cc(pop(i,1),pop(i,N)); end
fmin=min(f);
for i=1:maxpop
if fmin==inf&f(i)==inf
dd=inf;
end
你可能喜欢
- 医学免疫学笔记
- matlab退火算法
- matlab遗传算法实例
- 遗传算法matlab代码
- 蚁群算法 matlab
- 遗传模拟退火算法
- 哈密尔顿圈 遗传模拟 退火算法matlab 源程序5页
- 模拟退火算法-matlab7页
- 模拟退火算法及禁忌搜索算法的matlab源程序6页
- 完全图哈密尔顿圈的遗传模拟退火算法matlab通用源程序4页
- 模拟退火算法matlab源程序3页
- 模拟退火算法及禁忌搜索算法的matlab源程序6页
- 三个遗传算法matlab程序实例19页
- matlab遗传算法工具箱函数及实例讲解3页
- matlab遗传算法实例10页
- matlab遗传算法工具箱函数及实例讲解3页
- matlab遗传算法工具箱函数及实例讲解10页
- matlab遗传算法工具箱函数及实例讲解2页
- 遗传算法程序源代码matlab7页
- 遗传算法matlab代码11页
- 遗传算法matlab代码3页
- 遗传算法matlab代码2页
- matlab、lingo程序代码3-背包问题(遗传算法)3页
- 遗传算法matlab程序代码7页


