Created
November 7, 2011 19:37
-
-
Save vjeux/1345916 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while outer_condition() | |
while inner_condition() | |
[a, b] = pick2() | |
delta = swap a, b | |
if delta < 0 or Math.random() < Math.exp(-(delta + 1) / T) | |
cost += delta | |
else | |
swap a, b # revert | |
T *= C |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment