Вы находитесь на странице: 1из 3

Effective searching

 Should provide a mechanism to balance exploration and exploitation

Exploitation/intensification: Greedily increasing solution quality or probability but


neglect exploring a large portion of the search space. Eg by exploiting evaluation
function. E.g.: Hill Climbing

Exploration/diversification: Aim to find a larger range of solutions thoroughly but


misses exploiting promising regions., e.g.: by applying mutation, Random walks.

Hill Climbing:
Processes a given candidate solution and generates a better or equal quality solution.

The idea is that, we start with a random state/current candidate solution/Constructive heuristic, we
the generate neighbour solution, and move to the solution only if it has higher value of the
evaluation function compared to the current solution.

The algorithm terminates when we cannot find a


better solution (by searching its neighbours).

The problem with this algorithm that most of the


time it gets stuck at a local optimum.

General algorithm

1. Pick an initial starting point (current state)


2. Repeat
i. Consider neighbours of the current state
ii. Compare quality of points in the neighbourhood with the quality of the
current state, return the best among them
3. Until there is no improvement or a certain number of iterations is reached
4. Return the current solution (state).
There are different types of Hill Climbing:

1) Best Improvement/steepest Ascent-Descent (examine all neighbours):


Simulates all neighbouring solutions then chooses the best one.

Algorithm:

1. For each bit in the current solution...


i. Flip the bit
ii. Evaluate the new solution
iii. Remember the flipped index that created the best quality, and whether
it was an improvement on the current one
iv. Undo the bit flip
2. If there was an improvement, flip the bit that produced the best quality
solution

2) Next Improvement (examine all neighbours):

 Same as Best improvement


 But instead of simulating all of the neighbouring solutions then choosing the best one, what
it does is that it goes to the first solution that is better than the current one, it does this
process recursively until it finds the best solution.

3) Davis’ (Bit) Hill-Climbing (Neighbours chosen randomly):


Algorithm:

1. Create a random solution permutation


2. For each bit i in the current solution...
i. Flip the respective bit in permutation[i]
ii. If the quality has decreased (or is unchanged), undo the flip.

4) Random Mutation Hill-climbing (Neighbours chosen randomly):


Algorithm:

For a certain number of iterations...

i. Flip a random bit


ii. If the quality has decreased (or is unchanged), undo the flip
Pros
 Very easy to implement
 Only needs
o Representation
o Evaluation function
o A measure that defines neighbourhoods

Cons
 Local optima: Algorithm may halt at poor solution if neighbouring states are worse
(or equal)
 Plateaus: All neighboring states are the same as the current state. In other words the
evaluation function is essentially flat. The search will conduct a random walk (see
above).
 Ridge/valley: May oscillate from side to side without progressing
o Could restart at a different point as a fix
 Hill climbing algorithms may not find the global optimum, becoming stuck at local
ones.
 We don't know how much a local optima deviates from the global or other local
optima (how far they are from each other)
 Usually no upper bound on computation time
 Success/failure depends on starting point
o Where success is returning a global or local optimum

Вам также может понравиться