add simulated annealing C++ code