Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Hill Climbing

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Hill Climbing

1- Definition
 Hill Climbing is a technique to solve certain optimization problems. In this technique, we
start with a sub-optimal solution and the solution is improved repeatedly until some condition
is maximized.

 The idea of starting with a sub-optimal solution is compared to starting from the base of the
hill, improving the solution is compared to walking up the hill (or walking down), and finally
maximizing (or minimizing) some condition is compared to reaching the top of the hill.
 Hence, the hill climbing technique can be considered as the following phases:
- Constructing a sub-optimal solution obeying the constraints of the problem
- Improving the solution step-by-step
- Improving the solution until no more improvement is possible
 Hill Climbing technique is mainly used for solving computationally hard problems. It looks
only at the current state and immediate future state. Hence, this technique is memory efficient
as it does not maintain a search tree.
 Algorithm: Hill Climbing

Evaluate the initial state.


Loop until a solution is found or there are no new operators
left to be applied:
- Select and apply a new operator
- Evaluate the new state:
goal → quit
better than current state → new current state
2- Iterative Improvement
 In iterative improvement method, the optimal solution is achieved by making progress
towards an optimal solution in every iteration. However, this technique may encounter local
maxima. In this situation, there is no nearby state for a better solution.
 This problem can be avoided by different methods. One of these methods is simulated
annealing.
Random Restart
 This is another method of solving the problem of local optima. This technique conducts a
series of searches. Every time, it starts from a randomly generated initial state. Hence, optima
or nearly optimal solution can be obtained comparing the solutions of searches performed.
3- Problems of Hill Climbing Technique
 Linearity
 Finding neighbors is not easy especially for non-linear situations.
 Local Maxima
 Hill Climbing may converge to local maxima, instead of global maxima.
 Ridges and Alleys
 If the target function creates a narrow ridge, then the climber can only ascend the ridge or
descend the alley by zig-zagging. In this scenario, the climber needs to take very small steps
requiring more time to reach the goal.
 Plateau
 A plateau is encountered when the search space is flat or sufficiently flat that the value
returned by the target function is indistinguishable from the value returned for nearby
regions, due to the precision used by the machine to represent its value.
4- Complexity of Hill Climbing Technique
 This technique does not suffer from space related issues, as it looks only at the current state.
Previously explored paths are not stored.
 For most of the problems in Random-restart Hill Climbing technique, an optimal solution can
be achieved in polynomial time. However, for NP-Complete problems, computational time
can be exponential based on the number of local maxima.
5- Applications of Hill Climbing Technique
 Hill Climbing technique can be used to solve many problems, where the current state allows
for an accurate evaluation function, such as Network-Flow, Travelling Salesman problem, 8-
Queens problem, Integrated Circuit design, etc.
 Hill Climbing is used in inductive learning methods too. This technique is used in robotics
for coordination among multiple robots in a team. There are many other problems where this
technique is used.
6- Example
 This technique can be applied to solve the travelling salesman problem.
 First an initial solution is determined that visits all the cities exactly once. Hence, this initial
solution is not optimal in most of the cases. Even this solution can be very poor.
 The Hill Climbing algorithm starts with such an initial solution and makes improvements to
it in an iterative way. Eventually, a much shorter route is likely to be obtained.

You might also like