AI Module 1 Lecture 9
AI Module 1 Lecture 9
B.Tech.(CSE)
Artificial Intelligence (CSE 401)
Learning outcomes
2
Amity School of Engineering and Technology
Alpha-Beta pruning
Amity School of Engineering and Technology
Alpha-Beta Procedure
5
Amity School of Engineering and Technology
• Search is the process of discovery and assembly of sequences of actions that will
lead from a given state to a desired state.
How MEA works?
The means-ends analysis process can be applied recursively for a problem. It is a strategy
to control search in problem-solving. Following are the main Steps which describes the
working of MEA technique for solving a problem.
1.First, evaluate the difference between Initial State and final State.
2.Select the various operators which can be applied for each difference.
3.Apply the operator at each difference, which reduces the difference between the current
state and goal state.
Operator Subgoaling
• In the MEA process, we detect the differences between the current state and goal
state.
• Once these differences occur, then we can apply an operator to reduce the
differences.
• But sometimes it is possible that an operator cannot be applied to the current
state.
• So we create the subproblem of the current state, in which operator can be
applied, such type of backward chaining in which operators are selected, and then
sub goals are set up to establish the preconditions of the operator is
called Operator Subgoaling.
Algorithm for Means-Ends Analysis
Let's we take Current state as CURRENT and Goal State as GOAL, then following are the steps for the MEA
algorithm.
Step 1: Compare CURRENT to GOAL, if there are no differences between both then return Success and Exit.
Step 2: Else, select the most significant difference and reduce it by doing the following steps until the success or failure
occurs.
Select a new operator O which is applicable for the current difference, and if there is no such operator, then signal
failure.
Attempt to apply operator O to CURRENT. Make a description of two states.
i) O-Start, a state in which O’s preconditions are satisfied.
ii) O-Result, the state that would result if O were applied in O-start.
If
(First-Part <------ MEA (CURRENT, O-START)
And
(LAST-Part <----- MEA (O-Result, GOAL), are successful, then signal Success and return the result of
combining FIRST-PART, O, and LAST-PART
Example of Mean-Ends Analysis
In this problem, we need to get the goal state by finding differences between
the initial state and goal state and applying operators.
Question 1: Given an initial state of a 8-puzzle problem and final state to
be reached-
Find the most cost-effective path to reach the final state from initial state
using A* Algorithm. Consider g(n) = Depth of node and h(n) = Number of
misplaced tiles.
Solution:
• Consider g(n) = Depth of node
and h(n) = Number of misplaced
tiles.
• A* Algorithm maintains a tree of
paths originating at the initial state.
• It extends those paths one edge at
a time.
• It continues until final state is
reached.
Question 2: Consider the following graph-
The numbers written on edges represent the distance between the nodes. The numbers written on nodes
represent the heuristic value.
Find the most cost-effective path to reach from start state A to final state J using A* Algorithm.
Solution:
Solution:
Amity School of Engineering and Technology
Thank You