Module 2 Updated
Module 2 Updated
Search Algorithms
Contents
Uninformed search Algorithms: Breadth-First Search,
Uniform cost search, Depth-First Search.
Informed search Algorithms: Best First Search, A*, AO*,
Hill Climbing, Generate & Test, Alpha-Beta pruning, Min-
max search.
Introduction
The aim of AI rational agent is to solve a problem without
intervention of the human.
To solve the problem:
1. There is a need to represent a problem. This representation is
called formalization.
2. Agent uses some strategies to solve the problem.
This strategy is searching technique.
Problem formulation
This step defines the problem which will help to understand and
decide the course of action that needs to be considered to achieve
the goal.
Hill climbing
Alpha – beta
Min-max search
pruning
Informed search algorithms
Informed search Algorithms: Best First Search, A*, AO*,
Hill Climbing, Generate & Test, Alpha-Beta pruning, Min-
max search.
Introduction
In uninformed search algorithms, agent looks the entire search space for all possible
solutions of the problem without having any additional knowledge about search
space. Because of this it takes time to get the solution.
But informed search algorithm contains an knowledge such as how far we are from
the goal, path cost, how to reach to goal node, etc. This knowledge help agents to
explore less to the search space and find more efficiently the goal node.
Informed search algorithm uses the idea of heuristic, so it is also called Heuristic
search.
Heuristics function: Heuristic is a function which is used in Informed Search, and
it finds the most promising path. It takes the current state of the agent as its input
and produces the estimation of how close agent is from the goal. The heuristic
method, however, might not always give the best solution, but it guaranteed to find a
good solution in reasonable time. Heuristic function estimates how close a state is to
the goal.
In the informed search:
Best First Search,
A*,
AO*,
Hill Climbing,
Generate & Test,
Alpha-Beta pruning,
Min-max search.
Pure Heuristic Search:
Pure heuristic search is the simplest form of heuristic search
algorithms.
It expands nodes based on their heuristic value.
It maintains two lists, OPEN and CLOSED list.
In the CLOSED list, it places those nodes which have already
expanded and
In the OPEN list, it places nodes which have yet not been
expanded.
Best-first Search Algorithm (Greedy
Search)
Greedy best-first search algorithm always selects the path which
appears best at that moment.
It is the combination of depth-first search and breadth-first search
algorithms.
It uses the heuristic function and search. Best-first search allows us
to take the advantages of both algorithms.
With the help of best-first search, at each step, we can choose the
most promising node. In the best first search algorithm, we expand
the node which is closest to the goal node and the closest cost is
estimated by heuristic function.
3)
• It is the sum of two variables’ values that determines the node it picks at any point
in time.
• At each step, it picks the node with the smallest value of ‘f’ (the sum of ‘g’ and
‘h’) and processes that node/cell.
• ‘g’ is the distance it takes to get to a certain square on the grid from the starting
point, following the path we generated to get there.
• ‘h’ is the heuristic, which is the estimation of the distance it takes to get to the
finish line from that square on the grid.
• Steps:
1.Add start node to list.
2.For all the neighbouring nodes, find the least cost F node.
3.Switch to the closed list. For 8 nodes adjacent to the current node. If the node is not
reachable, ignore it. Else. ...
4.Stop working when you find the destination. It is not possible to find the destination going
through all possible points.
9)
AO* Search Algorithm
• AO* algorithm is a best first search algorithm.