Simple hill-climber and simulated annealing algorithms in C++