模拟退火遗传算法的介绍

作者&投稿:漫戴 (若有异议请与网页底部的电邮联系)
请问哪位有模拟退火遗传算法的源程序?~

遗传算法求解f(x)=xcosx+2的最大值

其中在尺度变换部分应用到了类似模拟退火算法部分,所有变量均使用汉语拼音很好懂


//中国电子科技集团公司

//第一研究室

//呼文韬

//hu_hu605@163.com

//随机初始种群
//编码方式为格雷码
//选择方法为随机遍历
//采用了精英保存策略
//采用了自适应的交叉率和变异率
//采用了与模拟退火算法相结合的尺度变换
//采用了均匀交叉法

#include
#include
#include
#include
#include
#include
#include
#define IM1 2147483563
#define IM2 2147483399
#define AM (1.0/IM1)
#define IMM1 (IM1-1)
#define IA1 40014
#define IA2 40692
#define IQ1 53668
#define IQ2 52774
#define IR1 12211
#define IR2 3791
#define NTAB 32
#define NDIV (1+IMM1/NTAB)
#define EPS 1.2e-7
#define RNMX (1.0-EPS)
#define zhizhenjuli 0.005
#define PI 3.14159265358
#define T0 100000//温度要取得很高才行。
#define zhongqunshu1 200
#define zuobianjie -2000
#define youbianjie 2000
unsigned int seed=0; //seed 为种子,要设为全局变量
void mysrand(long int i) //初始化种子
{
seed = -i;
}
long a[1];
//double hundun;
//double c=4;
//设置全局变量
struct individual
{
unsigned *chrom; //染色体;
double geti;//变量值
double shiyingdu; //目标函数的值;
double fitness; //变换后的适应度值;
};
individual *zuiyougeti;//精英保存策略
int zhongqunshu; //种群大小
individual *nowpop;//当前代
individual *newpop;//新一代
double sumfitness;//当代的总适应度fitness
double sumshiyingdu;//当代的总适应度shiyingdu
double maxfitness;//最大适应度
double avefitness;//平均适应度
double maxshiyingdu;//最大适应度
double avgshiyingdu;//平均适应度
float pc;//交叉概率
float pm;//变异概率
int lchrom;//染色体长度
int maxgen;//最大遗传代数
int gen;//遗传代数
//函数
int flipc(double ,double );//判断是否交叉
int flipm(double );//判断是否变异
int rnd(int low,int high);//产生low与high之间的任意数
void initialize();//遗传算法初始化
void preselectfitness(); //计算sumfiness,avefitness,maxfitness
void generation();
double suijibianli();//产生随机遍历指针
int fuzhi(float );//选择要复制的个体
void crossover(individual ,individual ,individual &,individual &);//交叉
void bianyi(individual &);//变异
void mubiaohanshu(individual &);//计算适应度
void chidubianhuan(individual &);//对shiyingdu进行尺度变换赋给fitness
double ran1(long *);//随机数初始
void bianma(double bianliang,unsigned *p);//编码
double yima(unsigned *p);
void guanjiancanshujisuan();//计算shiyingdu,根据shiyingdu计算sumshiyingdu,对shiyingdu进行尺度变换变成fitness,根据fitness计算sumfitness,avefitness,maxfitness
void jingyingbaoliu();
void glp(int n,int s,int *,int (*)[1],float (*)[1]);//glp生成函数
BOOL Exist(int Val, int Num, int *Array);//判断一个数在前面是否出现过
int cmpfitness(const void *p1,const void *p2)
{
float i=((individual *)p1)->shiyingdu;//现在是按照"适应度"排序,改成"个体"的话就是按照"个体"排序
float j=((individual *)p2)->shiyingdu;
return i<j ? -1:(i==j ? 0:1);//现在是按升序牌排列,将1和-1互换后就是按降序排列
}
void main()
{
initialize();
coutgetishiyingdu<<endl;/////////////
for(gen=1;gen<maxgen;gen++)
{ generation();
}
jingyingbaoliu();
coutgetishiyingdu)<<endl;////////////////
delete [] newpop;
delete [] nowpop;
delete [] zuiyougeti;
system("pause");
}
void initialize()
{
int q[zhongqunshu1][1],s=1;
float xx[zhongqunshu1][1];//生成的glp用x储存
int h[1]={1};//生成向量
zuiyougeti=new individual;//最优个体的生成
zhongqunshu=200;//种群数量
nowpop=new individual[zhongqunshu1];//当代
newpop=new individual[zhongqunshu1];//新一代
maxgen=150;//最大代数
gen=0;//起始代
lchrom=22;//基因数量的初始化
mysrand(time(0));//随机数种子
a[0]=seed;//随机数种子
//对最优个体的初始化
zuiyougeti->geti=0;
zuiyougeti->fitness=0;
zuiyougeti->shiyingdu=0;
//
glp(zhongqunshu,s,h,q,xx);
//for(int i=0;i<zhongqunshu1;i++)//产生初始种群
//{
// for(int j=0;j<s;j++)
// {
// nowpop[i].geti=zuobianjie+(youbianjie-zuobianjie)*xx[i][j];
// }
//}
for(int i=0;i<zhongqunshu1;i++)//产生初始种群
{
nowpop[i].geti=zuobianjie+(youbianjie-(zuobianjie))*ran1(a);
}
//nowpop[0].geti=999;//////////////////////////
guanjiancanshujisuan();
jingyingbaoliu(); //精英保留的实现
guanjiancanshujisuan();//计算shiyingdu,根据shiyingdu计算sumshiyingdu,对shiyingdu进行尺度变换变成fitness,根据fitness计算sumfitness,avefitness,maxfitness
}
void jingyingbaoliu() //精英保留的实现
{
individual *zuiyougetiguodu;
zuiyougetiguodu=new individual[zhongqunshu1];//建立一个过渡数组
for(int i=0;i<zhongqunshu;i++)//将当代个体复制到过渡数组中
zuiyougetiguodu[i]=nowpop[i];
qsort(zuiyougetiguodu,zhongqunshu1,sizeof(individual),&cmpfitness);//按fitness升序排序
// cout<<"zuiyougetiguodu适应度:"<<zuiyougetiguodu[zhongqunshu1-1].shiyingdu<<endl;///////////
// coutshiyingdu<<endl;///////////////////
//system("pause");
if(zuiyougetiguodu[zhongqunshu-1].shiyingdu>zuiyougeti->shiyingdu)
{
*zuiyougeti=zuiyougetiguodu[zhongqunshu1-1];//如果最优个体的fitness比当代最大的fitness小则用当代的代替之
//cout<<"zuiyougetiguodu个体:"<<zuiyougetiguodu[zhongqunshu1-1].geti<<endl;/////////////
//coutgeti<<endl;/////////////
}
else
nowpop[rnd(0,(zhongqunshu1-1))]=*zuiyougeti;//否则的话从当代中随机挑选一个用最优个体代替之
delete [] zuiyougetiguodu;//释放过渡数组
}
void guanjiancanshujisuan()//计算shiyingdu,根据shiyingdu计算sumshiyingdu,对shiyingdu进行尺度变换变成fitness,根据fitness计算sumfitness,avefitness,maxfitness
{
for(int i=0;i<zhongqunshu;i++)//计算shiyingdu
mubiaohanshu(nowpop[i]);
for(i=0;i<zhongqunshu;i++)//对shiyingdu进行尺度变换变成fitness
chidubianhuan(nowpop[i]);
preselectfitness();//根据fitness计算sumfitness,avefitness,maxfitness
}
void mubiaohanshu(individual &bianliang)//计算shiyingdu
{
bianliang.shiyingdu=(bianliang.geti*cos(bianliang.geti)+2.0);//目标函数
}
void chidubianhuan(individual &bianliang)//对shiyingdu进行尺度变换变成fitness
{
double T;//退火温度
T=T0*(pow(0.99,(gen+1-1)));
double sum=0;
for(int j=0;j<zhongqunshu;j++)
sum+=exp(nowpop[j].shiyingdu/T);
bianliang.fitness=exp(bianliang.shiyingdu/T)/sum;//算出fitness
}
void preselectfitness()//根据fitness计算sumfitness,avefitness,maxfitness
{
int j;
sumfitness=0;
for(j=0;j<zhongqunshu;j++)
sumfitness+=nowpop[j].fitness;
individual *guodu;
guodu=new individual[zhongqunshu1];
for(j=0;j<zhongqunshu;j++)
guodu[j]=nowpop[j];
qsort(guodu,zhongqunshu1,sizeof(individual),&cmpfitness);
maxfitness=guodu[zhongqunshu1-1].fitness;
avefitness=sumfitness/zhongqunshu1;
delete [] guodu;
}
void generation()
{
individual fuqin1,fuqin2,*pipeiguodu,*pipeichi;
int *peiduishuzu;//用来存放产生的随机配对
pipeiguodu=new individual[zhongqunshu1];
pipeichi=new individual[zhongqunshu1];
peiduishuzu=new int[zhongqunshu1];
int member1,member2,j=0,fuzhijishu=0,i=0,temp=0,tt=0;
float zhizhen;
//随机遍历的实现
for(zhizhen=suijibianli();zhizhen<1;(zhizhen=zhizhen+zhizhenjuli))//设定指针1/66
{
pipeichi[fuzhijishu]=nowpop[fuzhi(zhizhen)];
fuzhijishu++;
}

//交叉与变异的实现
//交叉
for(i=0;i<zhongqunshu1;i++)
{
peiduishuzu[i]=-1;
}
for (i=0; i<zhongqunshu1; i++)
{
temp =rnd(0,zhongqunshu1-1); //产生值在0-zhongqunshu1-1的随机数
while(Exist(temp, i, peiduishuzu))//判断产生的随机数是否已经产生过,如果是,则再产生一个随机数
{
temp =rnd(0,zhongqunshu1-1);
}
//如果没有的话,则把产生的随机数放在peiduishuzu中
*(peiduishuzu+i) = temp;
}
for(i=0;i<zhongqunshu1-1;i=i+2)
{
fuqin1=pipeichi[peiduishuzu[i]];
fuqin2=pipeichi[peiduishuzu[i+1]];
crossover(fuqin1,fuqin2,newpop[i],newpop[i+1]);
}
for(j=0;j<zhongqunshu1;j++)
{
//if(newpop[j].geti<-1000)
//cout<<"个体数值小于下界了";
nowpop[j].geti=newpop[j].geti;
}
//
guanjiancanshujisuan();
//变异的实现
for(j=0;j<zhongqunshu;j++)
{
bianyi(nowpop[j]);
}
//
guanjiancanshujisuan();
//精英保留的实现
jingyingbaoliu();
//
guanjiancanshujisuan();
delete [] peiduishuzu;
delete [] pipeichi;
delete [] pipeiguodu;
}
void crossover(individual parent1,individual parent2,individual &child1,individual &child2)//交叉
{
int j;
unsigned *panduan;
panduan=new unsigned[lchrom];
parent1.chrom=new unsigned[lchrom];
parent2.chrom=new unsigned[lchrom];
child1.chrom=new unsigned[lchrom];
child2.chrom=new unsigned[lchrom];
//cout<<"jiaocha"<<endl;///////////////////////
bianma(parent1.geti,parent1.chrom);
bianma(parent2.geti,parent2.chrom);
if(flipc(parent1.fitness,parent2.fitness))
{
for(j=0;j<lchrom;j++)
panduan[j]=rnd(0,1);
//for(j=0;j<lchrom;j++)////////////////
// {
// cout<<panduan[j];/////////////
// }
// cout<<endl;////////////////
// system("pause");////////////////
for(j=0;j<lchrom;j++)
{
if(panduan[j]==1)
child1.chrom[j]=parent1.chrom[j];
else
child1.chrom[j]=parent2.chrom[j];
}
for(j=0;j<lchrom;j++)
{
if(panduan[j]==0)
child2.chrom[j]=parent1.chrom[j];
else
child2.chrom[j]=parent2.chrom[j];
}
//for(j=0;j<lchrom;j++)////////////////
//{
// cout<<child1.chrom[j];/////////////
// }
//cout<<endl;////////////////
// system("pause");////////////////
child1.geti=yima(child1.chrom);
child2.geti=yima(child2.chrom);
delete [] child2.chrom;
delete [] child1.chrom;
delete [] parent2.chrom;
delete [] parent1.chrom;
delete [] panduan;
}
else
{
for(j=0;j<lchrom;j++)
{
child1.chrom[j]=parent1.chrom[j];
child2.chrom[j]=parent2.chrom[j];
}
child1.geti=yima(child1.chrom);
child2.geti=yima(child2.chrom);
delete [] child2.chrom;
delete [] child1.chrom;
delete [] parent2.chrom;
delete [] parent1.chrom;
delete [] panduan;
}
}
void bianyi(individual &child)//变异
{
child.chrom=new unsigned[lchrom];
//cout<<"变异"<<endl;
bianma(child.geti,child.chrom);
for(int i=0;i<lchrom;i++)
if(flipm(child.fitness))
{
if(child.chrom[i]=0)
child.chrom[i]=1;
else
child.chrom[i]=0;
}
child.geti=yima(child.chrom);
delete [] child.chrom;
}
void bianma(double bianliang,unsigned *p)//编码
{
unsigned *q;
unsigned *gray;
q=new unsigned[lchrom];
gray=new unsigned[lchrom];
int x=0;
int i=0,j=0;
if(bianliang<zuobianjie)///////////////////
{
cout<<"bianliang:"<<bianliang<<endl;/////////
system("pause");
}
//cout<<youbianjie-(zuobianjie)<<endl;
//system("pause");
x=(bianliang-(zuobianjie))*((pow(2,lchrom)-1)/(youbianjie-(zuobianjie)));
//cout<<x<<endl;///////////
if(x<0)
system("pause");///////////
for(i=0;i<lchrom;i++)
{
q[i]=0;
p[i]=0;
}
i=0;
while (x!=0&&(i!=lchrom))
{
q[i]=(unsigned)(x%2);
x=x/2;
i++;
}
// for(i=0;i<lchrom;i++)//////////////////
// cout<<q[i];///////////////
// cout<<endl;///////////
int w=lchrom-1;
if(q[w]!=0&&q[w]!=1)
system("pause");
for(j=0;j0;j++)
{
p[j]=q[w];
w--;
}
//cout<<"yuanma"<<endl;
//for(j=0;j<lchrom;j++)///////////
// cout<<p[j];////////
//cout<<endl;////////////////////
gray[0]=p[0];
for(j=1;j<lchrom;j++)
{
if(p[j-1]==p[j])
gray[j]=0;
else if(p[j-1]!=p[j])
gray[j]=1;
}
for(j=0;j<lchrom;j++)
p[j]=gray[j];
//cout<<"geleima"<<endl;
//for(j=0;j<lchrom;j++)///////////
// cout<<p[j];////////
//cout<<endl;////////////////////
//system("pause");///////////

delete [] gray;
delete [] q;
}
double yima(unsigned *p) //译码
{

int i=0;
// for(i=0;i<lchrom;i++)/////////
// {
// cout<<p[i];//////
// }
// cout<<endl;/////////
// system("pause");//////////
int x=0;
unsigned *q;
q=new unsigned[lchrom];
q[0]=p[0];
// cout<<q[0]<<endl;//////////////////
// system("pause");//////////

for(int j=1;j<lchrom;j++)
{
if(q[j-1]==p[j])
q[j]=0;
else if(q[j-1]!=p[j])
q[j]=1;
}
// for(i=0;i<lchrom;i++)//////
// {
// cout<<q[i];//////////
// if(q[i]!=0&&q[i]!=1)
// {
// cout<<q[i];
// system("pause");
// }
// }
// cout<<endl;////////
// system("pause");///////////////////
for(i=0;i<lchrom;i++)
x=x+q[i]*pow(2,(lchrom-i-1));
if(x<0)
{
cout<<"译码出错1"<<endl;
system("pause");
}
//cout<<"x:"<<x<<endl;
double bianliang;
//cout<<pow(2,22)<<endl;
//cout<<2000*x<<endl;
//cout<<(x*(2000/(pow(2,22)-1)))<<endl;
bianliang=(x*((youbianjie-(zuobianjie))/(pow(2,lchrom)-1)))+zuobianjie;
if(bianliang<zuobianjie)
{
cout<<"译码出错2"<<endl;
system("pause");
}
delete [] q;
return bianliang;
}
double ran1(long *idum)
{
int j;
long k;
static long idum2=123456789;
static long iy=0;
static long iv[NTAB];
float temp;
if (*idum <= 0)
{
if (-(*idum) < 1) *idum=1;
else *idum = -(*idum);
idum2=(*idum);
for (j=NTAB+7;j>=0;j--)
{
k=(*idum)/IQ1;
*idum=IA1*(*idum-k*IQ1)-k*IR1;
if (*idum < 0) *idum += IM1;
if (j < NTAB) iv[j] = *idum;
}
iy=iv[0];
}
k=(*idum)/IQ1;
*idum=IA1*(*idum-k*IQ1)-k*IR1;
if (*idum < 0) *idum += IM1;
k=idum2/IQ2;
idum2=IA2*(idum2-k*IQ2)-k*IR2;
if (idum2 < 0) idum2 += IM2;
j=iy/NDIV;
iy=iv[j]-idum2;
iv[j] = *idum;
if (iy < 1) iy += IMM1;
if ((temp=AM*iy) > RNMX) return RNMX;
else return temp;
}
double suijibianli()//随机遍历
{
double i=ran1(a);
while(i>zhizhenjuli)
{
i=ran1(a);
}
//cout<<i<<endl;//////////////
return i;
}
int fuzhi(float p)//复制
{
int i;
double sum=0;
if(sumfitness!=0)
{
for(i=0;(sum<p)&&(i<zhongqunshu);i++)
sum+=nowpop[i].fitness/sumfitness;
}
else
i=rnd(1,zhongqunshu1);
return(i-1);
}

int rnd(int low, int high) /*在整数low和high之间产生一个随机整数*/
{
int i;
if(low >= high)
i = low;
else
{
i =(int)((ran1(a) * (high - low + 1)) + low);
if(i > high) i = high;
}
return(i);
}
int flipc(double p,double q)//判断是否交叉
{
double pc1=0.9,pc2=0.6;
if((p-q)>0)
{
if(p>=avefitness)
{
pc=pc1-(pc1-pc2)*(p-avefitness)/(maxfitness-avefitness);
}
else
pc=pc1;
}
else
{
if(q>=avefitness)
{
pc=pc1-(pc1-pc2)*(q-avefitness)/(maxfitness-avefitness);
}
else
pc=pc1;
}
if(ran1(a)<=pc)
return(1);
else
return(0);
}
int flipm(double p)//判断是否变异
{
double pm1=0.001,pm2=0.0001;
if(p>=avefitness)
{
pm=(pm1-(pm1-pm2)*(maxfitness-p)/(maxfitness-avefitness));
}
else
pm=pm1;
if(ran1(a)<=pm)
return(1);
else
return(0);
}
void glp(int n,int s,int *h,int (*q)[1],float (*xx)[1])//glp
{
int i=0,j=0;
//求解q
for(i=0;i<n;i++)
{
for(j=0;j<s;j++)
{
*(*(q+i)+j)=((i+1)*(*(h+j)))%n;
}
}
i=n-1;
for(j=0;j<s;j++)
{
*(*(q+i)+j)=n;
}
//求解x
for(i=0;i<n;i++)
{
for(j=0;j<s;j++)
{
*(*(xx+i)+j)=(float)(2*(*(*(q+i)+j))-1)/(2*n);
}
}
}
BOOL Exist(int Val, int Num, int *Array)//判断一个数是否在一个数组的前Num个数中
{
BOOL FLAG = FALSE;
int i;
for (i=0; i<Num; i++)
if (Val == *(Array + i))
{
FLAG = TRUE;
break;
}
return FLAG;
}

