模拟退火 八皇后_模拟退火和八皇后问题

模拟退火 八皇后

The Simulated Annealing (SA) algorithm is one of many random optimization algorithms. Unlike algorithms like the Hill Climbing algorithm where the intent is to only improve the optimization, SA allows for more exploration. The idea is that with this exploration it’s more likely to reach a global optima rather than a local optima (for more on local optima, global optima and the Hill Climbing Optimization algorithm follow this link).

模拟退火(SA)算法是许多随机优化算法之一。 与Hill Climbing算法之类的算法仅旨在改善优化的算法不同,SA允许进行更多探索。 这个想法是,通过这种探索,它更有可能达到全局最优而非局部最优(有关局部最优,全局最优和爬山优化算法的更多信息,请点击此链接 )。

The term “annealing” is a term used in mettalurgy where the objective is to lower and increase the temperature of a metal. The process allows for the molecules to regroupe and get closer every time so that the metal becomes harder. The analogy is applied on the SA algorithm by getting closer to a solution, going farther from it by doing exploration and getting closer again to an even better solution.

术语“退火”是在冶金术中使用的术语,其中目的是降低和升高金属的温度。 该过程允许分子每次重新聚集并靠近,从而使金属变得更硬。 通过接近解决方案,通过探索进一步远离它,再次接近甚至更好的解决方案,将类比应用于SA算法。

模拟退火算法 (The Simulated Annealing Algorithm)

The algorithm can be decomposed in 4 simple steps:

该算法可以分解为4个简单的步骤:

  1. Start at a random point x.

    从一个随机点x开始。
  2. Choose a new point xⱼ on a neighborhood N(x).

    在邻域N(x)上选择一个新点xⱼ。
  3. Decide whether or not to move to the new point xⱼ. The decision will be made based on the probability function P(x,xⱼ,T) (explained ahead).

    决定是否移动到新点xⱼ。 该决策将基于概率函数P(x,xⱼ,T)(前面说明)。
  4. Reduce T

    降低T

Like we mentioned before P(x,xⱼ,T) is the function that will guide us on whether we move to the new point or not:

就像我们之前提到的P(x,xⱼ,T)是函数,它将指导我们是否移至新点:

Image for post

Let’s explore what the function is telling us. F(x) is the objective function (the function for which we want to find the optimal point x). If the new point xⱼ improves the result of the objective function, we will move to the new point with probability 1.

让我们探索一下函数告诉我们什么。 F(x)是目标函数(我们要为其找到最佳点x的函数)。 如果新点xⱼ改善了目标函数的结果,我们将以概率1移到新点。

When the new point doesn’t improve the objective function, we will move to the new point depending on the difference of F(xⱼ)-F(x) and the variable T.

当新点不能改善目标函数时,我们将根据F(xⱼ)-F(x)与变量T的差移至新点。

When T is high the possibility of moving to the new point will also be high and when T is low the possibility of moving to the new point is also low. That’s why initially we’ll start with a high T to do more

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值