Lecture 5. Informed Search

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 69

Module 1 : Problem Solving & Scope of AI

1
Topics to be covered

• Informed Search.

• Heuristic Function.

• Heuristic Example : 8-Puzzle Problem.

• Heuristic Search Algorithm.


- Best Search First
- A*
–AO*
- Hill Climbing
- Constraint Satisfaction

2
Amity School of Engineering and Technology

Informed Search

• Informed search tries to reduce the amount of search that must be done by making intelligent choices
for the nodes that are selected for expansion.

• In general this is done using a heuristic function.

3
Amity School of Engineering and Technology

Heuristic Function
• A heuristic function is a function that ranks alternatives in various search algorithms at each
branching step based on the available information (heuristically) in order to make a decision
about which branch to follow during a search.

• Well designed heuristic functions can play an important part inefficiently guiding a search
process toward a solution.

• Sometimes very simple heuristic functions can provide a fairly good estimate of whether a path
is any good or not.

• In other situations, more complex heuristic functions should be employed.

4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Practice Question on A*
Find the path to reach from S to G using A* search.

19
20
21
22
23
Practice Question on AO*
Figure represents an AO graph with the values labeled as follows. The value in a single line circle is
an estimate of cost. The value in a double lined circle, a SOLVED node, is the actual value. Each edge
is labeled with a different cost. What is the value of the root node for the optimal solution for the AO
graph?

24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Practice Question on Graph Coloring
Color following graph for three color red, green, blue with constraints that no adjacent node have same
color.

43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Means-Ends Analysis

Means-Ends Analysis (MEA) is a problem


solving technique used commonly in Artificial
Intelligence (AI) for limiting search in AI
programs
Problem-solving as search
An important aspect of intelligent behavior as studied in AI is goal-based problem
solving, a framework in which the solution of a problem can be described by finding a
sequence of actions that lead to a desirable goal.

A goal-seeking system is supposed to be connected to its outside environment by sensory


channels through which it receives information about the environment and motor
channels through which it acts on the environment.

Ability to attain goals depends on building up associations, simple or complex,


between particular changes in states and particular actions that will bring these
changes about.

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.
Amity School of Engineering and Technology

Thank You

69

You might also like