Wa0021.
Wa0021.
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
A* Tree Search:
It is a searching algorithm that is used to find the shortest path between an initial and a
final point.
It is a handy algorithm that is often used for map traversal to find the shortest path to be
taken. A* was initially designed as a graph traversal problem, to help build a robot that can
find its own course. It still remains a widely popular algorithm for graph traversal.
It searches for shorter paths first, thus making it an optimal and complete algorithm. An
optimal algorithm will find the least cost outcome for a problem, while a complete
algorithm finds all the possible outcomes of a problem.
Another aspect that makes A* so powerful is the use of weighted graphs in its
implementation. A weighted graph uses numbers to represent the cost of taking each path
or course of action. This means that the algorithms can take the path with the least cost,
and find the best route in terms of distance and time.
Example:
Question. Find the path to reach from S to G using A* search.
4
Solution. Starting from S, the algorithm computes g(x) + h(x) for all nodes in the fringe at
each step, choosing the node with the lowest sum. The entire work is shown in the table
below.
Note that in the fourth set of iterations, we get two paths with equal summed cost f(x), so
we expand them both in the next set. The path with a lower cost on further expansion is the
chosen path.
S -> A 9 3 12
S -> D 5 2 7
0 4+3=7 7
5
Path: S - > D -> B -> E -> G
Cost: 7
6
4. Bottleneck at the destination: In specific scenarios, the A* algorithm needs to explore
nodes far from the destination before finally reaching the destination region. This the
problem occurs when the heuristic needs to direct the search to the goal early
effectively.
5. Cost Binding: A* faces difficulties when multiple nodes have the same f-value (the sum
of the actual cost and the heuristic cost). The strategy used can affect the optimality and
efficiency of the discovered path. If not handled correctly, it can lead to unnecessary
nodes being explored and slow down the algorithm.
AO* Algorithm
The AO* algorithm, short for "Anytime Optimistic" algorithm, is a search algorithm used in
artificial intelligence and computer science to find the optimal path or solution in a graph or
state space. It is particularly useful in applications like robotics, pathfinding, and planning, where
finding the best possible solution is essential.
Best-first search is what the AO* algorithm does. The AO* method divides any given
difficult problem into a smaller group of problems that are then resolved using the AND-
OR graph concept. AND OR graphs are specialized graphs that are used in problems that can be
divided into smaller problems. The AND side of the graph represents a set of tasks that must be
completed to achieve the main goal, while the OR side of the graph represents different
methods for accomplishing the same main goal.
In the above figure, the buying of a car may be broken down into smaller problems or tasks
that can be accomplished to achieve the main goal in the above figure, which is an example of
a simple AND-OR graph. The other task is to either steal a car that will help us accomplish the
main goal or use your own money to purchase a car that will accomplish the main goal. The
AND symbol is used to indicate the AND part of the graphs, which refers to the need that all
subproblems containing the AND to be resolved before the preceding node or issue may be
finished.
The start state and the target state are already known in the knowledge-
based search strategy known as the AO* algorithm, and the best path is identified by heuristics.
The informed search technique considerably reduces the algorithm’s time complexity. The AO*
algorithm is far more effective in searching AND-OR trees than the A* algorithm.
7
8
9