I am reading about local search: hill climbing, and its types, and simulated annealing
One of the hill climbing versions is "stochastic hill climbing", which has the following definition:
Stochastic hill climbing does not examine for all its neighbor before moving. Rather, this search algorithm selects one neighbor node at random and decides whether to choose it as a current state or examine another state
Some sources mentioned that it can be used to avoid local optima.
Then I was reading about simulated annealing and its definition:
At every iteration, a random move is chosen. If it improves the situation then the move is accepted, otherwise it is accepted with some probability less than 1
So, what is the main difference between the two approaches? Does the stochastic choose only random (uphill) successor? If it chooses only (uphill-successors), then how does it avoid local optima?