Simulated Annealing Algorithm:
This algorithm overcomes all the problems occurred in Hill Climbing (i.e Stuck on Flat, local maximum, stuck on shoulder). It randomly chooses current node, basis on the temperature schedule and the probability of choosing next node.
Below picture show the actual algorithm of simulated annealing. you can download full project code on the link given at the end.