# Simulated Annealing vs. Basin-hopping algorithm

I was planning to use Simulated Annealing algorithm (scipy.optimize implementation) to optimise my black-box objective function, but the documentation mentions that the method is

Deprecated in scipy 0.14.0, use basinhopping instead

and proposes to use Basin-hopping algorithm instead. Does it mean that this algorithm outperforms Simulated Annealing in all cases? Why is it claimed to be more performant than SA?

• Did you read the discussion here ? Nov 14, 2019 at 15:05
• Thanks @RobertLong. I did not read it but it does not seem to answer the question why the latter algorithm has better performance. Interestingly, as menionted in the discussion, there exists another, more performant version of SA: Dual Annealing Nov 14, 2019 at 16:41
• According to the No Free Lunch theorem, there is no such thing as an algorithm that outperforms any other algorithm "in all cases". It might be better for a a very practical subset of problems, but over the entire universe of problems, Simulated Annealing, Basin Hopping, and even random selection perform equally well. Mar 27, 2020 at 15:42
• def simulated_annealing(...): scipy.optimize.dual_annealing(..., no_local_search=True,...) Sep 28, 2020 at 16:40
• @JamesBowery You should do more than just turn off the local search, at least if you want to recover the Boltzman visiting distribution. That's the point of my answer Oct 31, 2020 at 5:20

If you want to use a Simulated Annealing algorithm I recomend you to use scipy.optimize.dual_annealing instead, but with $$'visit'=q_v=1, \, 'acept'=q_a=1$$ (this recover Classical Simulated Annealing, i.e. the temperature decreases logarithmically). Other parameter election leads to more sophisticated Annealing processes, like $$'visit'=q_v=2, \, 'acept'=q_a=1$$ (which recover the Fast Simulated Annealing, i.e. the temperature decrease up to inverse).