Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Simulated annealing
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Pseudocode== The following pseudocode presents the simulated annealing heuristic as described above. It starts from a state {{math|''s''<sub>0</sub>}} and continues until a maximum of {{math|''k''<sub>max</sub>}} steps have been taken. In the process, the call {{math|neighbour(''s'')}} should generate a randomly chosen neighbour of a given state {{mvar|s}}; the call {{math|random(0, 1)}} should pick and return a value in the range {{math|[0, 1]}}, [[Uniform distribution (continuous)|uniformly at random]]. The annealing schedule is defined by the call {{math|temperature(''r'')}}, which should yield the temperature to use, given the fraction {{mvar|r}} of the time budget that has been expended so far. <div style="margin-left: 35px; width: 600px"> {{framebox|blue}} * Let {{math|''s'' {{=}} ''s''<sub>0</sub>}} * For {{math|''k'' {{=}} 0}} through {{math|''k''<sub>max</sub>}} (exclusive): ** {{math|''T'' β temperature( 1 - ''(k+''1'')''/''k''<sub>max</sub> )}} ** Pick a random neighbour, {{math|''s''<sub>new</sub> β neighbour(''s'')}} ** If {{math|''P''(''E''(''s''), ''E''(''s''<sub>new</sub>), ''T'') β₯ random(0, 1)}}: *** {{math|''s'' β ''s''<sub>new</sub>}} * Output: the final state {{mvar|s}} {{frame-footer}} </div>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)