page479.html

来自「wqeqwvrw rkjqhwrjwq jkhrjqwhrwq jkhrwq」· HTML 代码 · 共 91 行

HTML
91
字号
<HTML>
<HEAD>
<TITLE>Simulated Annealing</TITLE>
</HEAD>
<BODY bgcolor="#FFFFFF">
 <img src="cover75.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/cover75.gif" alt="Logo" align=right>
<b>Data Structures and Algorithms 
with Object-Oriented Design Patterns in C++</b><br>
<A NAME="tex2html7833" HREF="page480.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page480.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="next_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/next_motif.gif"></A> <A NAME="tex2html7831" HREF="page471.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page471.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="up_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/up_motif.gif"></A> <A NAME="tex2html7827" HREF="page478.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page478.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="previous_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/previous_motif.gif"></A> <A NAME="tex2html7835" HREF="page9.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page9.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="contents_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/contents_motif.gif"></A> <A NAME="tex2html7836" HREF="page620.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page620.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="index_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/index_motif.gif"></A> <BR><HR>
<H2><A NAME="SECTION0015540000000000000000">Simulated Annealing</A></H2>
<A NAME="secalgsanneal">&#160;</A>
<P>
Despite its name, <em>simulated annealing</em><A NAME=34316>&#160;</A>
has nothing to do either with simulation or annealing.
Simulated annealing is a problem solving technique
based loosely on the way in which a metal is annealed<A NAME=34317>&#160;</A>
in order to increase its strength.
When a heated metal is cooled very slowly,
it freezes into a regular (minimum-energy) crystalline structure.
<P>
A simulated annealing algorithm searches for the optimum solution
to a given problem in an analogous way.
Specifically, it moves about randomly in the solution space
looking for a solution that minimizes the value of some objective function.
Because it is generated randomly,
a given move may cause the objective function
to increase, to decrease or to remain unchanged.
<P>
A simulated annealing algorithm always accepts moves that <em>decrease</em>
the value of the objective function.
Moves that <em>increase</em> the value of the objective function
are accepted with probability
<P> <IMG WIDTH=284 HEIGHT=18 ALIGN=BOTTOM ALT="displaymath69533" SRC="img2057.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/img2057.gif"  ><P>
where  <IMG WIDTH=12 HEIGHT=11 ALIGN=BOTTOM ALT="tex2html_wrap_inline69535" SRC="img2058.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/img2058.gif"  > is the change in the value of the objective function
and <I>T</I> is a control parameter called the <em>temperature</em><A NAME=34322>&#160;</A>.
I.e., a random number generator that generates numbers distributed
uniformly on the interval (0,1) is sampled,
and if the sample is less than <I>p</I>, the move is accepted.
<P>
By analogy with the physical process,
the temperature <I>T</I> is initially high.
Therefore, the probability of accepting a move that increases
the objective function is initially high.
The temperature is gradually decreased as the search progresses.
I.e., the system is <em>cooled</em> slowly.
In the end,
the probability of accepting a move that increases the objective
function becomes vanishingly small.
In general,
the temperature is lowered in accordance with
an <em>annealing schedule</em><A NAME=34325>&#160;</A>.
<P>
The most commonly used annealing schedule is called
<em>exponential cooling</em><A NAME=34327>&#160;</A>.
Exponential cooling begins at some initial temperature,  <IMG WIDTH=15 HEIGHT=23 ALIGN=MIDDLE ALT="tex2html_wrap_inline63638" SRC="img1114.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/img1114.gif"  >,
and decreases the temperature in steps according to
 <IMG WIDTH=85 HEIGHT=24 ALIGN=MIDDLE ALT="tex2html_wrap_inline69547" SRC="img2059.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/img2059.gif"  >
where  <IMG WIDTH=67 HEIGHT=23 ALIGN=MIDDLE ALT="tex2html_wrap_inline69549" SRC="img2060.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/img2060.gif"  >.
Typically, a fixed number of moves must be accepted at each temperature
before proceeding to the next.
The algorithm terminates
either when the temperature reaches some final value,  <IMG WIDTH=16 HEIGHT=24 ALIGN=MIDDLE ALT="tex2html_wrap_inline69551" SRC="img2061.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/img2061.gif"  >,
or when some other stopping criterion has been met.
<P>
The choice of suitable values for  <IMG WIDTH=9 HEIGHT=7 ALIGN=BOTTOM ALT="tex2html_wrap_inline63034" SRC="img1033.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/img1033.gif"  >,  <IMG WIDTH=15 HEIGHT=23 ALIGN=MIDDLE ALT="tex2html_wrap_inline63638" SRC="img1114.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/img1114.gif"  > and  <IMG WIDTH=16 HEIGHT=24 ALIGN=MIDDLE ALT="tex2html_wrap_inline69551" SRC="img2061.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/img2061.gif"  >
is highly problem-dependent.
However, empirical evidence suggests that a good value for  <IMG WIDTH=9 HEIGHT=7 ALIGN=BOTTOM ALT="tex2html_wrap_inline63034" SRC="img1033.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/img1033.gif"  > is 0.95
and that  <IMG WIDTH=15 HEIGHT=23 ALIGN=MIDDLE ALT="tex2html_wrap_inline63638" SRC="img1114.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/img1114.gif"  > should be chosen so that
the initial acceptance probability is 0.8.
The search is terminated typically after some fixed, total number of
solutions have been considered.
<P>
Finally, there is the question of selecting the initial solution
from which to begin the search.
A key requirement is that it be generated quickly.
Therefore, the initial solution is generated typically at random.
However, sometimes the initial solution can be generated
by some other means such as with a greedy algorithm.
<P>
<BR> <HR>
<UL> 
<LI> <A NAME="tex2html7837" HREF="page480.html#SECTION0015541000000000000000" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page480.html#SECTION0015541000000000000000">Example-Balancing Scales</A>
</UL>
<HR><A NAME="tex2html7833" HREF="page480.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page480.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="next_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/next_motif.gif"></A> <A NAME="tex2html7831" HREF="page471.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page471.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="up_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/up_motif.gif"></A> <A NAME="tex2html7827" HREF="page478.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page478.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="previous_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/previous_motif.gif"></A> <A NAME="tex2html7835" HREF="page9.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page9.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="contents_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/contents_motif.gif"></A> <A NAME="tex2html7836" HREF="page620.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page620.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="index_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/index_motif.gif"></A> <P><ADDRESS>
<img src="bruno.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/bruno.gif" alt="Bruno" align=right>
<a href="javascript:if(confirm('http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/copyright.html  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/copyright.html'" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/copyright.html">Copyright &#169; 1997</a> by <a href="javascript:if(confirm('http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/signature.html  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/signature.html'" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/signature.html">Bruno R. Preiss, P.Eng.</a>  All rights reserved.

</ADDRESS>
</BODY>
</HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?