这些算法的本质都是随机搜索,带有随机性,对参数依赖程度还是比较强的,所以出现结果时好时坏也是正常的。
至于这些算法的比较,你可以查查相关的论文。特别是首先提出该改进算法的论文,不过要注意,国内的论文的实验结果可信程度还是值得怀疑的。作者往往为了“证明”其算法的优势,只列举那些对算法效果有利的实验结果,不好的结果经常不列出来。所以你看到别人说什么算法好,但你自己用的时候却没发现该算法的优势也是正常的。

模拟退火算法是基于Monte Carlo迭代求解法后种启发式随机搜索算法,它模拟固体物质退火过程的热平衡问题与随机搜索寻优问题的相似性来达到寻找全局最优或近似全局最优的目的。




粒子群算法遗传算法蚁群算法模拟退火算法和贝叶斯是一类算法吗
粒子群算法、遗传算法、蚁群算法、模拟退火算法,这些是一类算法,是一种基于迭代的优化算法,用于求最优解。贝叶斯分类算法另一类,它是统计学的一种分类方法,利用概率统计知识进行分类的算法。

用遗传算法求解配送路线优化问题时,交叉率和变异率怎么设定?
传算法可以很好的解决物流配送路径优化问题。但是由于遗传算法交配算子操作可能会使最好解遗失,所以将遗传算法和模拟退火算法结合来解决这一问题。实验结果表明:用这种有记忆功能的遗传模拟退火算法求解物流配送路径优化问题,可以在一定程度上解决上述问题,从而得到较高质量的解。一 物流系统简介 物流系统是以客户满意为目...

