3.
المحتويات
:
•
خوارزمية هي ما
Hill Climbing Algorithm
•
ميزات
Hill Climbing Algorithm
•
الحالة مخطط
والفضاء
State and Space diagram
•
أنواع
Hill Climbing Algorithm
•
مشاكل
Hill Climbing Algorithm
•
استخدامات
Hill Climbing Algorithm
4. Hill Climbing Algorithm :
• Hill Climbing is a heuristic search used for mathematical optimization problems in the field of
Artificial Intelligence.
• Given a large set of inputs and a good heuristic function, it tries to find a sufficiently good solution
to the problem. This solution may not be the global optimal maximum.
• In the above definition, mathematical optimization problems imply that hill-climbing solves the
problems where we need to maximize or minimize a given real function by choosing values from
the given inputs. Example-Travelling salesman problem where we need to minimize the distance
traveled by the salesman.
• ‘Heuristic search’ means that this search algorithm may not find the optimal solution to the
problem. However, it will give a good solution in a reasonable time.
• A heuristic function is a function that will rank all the possible alternatives at any branching step
in the search algorithm based on the available information. It helps the algorithm to select the best
route out of possible routes.
6. • This algorithm has a node that comprises two parts: state and value.
It begins with a non-optimal state (the hill’s base) and upgrades this
state until a certain precondition is met. The heuristic function is used
as the basis for this precondition. The process of continuous
improvement of the current state of iteration can be termed as
climbing. This explains why the algorithm is termed as a hill-climbing
algorithm.
• A hill-climbing algorithm’s objective is to attain an optimal state that
is an upgrade of the existing state. When the current state is
improved, the algorithm will perform further incremental changes to
the improved state. This process will continue until a peak solution is
achieved. The peak state cannot undergo further improvements.
8. Applications of hill climbing algorithm
The hill-climbing algorithm can be applied in the following areas:
• Marketing
A hill-climbing algorithm can help a marketing manager to develop the best marketing plans. This algorithm is
widely used in solving Traveling-Salesman problems. It can help by optimizing the distance covered and
improving the travel time of sales team members. The algorithm helps establish the local minima efficiently.
• Robotics
Hill climbing is useful in the effective operation of robotics. It enhances the coordination of different systems
and components in robots.
• Job Scheduling
The hill climbing algorithm has also been applied in job scheduling. This is a process in which system resources
are allocated to different tasks within a computer system. Job scheduling is achieved through the migration of
jobs from one node to a neighboring node. A hill-climbing technique helps establish the right migration route
9. Hill Climbing algorithm Features
1. Variant of generating and test algorithm:
It is a variant of generating and testing algorithms. The generate and test algorithm is as
follows :
• Generate possible solutions.
• Test to see if this is the expected solution.
• If the solution has been found quit else go to step 1.
• Hence we call Hill climbing a variant of generating and test algorithm as it takes the
feedback from the test procedure. Then this feedback is utilized by the generator in
deciding the next move in the search space.
2. Uses the Greedy approach:
• At any point in state space, the search moves in that direction only which optimizes the
cost of function with the hope of finding the optimal solution at the end.
11. State Space diagram for Hill Climbing
• The state-space diagram is a graphical representation of the set of
states our search algorithm can reach vs the value of our objective
function(the function which we wish to maximize).
• X-axis: denotes the state space ie states or configuration our
algorithm may reach.
• Y-axis: denotes the values of objective function corresponding to a
particular state.
• The best solution will be a state space where the objective function
has a maximum value(global maximum).
13. •Local maximum: It is a state which is better than its
neighboring state however there exists a state which is
better than it(global maximum). This state is better
because here the value of the objective function is higher
than its neighbors.
•Global maximum: It is the best possible state in the
state space diagram. This is because, at this stage, the
objective function has the highest value.
•Plateau/flat local maximum: It is a flat region of state
space where neighboring states have the same value.
•Ridge: It is a region that is higher than its neighbors but
itself has a slope. It is a special kind of local maximum.
•Current state: The region of the state space diagram
where we are currently present during the search.
•Shoulder: It is a plateau that has an uphill edge
15. Types of Hill Climbing
1. Simple Hill climbing:
It examines the neighboring nodes one by one and selects the first neighboring node which
optimizes the current cost as the next node.
Algorithm for Simple Hill climbing :
• Evaluate the initial state. If it is a goal state then stop and return success. Otherwise, make the
initial state as the current state.
• Loop until the solution state is found or there are no new operators present which can be
applied to the current state.
• Select a state that has not been yet applied to the current state and apply it to produce a new
state.
• Perform these to evaluate the new state.
• If the current state is a goal state, then stop and return success.
• If it is better than the current state, then make it the current state and proceed further.
• If it is not better than the current state, then continue in the loop until a solution is found.
• Exit from the function.
17. 2. Steepest-Ascent Hill climbing:
It first examines all the neighboring nodes and then selects the node closest to the solution state
as of the next node.
Algorithm for Steepest Ascent Hill climbing :
• Evaluate the initial state. If it is a goal state then stop and return success. Otherwise, make the
initial state as the current state.
• Repeat these steps until a solution is found or the current state does not change
• Select a state that has not been yet applied to the current state.
• Initialize a new ‘best state’ equal to the current state and apply it to produce a new state.
• Perform these to evaluate the new state
• If the current state is a goal state, then stop and return success.
• If it is better than the best state, then make it the best state else continue the loop with
another new state.
• Make the best state as the current state and go to Step 2 of the second point.
• Exit from the function.
19. 3. Stochastic hill climbing:
• It does not examine all the neighboring nodes before deciding which node to
select. It just selects a neighboring node at random and decides (based on the
amount of improvement in that neighbor) whether to move to that neighbor or
to examine another.
• Evaluate the initial state. If it is a goal state then stop and return success.
Otherwise, make the initial state the current state.
• Repeat these steps until a solution is found or the current state does not
change.
• Select a state that has not been yet applied to the current state.
• Apply the successor function to the current state and generate all the
neighbor states.
• Among the generated neighbor states which are better than the current state
choose a state randomly (or based on some probability function).
• If the chosen state is the goal state, then return success, else make it the
current state and repeat step 2 of the second point.
• Exit from the function.
21. Problems in different regions in Hill climbing
Hill climbing cannot reach the optimal/best state(global maximum) if it enters any of the following regions :
• Local maximum: At a local maximum all neighboring states have a value that is worse than the current
state. Since hill-climbing uses a greedy approach, it will not move to the worse state and terminate itself. The
process will end even though a better solution may exist.
• To overcome the local maximum problem: Utilize the backtracking technique. Maintain a list of visited
states. If the search reaches an undesirable state, it can backtrack to the previous configuration and explore a
new path.
• Plateau: On the plateau, all neighbors have the same value. Hence, it is not possible to select the best
direction.
• To overcome plateaus: Make a big jump. Randomly select a state far away from the current state. Chances
are that we will land in a non-plateau region.
• Ridge: Any point on a ridge can look like a peak because movement in all possible directions is downward.
Hence the algorithm stops when it reaches this state.
• To overcome Ridge: In this kind of obstacle, use two or more rules before testing. It implies moving in
several directions at once.
22. Plateau
• In this region, the values
attained by the neighboring
states are the same. This
makes it difficult for the
algorithm to choose the best
direction.
• This challenge can be
overcome by taking a huge
jump that will lead you to a
non-plateau space.
23. Ridge
• The hill-climbing algorithm
may terminate itself when it
reaches a ridge. This is
because the peak of the ridge
is followed by downward
movement rather than upward
movement.
• This impediment can be solved
by going in different directions
at once.
25. Applications of hill climbing algorithm
The hill-climbing algorithm can be applied in the following areas:
• Marketing
A hill-climbing algorithm can help a marketing manager to develop the best marketing plans. This algorithm is
widely used in solving Traveling-Salesman problems. It can help by optimizing the distance covered and
improving the travel time of sales team members. The algorithm helps establish the local minima efficiently.
• Robotics
Hill climbing is useful in the effective operation of robotics. It enhances the coordination of different systems
and components in robots.
• Job Scheduling
The hill climbing algorithm has also been applied in job scheduling. This is a process in which system resources
are allocated to different tasks within a computer system. Job scheduling is achieved through the migration of
jobs from one node to a neighboring node. A hill-climbing technique helps establish the right migration route
27. Conclusion
• Hill climbing is a very resourceful technique used in solving huge
computational problems. It can help establish the best solution for
problems. This technique has the potential of revolutionizing
optimization within artificial intelligence.
• In the future, technological advancement to the hill climbing
technique will solve diverse and unique optimization problems with
better advanced features