模拟退火和路径发现

时间:2014-06-05 21:43:11

标签: algorithm optimization artificial-intelligence heuristics simulated-annealing

我一直在阅读大量关于模拟退火(SA)的文献及其在解决TSP方面的有效性。这使我想到是否可以使用SA来优化sourcedestination路径查找。

基本SA伪代码(来自wiki)

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.

这里s0代表一个解决方案(所以在我的情况下它已经意味着一个源 - 目标路径),我的问题是如何生成这些“解决方案”,而不是使用最大流算法或dijikstra。

0 个答案:

没有答案