组合优化问题的解法有哪些常见的方法?
2.1 遗传算法(Genetic Algorithm):遗传算法是一种模拟自然界生物进化过程的全局搜索方法。通过编码、选择、交叉和变异等操作,不断产生新的解,从而逼近最优解。遗传算法适用于求解各种组合优化问题,如TSP、调度问题等。2.2 模拟退火算法(Simulated Annealing):模拟退火算法是一种基于热力学原理的随...

C语言中退火模拟
用固体退火模拟组合优化问题,将内能E模拟为目标函数值f,温度T演化成控制参数t,即得到解组合优化问题的模拟退火算法:由初始解i和控制参数初值t开始,对当前解重复“产生新解→计算目标函数差→ 接受或舍弃”的迭代,并逐步衰减t值,算法终止时的当前解即为所得近似最优解,这是基于蒙特卡罗迭代求解法的一种启发式随机...

对于解决多目标优化问题,遗传算法、粒子群、模拟退火哪个比较好啊?哪位...
个人感觉是遗传算法吧,当然可以和模拟退火算法结合来使用。多目标遗传算法可解决多目标优化问题,和模拟退火算法相结合时还能强化局部搜索能力。

如何通俗易懂地解释遗传算法?
遗传算法,核心是达尔文优胜劣汰适者生存的进化理论的思想。我们都知道一个种群,通过长时间的繁衍,种群的基因会向着更适应环境的趋势进化,牛B个体的基因被保留,后代越来越多,适应能力低个体的基因被淘汰,后代越来越少。经过几代的繁衍进化,留下来的少数个体,就是相对能力最强的个体了。那么在解决一些...

