Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/algorithm/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Algorithm 模拟退火算法中的邻居选择_Algorithm_Artificial Intelligence_Simulated Annealing - Fatal编程技术网

Algorithm 模拟退火算法中的邻居选择

Algorithm 模拟退火算法中的邻居选择,algorithm,artificial-intelligence,simulated-annealing,Algorithm,Artificial Intelligence,Simulated Annealing,选择邻居时,应考虑算法的温度吗?所以,例如,如果温度很高,在挑选一个邻居时,应该进行排列吗?还是温度只影响接受概率?后者是正确的:只有接受概率受温度影响。温度越高,人们就越容易接受“坏”动作来逃避局部最优解。如果预先选择能量值较低的邻居,基本上会与模拟退火的思想相矛盾,并将其转化为贪婪搜索 伪代码来自: s← s0;E← E(s)//初始状态,能量。 斯贝斯特← s埃伯斯特← e//初始“最佳”解决方案 K← 0//能量评估计数。 当kemax//当时间还剩&不够好时: T← 温度(k/kmax

选择邻居时,应考虑算法的温度吗?所以,例如,如果温度很高,在挑选一个邻居时,应该进行排列吗?还是温度只影响接受概率?

后者是正确的:只有接受概率受温度影响。温度越高,人们就越容易接受“坏”动作来逃避局部最优解。如果预先选择能量值较低的邻居,基本上会与模拟退火的思想相矛盾,并将其转化为贪婪搜索

伪代码来自:

s← s0;E← E(s)//初始状态,能量。
斯贝斯特← s埃伯斯特← e//初始“最佳”解决方案
K← 0//能量评估计数。
当kemax//当时间还剩&不够好时:
T← 温度(k/kmax)//温度计算。
冷嘲热讽← 邻居///挑选一些邻居。
新能源← E(snew)//计算它的能量。
如果P(e,enew,T)>random(),那么//我们应该移动到它吗?
s← snew;E← enew//是,更改状态。
如果enew
我也有同样的问题,但我认为另一篇帖子的答案表明,T与选择邻居有关是相当合理的

选择邻居也取决于你的问题。限制邻里关系的主要原因是,一旦你找到了一个合适的解决方案,即使你后来选择了一个更糟糕的解决方案,你至少会留在邻里关系中。直觉是,大多数目标函数都是光滑的,所以好的解与其他好的解相近。所以,你需要一个足够小的社区,让你接近好的解决方案,但足够大,让你快速找到它们。您可以尝试的一件事是随着时间的推移减少邻域(例如,使其与温度成比例)。-匈牙利11月4日'13 20:58


以下是维基百科的描述,其中指出,对于某些问题,实际上应该计算温度

高效的候选生成

启发式的一个更精确的陈述是,我们应该尝试第一个候选状态s',其中p(E(s),E(s'),T)较大。对于上面的“标准”接受函数P,它意味着E(s')-E(s)的数量级为T或更小。因此,在上面的旅行推销员示例中,可以使用一个邻居()函数交换两个随机城市,其中选择城市对的概率随着距离增加超过T而消失。

这确实意味着,在确定邻居时,温度可能是相关因素


关于如何编写邻居函数的更有用的读物:

给定该伪代码,它没有定义如何计算邻居。因此,没有显示温度不是计算的一部分。
s ← s0; e ← E(s)                                  // Initial state, energy.
sbest ← s; ebest ← e                              // Initial "best" solution
k ← 0                                             // Energy evaluation count.
while k < kmax and e > emax                       // While time left & not good enough:
  T ← temperature(k/kmax)                         // Temperature calculation.
  snew ← neighbour(s)                             // Pick some neighbour.
  enew ← E(snew)                                  // Compute its energy.
  if P(e, enew, T) > random() then                // Should we move to it?
    s ← snew; e ← enew                            // Yes, change state.
  if enew < ebest then                            // Is this a new best?
    sbest ← snew; ebest ← enew                    // Save 'new neighbour' to 'best found'.
  k ← k + 1                                       // One more evaluation done
return sbest                                      // Return the best solution found.