Simple simulated annealing implementation from the Wikipedia page.