求助:人工智能“遗传算法求解f(x)=xcosx+2的最大值”
求助:人工智能“遗传算法求解f(x)=xcosx+2的最大值” 请大家帮忙!!!用遗传算法求f(x)=xcosx+2的最大值不胜感激!!!大家帮忙想办法呀!!... 请大家帮忙!!!用遗传算法求 f(x)=xcosx+2 的最大值不胜感激!!!大家帮忙想办法呀!! 展开  我来答 1个回答 #热议# 作为女性,你生活中有感受到...

生物信息学:智能化算法及其应用目录
第一章介绍了生物信息学的基本概念,包括其内容、方法和意义,以及生物学基础知识,如细胞、基因和蛋白质的概述。第二章深入探讨了智能化算法,包括蒙特卡罗方法、模拟退火算法、遗传算法等,以及评价算法的理论框架。第三章详细讲解了序列联配和隐马尔可夫模型,包括双序列和多序列的配对技术,以及隐马尔可夫...

非线性解析反演与遗传算法的结合反演方法
非线性反演方法可以分为两大类:随机搜索方法,如Monte Carlo法、模拟退火和遗传算法及基于非线性最小平方理论的非线性解析反演方法。遗传算法能寻找到全局最优解,但它为一种较费时的方法。非线性解析反演方法能给出一个与初始模型有关的局部最优解。然而,这种方法具有较快的收敛速度。遗传算法与非线性解析反演方法...

