Questions tagged [simulated-annealing]

Simulated annealing (SA) is a generic probabilistic metaheuristic for the global optimization problem of locating a good approximation to the global optimum of a given function in a large search space.

Simulated annealing (SA) is a generic probabilistic metaheuristic for the global optimization problem of locating a good approximation to the global optimum of a given function in a large search space.

It is often used when the search space is discrete (e.g., all tours that visit a given set of cities). For certain problems, simulated annealing may be more efficient than exhaustive enumeration — provided that the goal is merely to find an acceptably good solution in a fixed amount of time, rather than the best possible solution.

The name and inspiration come from annealing in metallurgy, a technique involving heating and controlled cooling of a material to increase the size of its crystals and reduce their defects, both are attributes of the material that depend on its thermodynamic free energy. Heating and cooling the material affects both the temperature and the thermodynamic free energy. While the same amount of cooling brings the same amount of decrease in temperature it will bring a bigger or smaller decrease in the thermodynamic free energy depending on the rate that it occurs, with a slower rate producing a bigger decrease.

This notion of slow cooling is implemented in the Simulated Annealing algorithm as a slow decrease in the probability of accepting worse solutions as it explores the solution space. Accepting worse solutions is a fundamental property of metaheuristics because it allows for a more extensive search for the optimal solution.

The method was independently described by Scott Kirkpatrick, C. Daniel Gelatt and Mario P. Vecchi in 1983, and by Vlado Černý in 1985. The method is an adaptation of the Metropolis-Hastings algorithm, a Monte Carlo method to generate sample states of a thermodynamic system, invented by M.N. Rosenbluth and published in a paper by N. Metropolis et al. in 1953.

Source: Wikipedia (Simulated annealing)

194 questions
24
votes
3 answers

What are the differences between simulated annealing and genetic algorithms?

What are the relevant differences, in terms of performance and use cases, between simulated annealing (with bean search) and genetic algorithms? I know that SA can be thought as GA where the population size is only one, but I don't know the key…
23
votes
4 answers

Reproducing images with primitive shapes. (Graphics optimization problem)

Based on this original idea, that many of you have probably seen before: http://rogeralsing.com/2008/12/07/genetic-programming-evolution-of-mona-lisa/ I wanted to try taking a different approach: You have a target image. Let's say you can add one…
FogleBird
  • 74,300
  • 25
  • 125
  • 131
11
votes
1 answer

Discrete optimization in python

I am trying to use the scipy.optimize package to optimize a discrete optimization problem (global optimization). Acc to the doc, simulated annealing implemented in scipy.optimize.anneal should be a good choice for the same. But I am not sure how to…
goofd
  • 2,028
  • 2
  • 21
  • 33
9
votes
3 answers

Neighbor selection in simulated annealing algorithm

When picking a neighbor should the algorithm's temperature be considered? So for example if the temperature is high when picking a neighbor should be permutation be made? Or does the temperature only affect the acceptance probability?
Undefined
  • 1,899
  • 6
  • 29
  • 38
9
votes
4 answers

How to design acceptance probability function for simulated annealing with multiple distinct costs?

I am using simulated annealing to solve an NP-complete resource scheduling problem. For each candidate ordering of the tasks I compute several different costs (or energy values). Some examples are (though the specifics are probably irrelevant to the…
flodin
  • 5,215
  • 4
  • 26
  • 39
8
votes
1 answer

Simulated Annealing in R: GenSA running time

I am using simulated annealing, as implemented in R's package GenSa (function GenSA), to search for values of input variables that result in "good values" (compared to some baseline) of a highly dimensional function. I noticed that setting maximum…
Jebus
  • 141
  • 8
7
votes
3 answers

SciPy global minimum curve fit

I'm using scipy.optimize.curve_fit, but I suspect it is converging to a local minimum and not the global minimum. I tried using simulated annealing in the following way: def fit(params): return np.sum((ydata - specf(xdata,*params))**2) p =…
Gus
  • 4,375
  • 5
  • 31
  • 50
6
votes
3 answers

Java Simulated Annealing from Pseudocode

I am currently working on a project (TSP) and am attempting to convert some simulated annealing pseudocode into Java. I have been successful in the past at converting pseudocode into Java code, however I am unable to convert this successfully. The…
Mus
  • 7,290
  • 24
  • 86
  • 130
6
votes
1 answer

Generate a random boolean with given probability

I am writing java code to solve a problem with simulated annealing method. I need a method to generate a random true only with probability exp(a/b) where a and b are given parameters. Thanks.
Nina
  • 63
  • 1
  • 4
6
votes
2 answers

Stochastic Hill Climbing

I am trying to implement Stoachastic Hill Climbing in Java. I understand that this algorthim makes a new solution which is picked randomly and then accept the solution based on how bad/good it is. For example, if its very bad then it will have a…
Mikey
  • 687
  • 4
  • 17
6
votes
1 answer

How safe/mature is the simulated annealing algorithm given in Numerical Recipes?

The authors of "Numerical Recipes" give in Ch. 10 an implementation of the simulated annealing algorithm that combines the "classical" simulated annealing with the Nelder-Mead downhill simplex method. What I really like about this algorithm is the…
lindelof
  • 34,556
  • 31
  • 99
  • 140
5
votes
1 answer

Use multiple training methods to train a ANN with Encog

I would like to know if training a feed forward neural network with Genetic Algorithms, Particle Swarm Optimization and Simulated Annealing before using resilient propagation training does improve the result. Here is the code I am using: …
5
votes
2 answers

GCC performance

I am doing parallel programming with MPI on Beowulf cluster. We wrote parallel algorithm for simulated annealing. It works fine. We expect 15 time faster execution than with serial code. But we did some execution of serial C code on different…
azec-pdx
  • 4,790
  • 6
  • 56
  • 87
5
votes
2 answers

Simulated Annealing TSP

I'm looking to implement the simulated annealing algorithm in Java to find an optimal route for the Travelling Salesman Problem, so far I have implemented brute force and am looking to modify that code in order to use simulated annealing. Obviously…
4
votes
1 answer

Genetic algorithms vs Simulated annealing for timetables

I am developing a timetabling application. What are the relative advantages of genetic algorithms vs simulated annealing? I have these points specific to my situation: At a single time, we are allocating a maximum of (3 teachers X 6 hours)X(3…
Jesvin Jose
  • 22,498
  • 32
  • 109
  • 202
1
2 3
12 13