Unit Ii Part 2
Unit Ii Part 2
Informed Search algorithms play a significant role in artificial intelligence. These algorithms
enable more effective and efficient search using heuristic functions to direct the search
process towards a goal state. For example, a heuristic function calculates the cost of moving
from a starting state to a goal state. By employing this assessment, informed search
algorithms can select search paths more likely to lead to the desired state. As a result, the
search process is improved, making it quicker and more accurate for AI systems to make
decisions.
Heuristics function
A heuristic function calculates the cost of moving from a starting state to a goal state. This
function directs the search process in intelligent algorithms like A* search and the best first
search in artificial intelligence. The algorithm can prioritize search paths that are more likely
to lead to the goal state by using the heuristic function, which gives an estimate of how
close a particular state is to the goal state.
Informed search algorithms use two primary categories of heuristic functions: acceptable
and inadmissible. A heuristic function that never overestimates the expense of getting to
the desired state is acceptable. In other words, a valid heuristic function always offers a
lower constraint on the expense of getting to the desired state. Conversely, an unallowable
heuristic function can exaggerate the expense of getting to the objective state, producing
less-than-ideal answers.
On the other hand, the search algorithm might only locate the best solution if the heuristic
function is valid. This is because an unallowable heuristic function may overestimate the
1
expense of getting to the goal state, which would force the search algorithm to consider
less desirable alternatives. However, an invalid heuristic function is helpful in practice since
it can improve search efficiency by pointing the search algorithm toward the desired state.
An informed search algorithm employed in artificial intelligence which expands nodes based
on heuristic values is called a pure heuristic search algorithm. These algorithms use
heuristics, which are shortcuts or general rules of thumb that direct the search process in
the direction of the desired state. In addition, pure heuristic search algorithms use domain-
specific knowledge to increase search efficiency instead of uninformed search algorithms,
which have no prior knowledge of the problem area.
The A* algorithm is one of the most widely used pure heuristic search methods. The cost of
moving from the current state to the objective state is estimated by the A* algorithm using
a heuristic function.
The Best First Search algorithm in artificial intelligence, sometimes called Greedy Search, is
an intelligent search algorithm. Because it uses heuristic functions to choose which path to
explore first, it is known as an informed search. According to this technique, the next node
to be explored is selected based on how close it is to the target. It starts by exploring the
node with the shortest predicted distance.
Greedy Search:
In greedy search, we expand the node closest to the goal node. The “closeness” is
estimated by a heuristic h(x).
Strategy: Expand the node closest to the goal state, i.e. expand the node with a lower h
value.
Example:
Question. Find the path from S to G using greedy search. The heuristic values h of each node
below the name of the node.
2
Solution. Starting from S, we can traverse to A(h=9) or D(h=5). We choose D, as it has the
lower heuristic cost. Now from D, we can move to B(h=4) or E(h=3). We choose E with a
lower heuristic cost. Finally, from E, we go to G(h=0). This entire traversal is shown in the
search tree below, in blue.
a. Eliminate the node from the open list with the shortest calculated distance.
b. Provide the solution if the node is the goal node.
c. Generate the children of the current node.
d. Estimate the children's travel time to the objective after adding them to the open
list.
3. There is only a solution if the open list is empty.
Advantages:
If a decent heuristic function is applied, it finds a solution rapidly.
It can be applied to a variety of issues.
Implementing it is simple.
Disadvantages:
As it only considers the expected distance to the target and not the actual cost of
getting there, it could only sometimes come up with the best solution.
It can become trapped in a local minimum and stop looking for alternate routes.
To perform properly, it needs a good heuristic function.
3
4