用遗传算法所得的结果会不会不相同,还是说要求每次所得的都是最优解啊...
遗传算法跟什么最速下降法、牛顿法、共轭梯度法之类的优化算法相比,是不一样的。它和粒子群算法、禁忌表法、模拟退火算法等同属于智能搜索算法,面对的问题一般都很复杂,本身就有较多的随机计算过程,所以得到的结果不同是非常正常的。至于得不到最优解也是正常的,因为智能搜索算法面对的问题一般都是...

建华区15991387311: 模拟退火遗传算法 - 搜狗百科
慕韩美可: 模拟退火算法(Simulated Annealing,SA)最早的思想是由N. Metropolis 等人于1953年提出.1983 年,S. Kirkpatrick 等成功地将退火思想引入到组合优化领域.它是基于Monte-Carlo迭代求解策略的一种随机寻优算法,其出发点是基于物理中固...

建华区15991387311: 模拟退火法(SA)和遗传算法(GA)的专业解释? -
慕韩美可: n局部搜索,模拟退火,遗传算法,禁忌搜索的形象比喻:为了找出地球上最高的山,一群有志气的兔子们开始想办法.1.兔子朝着比现在高的地方跳去.他们找到了不远处的最高山峰.但是这座山不一定是珠穆朗玛峰.这就是局部搜索,它不...

