Answers.Body: <blockquote>
    <p>Simulated Annealing vs genetic algorithm?</p>
  </blockquote>
  
  <p>Simulated annealing is a materials science analogy and involves the introduction of noise to avoid search failure due to local minima. See images below. To improve the odds of finding the global minimum rather than a sub-optimal local one, a stochastic element is introduced by simulating Brownian (thermal) motion. Variants of simulated annealing include injection of random numbers with various distributions and the averaging effect of mini-batching (dividing a batch into segments and performing network parameter adjustment after each).</p>
  
  <p>Genetic algorithms are search methods based on principles of mutation, meiosis, symbiosis, test, elimination of inadequacy, and recursion. The advantages of such approaches is the simulation of sexual reproduction, where the possibility of dominant genetic features from two individuals producing a child individual containing the best of both exists. In a population of children, the probability of such a hybrid emerging is higher. Over several generations, even higher than that.</p>
  
  <blockquote>
    <p>What kind of problems does simulated annealing perform better than genetic algorithms if any?</p>
  </blockquote>
  
  <p>This question can only be answered well if comparing original, pure versions of both, not the variants that have developed since their introduction.</p>
  
  <p>Simulated annealing or other stochastic gradient descent methods usually work better with continuous function approximation requiring high accuracy, since pure genetic algorithms can only select one of two genes at any given position.</p>
  
  <blockquote>
    <p>From my experience, genetic algorithm seems to perform better than simulated annealing for most problems.</p>
  </blockquote>
  
  <p>Those performance results would be of value to others and should be published as a paper, presented as an open source project, or published creative commons in the appropriate AI venue. At the very minimum, the results could be placed in the above question or an answer to it.</p>
  
  <p><a href="https://i.sstatic.net/2tS9r.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/2tS9r.png" alt="Error Surface Showing How Global Optimum Can be Missed"></a></p>
  
  <p><a href="https://i.sstatic.net/b7G0p.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/b7G0p.png" alt="The Rastrigin Function"></a></p>
  
  <hr>
  
  <p><strong>References</strong></p>
  
  <p>[1] <a href="https://www.jstor.org/stable/1690046" rel="nofollow noreferrer"><em>Optimization by Simulated Annealing</em></a>, Science S. Kirkpatrick, C. D. Gelatt and M. P. Vecchi, Science New Series, Vol. 220, No. 4598, May 1983, pp. 671-680</p>
  
  <p>[2] N. Metropolis, A. Rosenbluth, M. Rosenbluth., A. Teller. E. Teller, J. Chem. Phys. 21. 1087 110511</p>
  
  <ul>
  <li><p><a href="https://arxiv.org/pdf/1401.1084.pdf" rel="nofollow noreferrer"><em>Optimised simulated annealing for Ising spin glasses</em></a>, 2015, S.V. Isakov et. al.</p></li>
  <li><p><a href="https://www.researchgate.net/profile/Chao_Wang213/publication/272753635_A_parallel_simulated_annealing_method_for_the_vehicle_routing_problem_with_simultaneous_pickup-delivery_and_time_windows/links/5ac6e5cea6fdcc8bfc7f86f9/A-parallel-simulated-annealing-method-for-the-vehicle-routing-problem-with-simultaneous-pickup-delivery-and-time-windows.pdf" rel="nofollow noreferrer"><em>A parallel simulated annealing method for the vehicle routing problem with simultaneous pickup–delivery and time windows</em></a>, 2014, Chao Wang et. al.</p></li>
  <li><p><a href="https://arxiv.org/pdf/1409.7186.pdf" rel="nofollow noreferrer"><em>Feature-based tuning of simulated annealing applied to the curriculum-based course timetabling problem</em></a>, 2015, Ruggero Bellio et. al.</p></li>
  </ul>
  
  <p><strong>Images from Other Answers</strong></p>
  
  <ul>
  <li><p><a href="https://ai.stackexchange.com/questions/7328/if-digital-values-are-mere-estimates-why-not-return-to-analog-for-ai/7982#7982">If digital values are mere estimates, why not return to analog for AI?</a></p></li>
  <li><p><a href="https://ai.stackexchange.com/questions/10044/method-to-check-goodness-of-combinatorial-optimization-algorithm-implementation/10092#10092">Method to check goodness of combinatorial optimization algorithm implementation</a>, plotted from <a href="https://github.com/facebookresearch/nevergrad/blob/master/nevergrad/functions/corefuncs.py" rel="nofollow noreferrer">https://github.com/facebookresearch/nevergrad/blob/master/nevergrad/functions/corefuncs.py</a></p></li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-22T02:25:29.577Z
Answers.LastActivityDate: 2019-01-22T02:25:29.577Z
Answers.UserDisplayName: Douglas Daseeco
Answers.Body: <p>Simulated annealing algorithms are generally better at solving mazes, because they are less likely to get suck in a local minima because of their probabilistic "mutation" method. See <a href="https://www.mathworks.com/help/gads/what-is-simulated-annealing.html" rel="nofollow noreferrer">here</a>. Genetic algorithms are better at training neural networks, because of their genetically inspired training algorithm. This makes them more versatile and efficient in more complex situations.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-18T20:22:37.377Z
Answers.LastActivityDate: 2019-01-18T20:22:37.377Z
Answers.UserDisplayName: iamPres
Body: <p>What kind of problems is simulated annealing better suited for compared to genetic algorithms?</p>
  
  <p>From my experience, genetic algorithms seem to perform better than simulated annealing for most problems.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-12-12T09:35:39.310Z
