# Why is the larger value, as opposed to the smaller one, chosen, in the hill climbing algorithm?

In the hill climbing algorithm, the greater value, compared to the current value, is selected, but I cannot understand why it takes the larger value instead of the smaller one. Why is that?

I greatly appreciate the inclusion of figures in your answers.

• Answer can be found here – Ugnes Oct 19 '17 at 14:23

## 2 Answers

When we climb a hill:

We move higher in altitude. The person who is climbing, will always look for rocks/mud on the hill that are higher, so that he can climb higher.
That is what the algorithm does too. We are assuming that there is a hill of numbers. The larger numbers are placed higher than the smaller numbers. So if we want to climb up the hill, we search for the larger numbers.
Comparing this with the real world hill climbing, simply assume that every rock on the hill has a number written on it. The number will be the altitude of the rock, from sea level height. So if you want to climb up, you just have to search for the rock with a higher number than the rock you are standing on now.

There is no reason why you can't have a hill descending algorithm, instead of finding maxima you will find minima. If that is what your aim is, it's still called a hill climbing algorithm, I guess...