建华区15991387311: 模拟退火算法是什么 -
慕韩美可: 其实你别想象的太复杂,它的思想搞清楚就好了,他首先是个算法,这个算法的目的是求解,精髓是求最优解,它能使解在迭代过程中跳出局部最优的陷阱,怎么跳出的,是通过接受不好的解,继续迭代,这样就可以从整体上考虑,求出最优解.这是它的精髓,知道这个思想之后,看看程序代码,就可以理解了.希望能帮你.

建华区15991387311: 比较模拟退火算法和遗传算法相同点和不同点
慕韩美可: 模拟退火的话进化是由参数问题t控制的,然后通过一定的操作产生新的解,根据当前解的优劣和温度参数t确定是否接受当前的新解. 遗传算法主要由选择,交叉,变异等操作组成,通过种群进行进化. 主要不同点是模拟退火是采用单个个体进行进化,遗传算法是采用种群进行进化.模拟退火一般新解优于当前解才接受新解,并且还需要通过温度参数t进行选择,并通过变异操作产生新个体.而遗传算法新解是通过选择操作进行选择个体,并通过交叉和变异产生新个体. 相同点是都采用进化控制优化的过程.

建华区15991387311: 遗传算法及模拟退火用于什么方面 -
慕韩美可: 模拟退火算法和遗传算法,包括禁忌搜索算法,蚁群算法等都可以用来求解优化问题.

建华区15991387311: 什么是退火算法? -
慕韩美可: 退火算法 Simulate Anneal Arithmetic (SAA,模拟退火算法) 模拟退火算法 模拟退火算法来源于固体退火原理,将固体加温至充分高,再让其徐徐冷却,加温时,固体内部粒子随温升变为无序状,内能增大,而徐徐冷却时粒子渐趋有序,在...

建华区15991387311: 遗传算法、数值算法、爬山算法、模拟退火 各自的优缺点 -
慕韩美可: 遗传算法:优点是能很好的处理约束,能很好的跳出局部最优,最终得到全局最优解,全局搜索能力强;缺点是收敛较慢,局部搜索能力较弱,运行时间长,且容易受参数的影响. 模拟退火:优点是局部搜索能力强,运行时间较短;缺点是全局搜索能力差,容易受参数的影响. 爬山算法:显然爬山算法较简单,效率高,但是处理多约束大规模问题时力不从心,往往不能得到较好的解. 数值算法:这个数值算法的含义太广,你说的是哪一种数值算法?多数数组算法与爬山算法的有优缺点类似. PS:望采纳!

建华区15991387311: 英语翻译摘要:模拟退火算法(simulated annealing,简称SA)是基于Mente Carlo的迭代求解策略的一种随机寻优算法,其来源于固体退火原理.将固体加... -
慕韩美可:[答案] 楼上的筒子,google翻的?很不通顺啊,楼主你这篇论文太专业,翻得很费劲,要加分哦Abstract:A simulated annealing(SA for short) is based on the Mente Carlo iterative strategy which is a stochastic optimization ...

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 星空见康网