Uploaded by R J

Hill-climbing

advertisement
Hill-Climbing
This algorithm, also
called discrete optimization algorithm, uses a
simple heuristic function viz.
the amount of distance the node 15 Irom ne
goal. 1ne ordering ot choices Is a heuriStiC measure
The Search Process 25
traverse to reach the goal node.
of the remaining distance one has to
In fact, there is practically no difference between hill-climbing and depth-first search except
has been expanded are sorted by the remaining distance.
that the children of the node that
3.5 and the path followed is given in Fig. 3.6.
The algorithm for hill-climbing is given in Fig.
Put the initial node
on a
list START
Step
1
Step
2
Step
3
Remove the first node from START. Call this
Step
4
If (a=GOAL) terminate
Step
5:
Step 6
If (START
is
empty)
or
(START=GOAL)
search with
terminate search
node a
success
are
has successors, generate all of them. Find out how far they
add
and
from the goal node. Sort them by the remaining distance from the goal
them to the beginning of START.
Else if node
Goto
a
Step 2.
3.5
Fig.
Algorithm for hill-climbing procedure
Root
2.7
D
2.9
Goal node
Hill-climbing technique
Fig.
3.6 Scarch tree for
is
used in
being
some
hill-climbing procedure
activity
or
other in
our
day-to-day
chore. Some
of them are:
1.
2
FES4
transistor,
listening to somebody playing flute on the
adjusted in a way that makes the music melodious.
While
While
tuning
the carburettor of
a scooter,
tone
and volume control aree
the accelerator is raised
to
its maximum
once
obal eak
Local Max imum
Plateau
Ridge
hg
37
Probems aswxiated with
hill
climbing- Iocai mavimum. plateau and
rhdge
The Search Process 27
and the carburettor is tuned so that the engine keeps on running for a considerably long
period of time.
An electronics expert, while making the transistor for the first time, tunes the radio set
at mid-afternoon when the signal is weak for proper reception.
Problems of Hill-Cimbing Tochnique
Local marimum: A state that is better than all its ncighbours but not so when compared
to states o states that are farther away.
Plateau: A fNat area of the search space, in which all neighbours have the same value.
Ridge: Described as "a long and narrow stretch of clevated ground or a narrow elevation
or raised part running along or actoss a 'surface "by The Oxford English Dictionary, this
is an area in the path which must be traversed very carefully because movement in any
direction might maintain one at the same level or result in fast descent.
Figure 3.7 provides a pictorical representation of the local maximum, plateau and the ridge.
In order to overcome these problems, adopt one of the following or a combination of the
following methods:
Backtracking for local maximum. Backtracking helps
in
undoing
what has been done
so
farand permits to try a totally different path to attain the global peak.
A big jump
is the solution to escape
from the plateau.
the
because in a platcau all netghbouring points have
huge jump
same value.
A
is recommended
Trying different paths at the same time is the solution for circumventing ridges.
CONSTRAINT SATISFACTION
one of use, in the real world, work in an cnvironment wherein
Every
Even then, solutions are found without violating the constraints.
there exists lot of constraints.
For solving problems in this
area, human beings use extensive domain specific and heuristic knowledge. Suggestive examples
for constraint satisfaction are design problems in manufacturing, movement of semi-finished goods
in assembly lines, planning an optimal travel tour covering major tourist spots with minimal
of resources etc.
problems are typical consiraint satisfaction problems. To
Cryptarithmetie
expense
explain what is a cryptarithmetic problem, consider the following example:
SEN D
+
MOR
MON
E
E
Y
Here. the constraints are
All alphabcts used are to have different numeric values.
Since addition operation is involved, rules of addition are to be adhered to.
The solution is to find the values of the alphabcts M, O. N, E, Y, S, R and D. It is possible
o find the values of the alphabets either by brute force method or minimize the search space by
applying the constraints of the problem. Program 1. given below is a BASIC program for the
above problem. lt tries to solve the problem by brule-force search method.
Download