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
2 answers

Trouble with copying dictionaries and using deepcopy on an SQLAlchemy ORM object

I'm doing a Simulated Annealing algorithm to optimise a given allocation of students and projects. This is language-agnostic pseudocode from Wikipedia: s ← s0; e ← E(s) // Initial state, energy. sbest ← s; ebest ← e …
PizzAzzra
  • 715
  • 13
  • 25
0
votes
1 answer

Roster/Timetable generation

I'm working on a tool to generate a timetable for employee up to a month taking into account commercial and labor law constraints. Few challenges and difference from similar problem: The shift concept contains breaks split up to half an hour. There…
0
votes
1 answer

Simulated Annealing Method won't execute

Currently i'm trying to create a stimulated annealing algorithm solving the traveling salesman problem as well as creating a gui for it. The initial cities(points) and lines display but I can't get the doSA() method to successfully run. Any ideas,…
0
votes
4 answers

Retracing a simulated-annealing's optimization steps

I'm using simulated annealing to help solve a problem such as the travelling salesman problem. I get a solution, which I'm happy with, but I would now like to know the path, within the solution space (that is, the steps taken by the algorithm to…
Lucien S.
  • 5,123
  • 10
  • 52
  • 88
0
votes
2 answers

Java: Value updates when it shouldn't

Basically I'm trying to create an implementation of simulated annealing for the multidimensional knapsack problem. I'm having a problem getting the system to decide whether or not to accept a state with a lower value. The annealing is controlled…
benwad
  • 6,414
  • 10
  • 59
  • 93
0
votes
1 answer

In an alg. which handles points (2D), but every point is actually a vector, how to label them as points?

I am trying to organize the vertices of a graph based on optimizing a cost function. At the moment I am using the Simulated Annealing algorithm. The problem is that in the original algorithm we are looking for optimal points (in a 2D environment…
Calin O.
  • 13
  • 3
0
votes
1 answer

Job shop scheduling using simulated annealing metaheuristic

I am implementing a job shop scheduler using Simulated Annealing - each instance is represented by a disjunctive graph (described here). Basically, the neighbourhood action for the metaheuristic is inverting a randomly chosen disjunctive arc that…
user1743618
0
votes
0 answers

Simulated Annealing: why give me at run biggest values?

I make a matrix where I generate random numbers of 0 and 1. This matrix represents numbers generate in bits. After this I transform the bits into real numbers which are load into a vector.I use Simulated Annealing algorithm on Griewangk's function…
0
votes
1 answer

Simulated Annealing with real value maximisation

I am working on simulated annealing trying to solve the knapsack problem whereby I have to maximise the fitness (value of the item in the bag). float weight[5]={2, 3, 5, 4, 3}; // weight float value[5]={10, 20, 15, 25, 5}; // value of corresponding…
rish
  • 5,575
  • 6
  • 22
  • 27
0
votes
1 answer

Java program that executes only when (non-user) input is received via a file

as part of my research project, I have written a Java search program that implements simulated annealing. However, this search doesn't only occur in the Java program as I am supposed to compute the overall cost function using another program written…
trizz
  • 1
0
votes
2 answers

How do you know you're close to the solution?

I've searched but found no answer. I'm trying to solve the 8 queens puzzle (more specifically the N queens puzzle) using the simulated annealing (SA) algorithm implemented in Java, but I'm kinda stuck when it comes to the objective function. How do…
user1747330
0
votes
1 answer

Python TSP Berlin 52 with Simulated Annealing

I want to know what this function does: def Recocido(tour1 = []): # tour1 = tour1[:] izquierda = random.randrange(len(tour1)) derecha = 0 while(True): derecha = random.randrange(len(tour1)) if (derecha != izquierda): …
Menticolcito
  • 769
  • 1
  • 5
  • 11
0
votes
1 answer

Temperature Scale in SA

First, this is not a question about temperature iteration counts or automatically optimized scheduling. It's how the data magnitude relates to the scaling of the exponentiation. I'm using the classic formula: if(delta < 0 || exp(-delta/tK) >…
0
votes
2 answers

Multi-threaded Simulated Annealing

I wrote a multithreaded simulated annealing program but its not running. I am not sure if the code is correct or not. The code is able to compile but when i run the code it crashes. Its just a run time error. #include #include…
Avinesh Kumar
  • 1,389
  • 2
  • 17
  • 26
0
votes
1 answer

Sorting Male and Females with a CSV File already

I need to split people in teams, each team has a certain required amount of male and females for those teams, i've written the following code but I don't know how to modify it so that the teams generated would have the right amount of male and…
1 2 3
12
13