6
$\begingroup$

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.

$\endgroup$
  • 3
    $\begingroup$ Answer can be found here $\endgroup$ – Ugnes Oct 19 '17 at 14:23
3
$\begingroup$

When we climb a hill:
enter image description here

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.

enter image description here

$\endgroup$
1
$\begingroup$

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...

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.