7
$\begingroup$

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?

$\endgroup$
5
  • 1
    $\begingroup$ Did you read the discussion here ? $\endgroup$ – Robert Long Nov 14 '19 at 15:05
  • $\begingroup$ 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 $\endgroup$ – Tomasz Bartkowiak Nov 14 '19 at 16:41
  • 1
    $\begingroup$ 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. $\endgroup$ – Nuclear Hoagie Mar 27 '20 at 15:42
  • $\begingroup$ def simulated_annealing(...): scipy.optimize.dual_annealing(..., no_local_search=True,...) $\endgroup$ – James Bowery Sep 28 '20 at 16:40
  • $\begingroup$ @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 $\endgroup$ – Ernesto Iglesias Oct 31 '20 at 5:20
5
$\begingroup$

The reason for Simulated Annealing to be Deprecated is not because Basin-hopping outperform it theoretically. Is because the specific implementation done for Simulated Annealing in the library is a special case of the second.

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).

Observation: As @JamesBowery points out in his comment you should turn of the local optimizer.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.