0% found this document useful (0 votes)
29 views4 pages

I S Unit 2

Intelligent Systems Unit 2 heuristic search algorithms and types

Uploaded by

rajchetna3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views4 pages

I S Unit 2

Intelligent Systems Unit 2 heuristic search algorithms and types

Uploaded by

rajchetna3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

UNIT 2

HEURISTIC SEARCH

heuristic is a technique that is used to solve a problem faster than the classic methods.
These techniques are used to find the approximate solution of a problem when classical
methods do not. Heuristics are said to be the problem-solving techniques that result in
practical and quick solutions.

Heuristics are strategies that are derived from past experience with similar problems.
Heuristics use practical methods and shortcuts used to produce the solutions that may or
may not be optimal, but those solutions are sufficient in a given limited timeframe.

Why do we need heuristics?

Heuristics are used in situations in which there is the requirement of a short-term solution. On
facing complex situations with limited resources and time, Heuristics can help the companies to
make quick decisions by shortcuts and approximated calculations. Most of the heuristic
methods involve mental shortcuts to make decisions on past experiences.

heuristic method might not always provide us the finest solution, but it is assured that it
helps us find a good solution in a reasonable time.

Based on context, there can be different heuristic methods that correlate with the
problem's scope. The most common heuristic methods are - trial and error, guesswork,
the process of elimination, historical data analysis. These methods involve simply available
information that is not particular to the problem but is most appropriate. They can include
representative, affect, and availability heuristics.

Best first search (BFS)

s algorithm always chooses the path which appears best at that moment. It is the
combination of depth-first search and breadth-first search algorithms. It lets us to take
the benefit of both algorithms. It uses the heuristic function and search. With the help of
the best-first search, at each step, we can choose the most promising node.
Best first search algorithm:

Step 1: Place the starting node into the OPEN list.

Step 2: If the OPEN list is empty, Stop and return failure.

Step 3: Remove the node n from the OPEN list, which has the lowest value of h(n), and
places it in the CLOSED list.

Step 4: Expand the node n, and generate the successors of node n.

Step 5: Check each successor of node n, and find whether any node is a goal node or not.
If any successor node is the goal node, then return success and stop the search, else
continue to next step.

Step 6: For each successor node, the algorithm checks for evaluation function f(n) and
then check if the node has been in either OPEN or CLOSED list. If the node has not been
in both lists, then add it to the OPEN list.

Step 7: Return to Step 2.

Hill Climbing Algorithm


It is a technique for optimizing the mathematical problems. Hill Climbing is widely used
when a good heuristic is available.

It is a local search algorithm that continuously moves in the direction of increasing


elevation/value to find the mountain's peak or the best solution to the problem. It
terminates when it reaches a peak value where no neighbor has a higher value. Traveling-
salesman Problem is one of the widely discussed examples of the Hill climbing algorithm,
in which we need to minimize the distance traveled by the salesman.

It is also called greedy local search as it only looks to its good immediate neighbor state
and not beyond that. The steps of a simple hill-climbing algorithm are listed below:

Step 1: Evaluate the initial state. If it is the goal state, then return success and Stop.

Step 2: Loop Until a solution is found or there is no new operator left to apply.

Step 3: Select and apply an operator to the current state.

Step 4: Check new state:


If it is a goal state, then return to success and quit.

Else if it is better than the current state, then assign a new state as a current state.

Else if not better than the current state, then return to step2.

Step 5: Exit.

State Space diagram for Hill Climbing

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

Different regions in the State Space Diagram:


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

You might also like