You are here

Simulated Annealing Applet

Simulated annealing is a programming method that attempts to simulate the physical process of annealing. Annealing is a where a material is heated and then cooled (as steel or glass) usually for softening and making the material less brittle. Simulated annealing, therefore, exposes a "solution" to "heat" and cools producing a more optimal solution.

The "Traveling Salesman Problem" (TSP) is a common problem applied to artificial intelligence. The TSP presents the computer with a number of cities, and the computer must compute the optimal path between the cities. This applet uses simulated annealing to produce a solution to the "Traveling Salesman Problem".

Simulated Annealing


Instructions
  1. Enter the number of cities the salesman much cross through.
  2. Enter a number for the starting temperature. The temperature is an arbitrary number and does not refer to Celsius or Fahrenheit. 10 is a good enough starting temperature.
  3. Enter a delta value, this is the amount by which the temperature will fall each cycle. This value is a ratio-percent, for example .99 will cause the temperature to be 99% of what is was before, which means to decrease by 1% each time.
  4. Click Start, and watch simulated annealing try and find the optimal path.

[Download Source Code]
[Learn More about Artificial Intelligence]

 

Encog Project

This example uses a small simulated annealing experiment designed to function as an applet. If you would like a more "industrial strength" simulated annealing framework consider the Encog Machine Learning Framework. Encog is available for both Java and .Net, and includes a simulated annealing traveling salesman example just like this one.

Categories: 

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer