A project for my artificial intelligence module in my final year at university. The task was to pick any technique to derive optimal solutions to a dataset representing a Travelling Salesman Problem.
The following is an excerpt from my report
Simulated annealing, unlike other algorithms, can sometimes accept a worse path in an iteration depending on some factors, this is done to ensure a larger coverage of the search space, and can prevent the algorithm from getting stuck in a local minimum.
The following is the iterative loop which is used in simulated annealing to find the optimal path:-
Below is the statement to calculate a random probability, and it’s comparison to a random number between 0 and 1.
cost difference -cost difference / temperature > random(0, 1)
The stop condition for the loop is based on the “temperature”; a variable that decreases to 99% of its previous value upon each iteration.
Through testing, I have derived the optimal starting temperature to be 1000, and the stopping temperature to be 0.001.
A final note on simulated annealing, as the algorithm uses a randomized initial path, it is not guaranteed to deliver the same result on each run. A remedy to this problem is fine tuning the parameters such as the temperature and the probability, but those can affect the total run time of the program.
Training sets results
References