Professional Documents
Culture Documents
UNIT - 2
UNIT - 2
UNIT - 2
Exhaustive Searches:
Generate and Test,
Breadth First Search,
Depth First Search and DFID
Game Playing:
Mini-Max Search Procedure;
Alpha-Beta Cutoffs;
Additional Refinements.
Q1. What is heuristic function? Mca 2022
Q2. Define ‘intelligent Agent’ #
Q1. which search method takes less memory.
Q2. Explain alpha-beta purning.
Q1. What is game theory ? how is it important in ai?
Q1. What is searching? define blind search. Mca 2021 fifth sem.
Q2. What is heuristic search?
Q1. Explain min-max search.
Q2. Briefly define hill climbing algorithm.
Q1. Explain the AO* algorithm with suitable example.
mca 21
Exhaustive Searches:
Generate and Test,
Breadth First Search,
Breadth-first search is the most common search strategy for traversing a tree or graph.
This algorithm searches breadthwise in a tree or graph, so it is called breadth-first
search.
BFS algorithm starts searching from the root node of the tree and expands all
successor node at the current level before moving to nodes of next level.
BFS needs lots of time if the solution is far away from the root node.
It requires lots of memory since each level of the tree must be saved into memory to
expand the next level.
Depth First Search and DFID
Depth-first search isa recursive algorithm for traversing a tree or graph data structure.
It is called the depth-first search because it starts from the root node and follows each
path to its greatest depth node before moving to the next path.
It takes less time to reach to the goal node than BFS algorithm (if it traverses in the
right path).
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.
Branch and Bounce technique;
Branch and
bound
What is Branch and bound?
Branch and bound is one of
the techniques used for
problem solving. It is
similar to the
backtracking since it also
uses the state space tree. It
is used for solving the
optimization
problems and minimization
problems. If we have given a
maximization problem then we
can
convert it using the Branch
and bound technique by
simply converting the
problem into a
maximization problem
Branch and
bound
What is Branch and bound?
Branch and bound is one of
the techniques used for
problem solving. It is
similar to the
backtracking since it also
uses the state space tree. It
is used for solving the
optimization
problems and minimization
problems. If we have given a
maximization problem then we
can
convert it using the Branch
and bound technique by
simply converting the
problem into a
maximization problem
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, i.e.
A* algorithm;
A* search is the most commonly known form of best-first search.
It uses heuristic function h(n), and cost to reach the node n from the start state g(n).
It has combined features of UCS (Uniform Cost Search) and greedy best-first search, by which
it solve the problem efficiently.
A* search algorithm finds the shortest path through the search space using the heuristic
function.
This search algorithm expands less search tree and provides optimal result faster.
A* algorithm is similar to UCS (Uniform Cost Search) except that it uses g(n)+h(n) instead of
g(n).
Advantages:
Disadvantages:
o It does not always produce the shortest path as it mostly based on heuristics
and approximation.
o A* search algorithm has some complexity issues.
o The main drawback of A* is memory requirement as it keeps all generated
nodes in the memory.
AO* algorithm.
AO* algorithm is a best first search algorithm.
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 need to be done to
achieve the main goal, while the OR side of the graph represents the different
methods to achieve the same main goal.
h(n): The estimated cost of traversal from the current state to the goal state.
f(n): The actual cost of traversal from the initial state to the goal state.
Hill climbing algorithm is a local search algorithm which continuously moves in the
direction of increasing value to find the peak of the mountain or best solution to the
problem. It terminates when it reaches a peak value where no neighbour has a higher
value.
Hill climbing algorithm is a technique which is used for optimizing the mathematical
problems.
It is also called greedy local search as it only looks to its good immediate neighbour
state and not beyond that.
A node of hill climbing algorithm has two components which are state and value.
This algorithm examines the neighbouring nodes one by one and select the
first neighbouring node which optimize the current cost as the next node.
This algorithm examines all the neighbouring nodes of the current state
and selects one neighbour node which is closest to the goal state.
3. Stochastic hill climbing:
Stochastic hill climbing does not examine for all its neighbour before
moving. Rather, this search algorithm selects one neighbour node at
random and decides whether to choose it as a current state or examine
another state.
A CPS in ai involves a set of variables, a domain for each variable, and a set of
constraints that outline the possible combinations of values for these
variables.
The goal is find a value for each variable such that all the constraints are
satisfied.
Basic Components of CSP
The basic components of CSPs are:
Game Playing:
Game playing is a popular application of ai that involves the development of
computer programs to play games, such as chess, checkers. Or Go.
The goal of game playing in ai is to develop algorithms that can learn how to
play games and make decision that will lead to winning outcomes.
There are two main approaches to game playing in ai, rule -based systems and
machine learning-based systems.
1. Rule-based systems use a set of fixed rules to play the game.
2. Machine learning-based systems use algorithms to learn from
experience and make decisions based on that experience.
Mini-Max Search Procedure;
o Min-Max algorithm is mostly used for game playing in AI. Such as Chess,
Checkers, tic-tac-toe, go, and various tow-players game. This Algorithm
computes the minimax decision for the current state.
o In this algorithm two players play the game, one is called MAX and other is
called MIN.
o Both the players fight it as the opponent player gets the minimum benefit
while they get the maximum benefit.
o Both Players of the game are opponent of each other, where MAX will select
the maximized value and MIN will select the minimized value.
o The minimax algorithm proceeds all the way down to the terminal node of the
tree, then backtrack the tree as the recursion.
Alpha-Beta Cutoffs;
Its primary purpose is to reduce the number of nodes evaluated in the search
tree, making the search more efficient by pruning branches that cannot possibly
influence the final decision.
Additional Refinements.