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
1
vote
1 answer

Is Simulated Annealing suitable for this minimum cost problem?

Leetcode 256: Paint House I am trying to solve the this problem with the Simulated Annealing algorithm. But the result is far away from the correct answer, which is calculated with the DP method. e.g., I made a 10x3 costs matrix as following, the…
da_miao_zi
  • 351
  • 1
  • 11
1
vote
0 answers

Finding the Big-O Complexity of a Randomized Search + Simulated Annealing Algorithm for solving a Movie Scenes Scheduling Problem

I have developed an algorithm that combines randomized search and Simulated Annealing for solving the Movie Scenes Scheduling problem, a problem that consists of proposing the best shooting sequence for minimizing the costs (actor wages per take),…
1
vote
1 answer

What is the R equivalent if the scipy.optimize.dual_annealing function in Python

I am translating some code from Python to R, and am finding it hard to find the corresponding functions in each. In this particular case, the code I'm having trouble with is: output = dual_annealing( residuals_totalcases,…
1
vote
1 answer

Simulated annealing converges to wrong global minima

I implemented simulated annealing to find global minima of a given function using https://perso.crans.org/besson/publis/notebooks/Simulated_annealing_in_Python.html but although the temperature is high at first and then decreases slowly (cause of…
1
vote
1 answer

Simulated Annealing for Sudoku Solving

I'm trying to solve a 9x9 sudoku puzzle using Simulated Annealing, but my implementation doesn't seem to be working correctly. It does not even get closer to a lower-cost solution but instead keeps circling around results that cost between 60 and…
1
vote
1 answer

Finding all local maxima of a function

I have written code to find the global minimum of a function using the simulated annealing algorithm — down below — but how to use the same algorithm to find all local maxima of a function? My code for finding the local minimum of a function, note…
Amr
  • 1,068
  • 12
  • 21
1
vote
0 answers

Gradient descent and simulated annealing

For a given function, gradient descent may end up in a local minimum, which is not the global one. Is there any way to combine simulated annealing with gradient descent to find a better local minimum? Finding the global minimum is ideal, but it may…
Mitra
  • 11
  • 1
1
vote
0 answers

Facility location problem using Genetic algorithm or Simulated Annealing

I am currently working on a demo problem where the network is : Plant -- Warehouse -- Customer . I need to find out the optimal number of warehouses which are required for cost minimization . I have transportation cost and handling cost of Plants…
1
vote
1 answer

What does this exception mean?

I am working on implementing a simulated annealing program and part of this involves calculating scores from a .txt file that my java program reads. 1) an input string is read from the user. The longer my input string, the more likely the following…
Roy
  • 763
  • 2
  • 8
  • 18
1
vote
0 answers

How to make scipy's basinhopping less sensitive in Python

I am running an optimisation which optimises a function of ~10 paramaters. The function itself takes a reasonably long time (a few seconds) to evaluate and its landscape is very choppy. It can take on values between 0 and 1, with 0 being the…
Cameron
  • 1,011
  • 1
  • 10
  • 20
1
vote
0 answers

how to make sure optim() SANN can't find a global optimum?

I was confused because using optim() SANN was returning different results for same input. I did not find a global minimum for a given starting point and fn, and I concluded that SANN cannot find it for that given fn and starting point. My conclusion…
Chicago1988
  • 970
  • 3
  • 14
  • 35
1
vote
1 answer

Understanding simulated annealing- conceptually

i have just been introduced to simulated annealing and would like to understand it better before delving into the code again as I feel like I dont quite get it despite reading the code from the resources I have so far. So please feel free to correct…
Roy
  • 763
  • 2
  • 8
  • 18
1
vote
0 answers

Is there an accepted "current industry standard best" of stochastic optimization? (Simulated annealing, Particle swarm optimization, etc)

Sorting algorithms are well understood enough that Java Collections uses some flavor of MergeSort or Timsort. (Even though it is possible to hand-craft collections that "fight" the algorithm and perform poorly, those choices are "often enough…
Benjamin H
  • 5,164
  • 6
  • 34
  • 42
1
vote
1 answer

How to debug a monte carlo simulation faster?

I'm writing a simulated annealing program, and having some trouble debugging it. Any advice would be welcome. First of all, the output is not deterministic, so I've taken to running it a hundred times and looking at the mean and standard…
Wang
  • 3,247
  • 1
  • 21
  • 33
1
vote
1 answer

Confused about simulated annealing

Simulated annealing is a meta-heuristic for optimization. Essentially it does hill-climbing with the possibility of jumping from one hill to another -- even if the jump is to a lower place on the second hill. Such negative jumps are allowed less…
RussAbbott
  • 2,660
  • 4
  • 24
  • 37