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

How to implement simulated annealing to find longest path in graph

I've found a piece of pseudocode which explains simulated annealing for longest path problem, but there are a few details which I do not understand. Currently I have implemented a structure representing graph, and method to generate random graph and…
Zarrie
  • 325
  • 2
  • 16
0
votes
1 answer

How to implement Simulated Annealing algorithm in Matlab as a Local Search phase of an evolutionary algorithm?

I’m working on an evolutionary algorithm. The code is implemented in Matlab. The “Local Search” step is as follows: %% Local Search for iter2 = 1:MaxIter2 v = ceil(number_Best*rand); w = ceil(number_Best*rand); Best1 = Best_History(v,:); Best2 =…
Ehsan Jkr
  • 31
  • 9
0
votes
1 answer

Simulated annealing algorithm to solve the traveling salesman problem in Python

So im trying to solve the traveling salesman problem using simulated annealing. I am given a 100x100 matrix that contains the distances between each city, for example, [0][0] would contain 0 since the distances between the first city and itself is…
0
votes
0 answers

How to improve simulated annealing for playfair in python - how to make sure that the score goes up?

It seems that the child always sets itself to equal parent even though the conditions are not satisfied. Any help? Is this because of the layering? def crack(ct): temp = 10 + 0.087 * (len(ct)-84) fit =…
edlothia
  • 1
  • 1
0
votes
0 answers

Algorithm to avoid obvious costly combinations when splitting n values to m groups

I have 7 values and I need to split them into 5 groups. Each group should contain atleast one value. There are 15 ways to group those values into 5. Mon- 13 Tue- 5 Wed- 4 Thu- 4 Fri- 11 Sat- 2 Sun- 1 When grouping, ordering of Mon, Tue, Wed, Thu,…
0
votes
2 answers

simulated annealing for placement and routing

i am in need of a well documented source code of simulated annealing for placement and routing (in c++ or java). can anyone help me?
john
0
votes
0 answers

Caculating probability of acceptance for Simulated Annealing problems

I am having troubles figuring out how to calculate the probability of acceptance when looking at the corresponding graph below and n-queens problem when shown below. I understand that the calculation will use e^((value of next random state -…
0
votes
1 answer

PAGMO/PYGMO: Anyone understand the options for Corana’s Simulated Annealing?

I'm using the PYGMO package to solve some nasty non-linear minimization problems, and am very interested in using their simulated_annealing algorithm, however it has a lot of hyper-parameters for which I don't really have any good intuition. These…
AstroBen
  • 813
  • 2
  • 9
  • 20
0
votes
1 answer

Write list of doubles to file

I have an arraylist of doubles that I update each time I iterate through an algorithm. I want to output the full list of numbers to a file but it as only outputting one value instead of the entire list. I use a simple simulated annealing local…
0
votes
1 answer

Multiple local search algorithms to find global optima

So I'm fairly new to the whole evolutionary and genetic algorithm world and I'm in the process of writing one now that will optimize an array and return the best possible solution - the fitness. My algorithm right now is optimized through simulated…
0
votes
1 answer

Error using ^ One argument must be a square matrix and the other must be a scalar. Use POWER (.^) for elementwise power

I'm Trying to write minimization function from this function, (4-2.1*x1^2+x1^4/3)*x1^2+x1*x2+(-4+4*x2^2)*x2^2 where, -10 <= x1 <= 10 and -10 <= x2 <= 10. this what I'm writing, is this right? min = -10; max = 10; x1 = min+max*rand(); x2 =…
0
votes
0 answers

Matlab simulated Annealing with two vector decision variables

I have an objective function which takes two distinct vector (price1 and price2) decision variables each 24 elements long and evaluate to a scaler value. profit = sum(sum(W.*price1(1:4)) + sum(Y(1:24).*price2(1:24)) I want to get an optimized…
sukhalid
  • 43
  • 9
0
votes
1 answer

N-Queens Annealing Program Not Working

I'm trying to recreate the n-queens problem and solve it with simulated annealing, although the board object from my Object class is throwing an error when I try to add the temperature using len(board)**2. Any help would be very appreciated!! I have…
0
votes
1 answer

Subselect and ldaHmat error: Arguments of wrong type

I'm trying to use the subselect library and the anneal function to find a minimal subset of a larger dataset that can be used to predict a condition. Whenever I run the ldaHmat command, however, I get the error that the arguments are of the wrong…
Wolfgang
  • 80
  • 5
0
votes
2 answers

Gibbs sampling gives small probabilities

As part of our final design project, we have to design a Gibbs sampler to denoise an image. We have chosen to use the Metropolis Algorithm instead of a regular Gibbs sampler. A rough sketch of the algorithm is as follows, all pixels are 0-255…