Comments.Text: Could you clarify what you mean by "perform better" - e.g. does GA find the better solution, is it faster to run, does it use less memory, storage or CPU resources? Also name the problems you have tried SA vs GA on . . .
Comments.UserDisplayName: Neil Slater
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-21T11:25:12.577Z
Comments.Text: See also this SO question: https://stackoverflow.com/q/4092774/3924118.
Comments.UserDisplayName: nbro
Tags: <genetic-algorithms><search><optimization><simulated-annealing>
Title: When should I use simulated annealing as opposed to a genetic algorithm?
UserDisplayName: Abbas Ali
ThreadText: # When should I use simulated annealing as opposed to a genetic algorithm?
  
  (Asked by: username_0 on 2018-12-12)
  
  What kind of problems is simulated annealing better suited for compared to genetic algorithms?
  
  From my experience, genetic algorithms seem to perform better than simulated annealing for most problems.
  
  **Tags:** genetic-algorithms, search, optimization, simulated-annealing
  > **Comments:**
  > **username_1**: Could you clarify what you mean by "perform better" - e.g. does GA find the better solution, is it faster to run, does it use less memory, storage or CPU resources? Also name the problems you have tried SA vs GA on . . .  
  > **username_2**: See also this SO question: https://stackoverflow.com/q/4092774/3924118.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2019-01-22. Score: 4
  
  > Simulated Annealing vs genetic algorithm?
  
  Simulated annealing is a materials science analogy and involves the introduction of noise to avoid search failure due to local minima. See images below. To improve the odds of finding the global minimum rather than a sub-optimal local one, a stochastic element is introduced by simulating Brownian (thermal) motion. Variants of simulated annealing include injection of random numbers with various distributions and the averaging effect of mini-batching (dividing a batch into segments and performing network parameter adjustment after each).
  
  Genetic algorithms are search methods based on principles of mutation, meiosis, symbiosis, test, elimination of inadequacy, and recursion. The advantages of such approaches is the simulation of sexual reproduction, where the possibility of dominant genetic features from two individuals producing a child individual containing the best of both exists. In a population of children, the probability of such a hybrid emerging is higher. Over several generations, even higher than that.
  
  > What kind of problems does simulated annealing perform better than genetic algorithms if any?
  
  This question can only be answered well if comparing original, pure versions of both, not the variants that have developed since their introduction.
  
  Simulated annealing or other stochastic gradient descent methods usually work better with continuous function approximation requiring high accuracy, since pure genetic algorithms can only select one of two genes at any given position.
  
  > From my experience, genetic algorithm seems to perform better than simulated annealing for most problems.
  
  Those performance results would be of value to others and should be published as a paper, presented as an open source project, or published creative commons in the appropriate AI venue. At the very minimum, the results could be placed in the above question or an answer to it.
  
  [![Error Surface Showing How Global Optimum Can be Missed](https://i.sstatic.net/2tS9r.png)](https://i.sstatic.net/2tS9r.png)
  
  [![The Rastrigin Function](https://i.sstatic.net/b7G0p.png)](https://i.sstatic.net/b7G0p.png)
  
  ---
  
  **References**
  
  [1] [*Optimization by Simulated Annealing*](https://www.jstor.org/stable/1690046), Science S. Kirkpatrick, C. D. Gelatt and M. P. Vecchi, Science New Series, Vol. 220, No. 4598, May 1983, pp. 671-680
  
  [2] N. Metropolis, A. Rosenbluth, M. Rosenbluth., A. Teller. E. Teller, J. Chem. Phys. 21. 1087 110511
  
  * [*Optimised simulated annealing for Ising spin glasses*](https://arxiv.org/pdf/1401.1084.pdf), 2015, S.V. Isakov et. al.
  * [*A parallel simulated annealing method for the vehicle routing problem with simultaneous pickup–delivery and time windows*](https://www.researchgate.net/profile/Chao_Wang213/publication/272753635_A_parallel_simulated_annealing_method_for_the_vehicle_routing_problem_with_simultaneous_pickup-delivery_and_time_windows/links/5ac6e5cea6fdcc8bfc7f86f9/A-parallel-simulated-annealing-method-for-the-vehicle-routing-problem-with-simultaneous-pickup-delivery-and-time-windows.pdf), 2014, Chao Wang et. al.
  * [*Feature-based tuning of simulated annealing applied to the curriculum-based course timetabling problem*](https://arxiv.org/pdf/1409.7186.pdf), 2015, Ruggero Bellio et. al.
  
  **Images from Other Answers**
  
  * [If digital values are mere estimates, why not return to analog for AI?](https://ai.stackexchange.com/questions/7328/if-digital-values-are-mere-estimates-why-not-return-to-analog-for-ai/7982#7982)
  * [Method to check goodness of combinatorial optimization algorithm implementation](https://ai.stackexchange.com/questions/10044/method-to-check-goodness-of-combinatorial-optimization-algorithm-implementation/10092#10092), plotted from <https://github.com/facebookresearch/nevergrad/blob/master/nevergrad/functions/corefuncs.py>
  
  
  ---
  
  ### Answer by username_4 on 2019-01-18. Score: -1
  
  Simulated annealing algorithms are generally better at solving mazes, because they are less likely to get suck in a local minima because of their probabilistic "mutation" method. See [here](https://www.mathworks.com/help/gads/what-is-simulated-annealing.html). Genetic algorithms are better at training neural networks, because of their genetically inspired training algorithm. This makes them more versatile and efficient in more complex situations.
  
  
  ---
  
  