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
4
votes
1 answer

TSP, algorithm gets stuck in local minimum

I am struggling to implement a program based on simulated annealing to solve the traveling salesman problem. All solutions I got are not satisfying and i have no clue how to improve my implementation. Obviously I'm not focusing on benchmarks, but…
4
votes
1 answer

How to find neighboring solutions in simulated annealing?

I'm working on an optimization problem and attempting to use simulated annealing as a heuristic. My goal is to optimize placement of k objects given some cost function. Solutions take the form of a set of k ordered pairs representing points in an…
Joel Abraham
  • 43
  • 1
  • 5
4
votes
2 answers

What's the fastest heuristic algorithm to split students into groups?

I have X number of students, where X is a multiple of 6. I now want to split up the students into groups of 6. I have a function that measures how "good" a group of 6 is (lets say it's a black box that runs in constant time for now). By splitting up…
4
votes
2 answers

Writing Simulated Annealing algorithm for 0-1 knapsack in C#

I'm in the process of learning about simulated annealing algorithms and have a few questions on how I would modify an example algorithm to solve a 0-1 knapsack problem. I found this great code on…
Mike Christensen
  • 88,082
  • 50
  • 208
  • 326
4
votes
1 answer

What is the time complexity of the Hill Climbing Algorithm?

Specifically, the Steepest-Ascent Hill Climbing, Stochastic Hill Climbing and Simulated Annealing. The generalized time complexity would be fine too. Thanks.
3
votes
3 answers

Solving sudoku with heuristics: a good idea?

I was trying to solve a partially initialized sudoku puzzle (the kind that appears in newspapers) with the 'Drools Planner' package. While it can generate a (random) puzzle from scratch in 3 seconds, it gets stuck in a loop solving a partially…
3
votes
3 answers

Simulated Annealing - Intuition

Cross posted from csexchange: Most versions of simulated annealing I've seen are implemented similar to what is outlined in the wikipedia pseudocode below: Let s = s0 For k = 0 through kmax (exclusive): T ← temperature( 1 - (k+1)/kmax ) Pick a…
Solaxun
  • 2,732
  • 1
  • 22
  • 41
3
votes
1 answer

What is the difference between the objective function (SA) and the value function (RL)

Having an objective function E(s) in Simulated Annealing (SA) defines the transition probability of moving from one state s to another s'. Ideally, the objective function minimum corresponds to the optimal solution. In Reinforcement learning (RL),…
3
votes
1 answer

Why is this simulated annealing algorithm applied to the TSP not converging?

For an exercise I have to find the optimal solution to this Travelling Salesman Problem, only difference is that the salesman may not visit the first coordinate twice. The optimum should lie around 1200 which is given. I don't see why this wouldn't…
Max
  • 437
  • 1
  • 4
  • 7
3
votes
1 answer

Looking for an algorithm that delivers also the local minima back

All optimization algorithms for black box functions known to me like simulated annealing or Bayesian optimization deliver the global minimum back. I am looking for a python algorithm that delivers to me the global and also all local minima back. Is…
3
votes
2 answers

Allocating resources according to rules -- is simulated annealing appropriate?

I would like to design an application that can allocate resources according to rules. I believe simulated annealing would work, but I am not too familiar with it and I was wondering if there were alternative algorithms that might be suitable. For…
sourcenouveau
  • 29,356
  • 35
  • 146
  • 243
3
votes
1 answer

How to use simanneal package

I am trying to optimize parameters of my function/object, using simulated annealing via the simanneal package https://github.com/perrygeo/simanneal . My code looks as follows: from simanneal import Annealer class ReservoirAnnealer(Annealer): …
Luca Thiede
  • 3,229
  • 4
  • 21
  • 32
3
votes
0 answers

Methods of discrete optimization of particular function in Python

I have a matrix on Z^2 with large dimensions (e.g. 20000 vectors of 200 elements). Each vector contains the same number of ones. I want to find minimal set of the vectors that gives a vector of ones in bitwise OR. This is solved by dynamic…
3
votes
0 answers

Name for hill climbing algorithm where search space is transformed

I am developing an algorithm which is based on the hill-climbing algorithm, but with a method to overcome the problem of finding local optimal solutions. Unlike something like simulated annealing, where randomness is introduced into the search…
3
votes
0 answers

Simulated Annealing for graph coloring

I am working on a simulated annealing algorithm for graph coloring. I am following this model, but I am having troubles understanding the cooling schedule and more specifically, the section with the variable M. In my understanding M represents the…
Ivan Ivanov
  • 243
  • 4
  • 15
1
2
3
12 13