高级算法课程(一):模拟退火算法SA()及其C++代码

模拟退火算法SA()

1  choose an initial solution X0  randomly                      //随机的选择一个初始解X0
2  give an initial temperature T0 , X ← X0, T ← T0       //初始化温度T0
3  while the stop criterion is not yet satisfied do            //停止准则不满足则
4   {   for i ← 1 to  L do                                                  //Markov 链的长度 L
5        {  pick a solution  X'∈N(X) randomly                  //随机选择临域内一个解X'
6           Δf ← f(X')-f(X)                                                   
7           if Δf<0  then  X ← X'
8           else  X ← X' with  probability exp(- Δf/T)  }        //  以exp(- Δf/T)的接受概率接受X'
9   T← g(T)    //generally, T ← aT    }                             //温度下降

10  return X


Generic choices for annealing schedule

*initial temperature T 0
   (example: based on statistics of evaluation function)
*Cooling schedule-how to change temperature over time
   (example: geometric cooling, T aT)
*L : number of iterations at each temperature
    (example :multiple of the neighborhood size
*Stopping criterion
    (example: no improved solution found for a number of temperature values)

代码C++实现 ,解决旅行商问题:

http://download.csdn.net/detail/zhoubin1992/6982573


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值