Sample Run


Let's look at the result of a sample run. In this run, we'll start the temperature at 100, though it's really only necessary to start at about 30 to solve the problem. We start from 100 to illustrate the algorithm (as shown in Figure 2.5).

click to expand
Figure 2.5: Plot of sample simulated annealing run for the 40-Queens problem.

The element falling sharply from 100 to 0 is the temperature. The cooling schedule uses Equation 2.2. The element falling less sharply is the number of accepted worse solutions (based upon the acceptance probability Equation 2.1). Since the acceptance probability is a function of the temperature, a correlation is easily seen. Finally, the line interspersed with '+' symbols is the best solution energy. As this graph shows, the perfect solution is not found until very near the end. This is true in all runs because of the acceptance criteria equation. The sharp drop of the "Accepted" graph element at the end of the plot is indicative of this ”a sharp reduction in the acceptance of worse solutions can be seen.

The actual 40-Queens solution, as represented by Figure 2.5, is shown in Figure 2.6.

click to expand
Figure 2.6: Sample Solution to the 40-Queens problem.



Visual Basic Developer
Visual Basic Developers Guide to ASP and IIS: Build Powerful Server-Side Web Applications with Visual Basic. (Visual Basic Developers Guides)
ISBN: 0782125573
EAN: 2147483647
Year: 1999
Pages: 175

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net