+ All Categories
Home > Documents > AI_Lectures Part 2

AI_Lectures Part 2

Date post: 10-Apr-2018
Category:
Upload: ronak-jain
View: 220 times
Download: 0 times
Share this document with a friend
62
Ajay Prasad, Assistant Professor Dept of CSE, School of Engineering, Sir Padampat Singhania University Part II-Problems, Problem Spaces and Search
Transcript

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 1/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Part II-Problems, Problem

Spaces and Search

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 2/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Contents

• Defining the problem as a State Space Search

• Production Systems

• Control Strategies

• Breadth First Search

• Depth First Search• Heuristic Search

• Problem Characteristics

• Production system characteristics• Issues in the design of search programs

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 3/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

To build a system to solve a problem

1. Define the problem precisely

2. Analyze the problem

3. Isolate and represent the task knowledgethat is necessary to solve the problem

4. Choose the best problem-solving techniquesand apply it to the particular problem.

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 4/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Defining the problem as State Space Search

• The state space representation forms the basis of most of theAI methods.

• Its structure corresponds to the structure of problem solving intwo important ways:

 – It allows for a formal definition of a problem as the need toconvert some given situation into some desired situation using aset of permissible operations.--- state space.

 – It permits us to define the process of solving a particular problemas a combination of known techniques (each represented as arule defining a single step in the space-moves or operators or action) and search, the general technique of exploring the spaceto try to find some path from current state to a goal state.

Search is a very important process in the solution of hard problemsfor which no more direct techniques are available.

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 5/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Example: Playing Chess

• To build a program that could “play chess”, we could first

have to specify the starting position of the chessboard, the rules that define the legal moves, and theboard positions that represent a win for one side or theother.

• In addition, we must make explicit the previously implicitgoal of not only playing the legal game of chess but alsowinning the game, if possible,

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 6/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Playing chess – non AI solution

• The starting position can be described as an 8 by 8 array where eachposition contains a symbol for appropriate piece.

• We can define as our goal the check mate position.

• The legal moves provide the way of getting from initial state to a goalstate.

• They can be described easily as a set of rules consisting of two parts: – A left side that serves as a pattern to be matched against the current board

position. – And a right side that describes the change to be made to reflect the move

• However, this approach leads to large number of rules 10120 boardpositions !!

• Using so many rules poses problems such as: – No person could ever supply a complete set of such rules.

 – No program could easily handle all those rules. Just storing so many rules posesserious difficulties.

Without using state space

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 7/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Defining chess problem as State Space search

• We need to write the rules describing the legal

moves in as general a way as possible.• For example:

 – White pawn at Square( file e, rank 2) AND Square( File e,rank 3) is empty AND Square(file e, rank 4) is empty, then

move the pawn from Square( file e, rank 2) to Square( filee, rank 4).

• In general, the more succinctly we can describe therules we need, the less work we will have to do to

provide them and more efficient will be theprogram.

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 8/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Water Jug Problem

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 9/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Water Jug Problem

• The state space for this problem can be described as

the set of ordered pairs of integers (x, y) such that x =0, 1,2, 3 or 4 and y = 0,1,2 or 3; x represents thenumber of gallons of water in the 4-gallon jug and yrepresents the quantity of water in 3-gallon jug

• The start state is (0,0)

• The goal state is (2,n)

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 10/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Production rules for Water Jug Problem

• The operators to be used to solve the

problem can be described as follows:

Pour water from the 3 –

gallon jug into the 4 –gallon

 jug until the 4-gallon jug is full

(4, y-(4-x))(x,y) if x+y >= 4 and y >07

Empty the 3 gallon jug on theground

(x,0)(x,y) if y >06

Empty the 4 gallon jug(0, y)(x,y) if x>05

Pour some water out of the 3-

gallon jug

(x, y-d)(x,y) if y > 04

Pour some water out of the 4

gallon jug

(x-d, y)(x,y) if x > 03

Fill the 3 gallon jug(x,3)(x,y) if y <32

Fill the 4 gallon jug(4,y)(x,y) if x < 41

DescritpionNext StateCurrent stateSl No

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 11/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Empty the 2 gallons in the 4-

gallon jug on the ground

(0,y)(2,y)12

Pour the 2 gallons from 3-gallon jug into the 4-gallon jug

(2,0)(0,2)11

Pour all the water from the 4-

gallon jug into the 3-gallon jug

(0, x+y)(x, y) if x+y <= 3 and x>010

Pour all the water from the 3-

gallon jug into the 4-gallon jug

(x+y, 0)(x, y) if x+y <=4 and y>09

Pour water from the 4-gallon jug

into the 3-gallon jug until the 3-

gallon jug is full

(x-(3-y), 3)(x, y) if x+y >= 3 and x>08

Production rules for Water Jug Problem

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 12/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

To solve the water jug problem

• Required a control structure thatloops through a simple cycle in

which some rule whose left sidematches the current state ischosen, the appropriate change tothe state is made as described inthe corresponding right side, andthe resulting state is checked tosee if it corresponds to goal state.

• One solution to the water jugproblem

• Shortest such sequence will havea impact on the choice of appropriate mechanism to guidethe search for solution. 9 0r 1120

02

5 or 1224

733

203

930

200

Rule appliedGallons in the

3-gallon jug

Gallons in the

4-gallon jug

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 13/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Formal Description of the problem

1. Define a state space that contains all the possibleconfigurations of the relevant objects.

2. Specify one or more states within that space that describe

possible situations from which the problem solving processmay start ( initial state)

3. Specify one or more states that would be acceptable assolutions to the problem. ( goal states)

4. Specify a set of rules that describe the actions ( operations)

available.

Defining a problem formally

S, S0, G, A:S->S

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 14/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Production Systems

A production system consists of:• A set of rules, each consisting of a left side that

determines the applicability of the rule and a right side that

describes the operation to be performed if that rule isapplied. Pattern: Operation

• One or more knowledge/databases that contain whatever information is appropriate for the particular task. Some partsof the database may be permanent, while other parts of it

may pertain only to the solution of the current problem.• A control strategy that specifies the order in which the

rules will be compared to the database and a way of resolving the conflicts that arise when several rules match atonce.

• A rule applier 

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 15/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

In order to solve a problem we must do

1. Reduce it to state space

2. Search for a path that reaches to G from S0

The process of solving the problem can be modeled as a

production system

Production Systems

9 0r 1120

02

5 or 1224

733

203

930

200

Rule appliedGallons inthe 3-gallon

 jug

Gallons inthe 4-gallon

 jug

Next search/control strategy

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 16/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Few more classical problems!

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 17/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Pegs and Disks problem

We have 3 pegs and 3 disks.

Operators: one may move the topmost disk on any needle to the

topmost position to any other needleIn the goal state all the pegs are in the needle B as shown in the

figure below..

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 18/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

queens problemThe problem is to place 8 queens on a chessboard so that no two queens

are in the same row, column or diagonal

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 19/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

8 puzzleIn the 8-puzzle problem we have a 3×3 square board and 8 numbered

tiles. The board has one blank position. Bocks can be slid to adjacent

blank positions. We can alternatively and equivalently look upon this asthe movement of the blank position up, down, left or right. The objective

of this puzzle is to move the tiles starting from an initial position and

arrive at a given goal configuration.

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 20/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Control Strategies

• How to decide which rule to apply next during the

process of searching for a solution to a problem?• The two requirements of good control strategy are

that

 – it should cause motion.

 – It should be systematic

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 21/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Do until a solution is found or the state space is exhausted.

1. Check the current state

2. Execute allowable actions to find the successor states.

3. Pick one of the new states.4. Check if the new state is a solution state

If it is not, the new state becomes the current state and the process

is repeated

Searching in the state space.

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 22/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Searching in the state space.

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 23/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

1. Completeness: Is the strategy guaranteed to find a solution if one exists?

2. Optimality: Does the solution have low cost or the minimal cost?

3. What is the search cost associated with the time and memory required to

find a solution?

a. Time complexity: Time taken (number of nodes expanded) (worst or 

average case) to find a solution.

b. Space complexity: Space used by the algorithm measured in terms of 

the maximum size of fringe

Evaluating Search strategies

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 24/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Breadth First Search

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 25/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Graphs and trees for state space

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 26/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

BFS illustrated

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 27/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

BFS illustrated

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 28/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

BFS Tree for Water Jug problem

(0,0)

(4,0) (0,3)

(4,3) (0,0) (1,3) (4,3) (0,0) (3,0)

9 0r 112002

5 or 1224

733

203

930

200

Rule appliedGallons in

the 3-gallon

 jug

Gallons in

the 4-gallon

 jug

Exercise: Tag every arc

for the rule applied.

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 29/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Algorithm: Depth First Search

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 30/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

DFS illustrated

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 31/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

DFS illustrated

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 32/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

DFS illustrated

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 33/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

DFS Tree for Water Jug problem

(0,0)

(4,0)

(4,3)

9 0r 112002

5 or 1224

733

203

930

200

Rule appliedGallons in

the 3-gallon

 jug

Gallons in

the 4-gallon

 jug

Exercise: Tag every arc

for the rule applied.

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 34/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Backtracking

• In this search, we pursue a single branch of the tree until ityields a solution or until a decision to terminate the path is

made.• It makes sense to terminate a path if it reaches dead-end,

produces a previous state. In such a state backtracking occurs

• Chronological Backtracking : Order in which steps are undonedepends only on the temporal sequence in which steps wereinitially made.

• Specifically most recent step is always the first to be undone.

• This is also simple backtracking .

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 35/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Advantages of Depth-First Search

• DFS requires less memory since only the nodes on the

current path are stored.

• By chance, DFS may find a solution without examining

much of the search space at all.

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 36/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Advantages of BFS

• BFS will not get trapped exploring a blind alley.

• If there is a solution, BFS is guaranteed to find it.• If there are multiple solutions, then a minimal solution will

be found.

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 37/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Traveling Salesman Problem

• A simple motion causing and systematic control structurecould solve this problem.

• Simply explore all possible paths in the tree and returnthe shortest path.

• If there are N cities, then number of different paths

among them is 1.2….(N-1) or (N-1)!• The time to examine single path is proportional to N

• So the total time required to perform this search isproportional to N!

• For 10 cities, 10! = 3,628,800• This phenomenon is called Combinatorial explosion.

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 38/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Branch and Bound

• Begin generating complete paths, keeping track of the shortestpath found so far.

• Give up exploring any path as soon as its partial lengthbecomes greater than the shortest path found so far.

• Using this algorithm, we are guaranteed to find the shortestpath.

• It still requires exponential time.

• The time it saves depends on the order in which paths areexplored.

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 39/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Heuristic Search

• A Heuristic is a technique that improves the efficiency of asearch process, possibly by sacrificing claims of completeness.

• Heuristics are like tour guides

• They are good to the extent that they point in generallyinteresting directions;

• They are bad to the extent that they may miss points of interest

to particular individuals.• On the average they improve the quality of the paths that areexplored.

• Using Heuristics, we can hope to get good (though possiblynon-optimal ) solutions to hard problems such as a TSP in non

exponential time.• There are good general purpose heuristics that are useful in awide variety of problem domains.

• Special purpose heuristics exploit domain specific knowledge

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 40/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Nearest Neighbor Heuristic

• It works by selecting locally superior alternative ateach step.

• Applying to TSP:1. Arbitrarily select a starting city

2. To select the next city, look at all cities not yet visited andselect the one closest to the current city. Go to next step.

3. Repeat step 2 until all cities have been visited.

 – This procedure executes in time proportional to N2

 – It is possible to prove an upper bound on the error itincurs. This provides reassurance that one is notpaying too high a price in accuracy for speed.

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 41/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Heuristic Function

• This is a function that maps from problem statedescriptions to measures of desirability, usually

represented as numbers. – Which aspects of the problem state are considered,

 – how those aspects are evaluated, and

 – the weights given to individual aspects are chosen in such a waythat

• the value of the heuristic function at a given node in thesearch process gives as good an estimate as possible of whether that node is on the desired path to a solution.

• Well designed heuristic functions can play an importantpart in efficiently guiding a search process toward asolution.

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 42/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Example Simple Heuristic functions

• Chess : The material advantage of our 

side over opponent.• TSP: the sum of distances so far 

• Tic-Tac-Toe: 1 for each row in which wecould win and in we already have one

piece plus 2 for each such row in we have

two pieces

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 43/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

All are varieties of Heuristic Search:

1. Generate and test2. Hill Climbing

3. Best First Search

4. Problem Reduction

5. Constraint Satisfaction

6. Means-ends analysis

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 44/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Problem Characteristics

• In order to choose the most appropriate method for a particular problem, it is necessary to analyze the problem along several keydimensions:

 – Is the problem decomposable into a set of independent smaller or easier sub problems?

 – Can solution steps be ignored or at least undone if they proveunwise?

 – Is the problem’s universe predictable?

 – Is a good solution to the problem obvious without comparison to all

other possible solutions?-(Absolute or relative) – Is the desired solution a state of the world or a path to a state?

 – Is a large amount of knowledge absolutely required to solve theproblem or is knowledge important only to constrain the search?

 – Can a computer that is simply given the problem return the solution or 

will the solution of the problem require interaction between thecomputer and a person?

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 45/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Is the problem Decomposable?

• Whether the problem can be decomposed

into smaller problems?• Using the technique of problem

decomposition, we can often solve very

large problems easily.

Bl k W ld P bl

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 46/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Blocks World Problem

• Following operators

are available:• CLEAR(x) [ block x

has nothing on it]->

ON(x, Table)• CLEAR(x) and

CLEAR(y) ->

ON(x,y) [ put x on y]

C

A B

A

B

C

Start: ON(C,A)

Goal:

ON(B,C) and

ON(A,B)

ON(B,C)

ON(B,C) and ON(A,B)

ON(B,C)

ON(A,B)

CLEAR(A) ON(A,B)

CLEAR(A) ON(A,B)

C S l ti St b i d d ?

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 47/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Can Solution Steps be ignored or undone?

• Suppose we are trying to prove a math theorem. We can prove alemma. If we find the lemma is not of any help, we can still continue.

• 8-puzzle problem

• Chess: A move cannot be taken back.• Important classes of problems: – Ignorable ( theorem proving)

 – Recoverable ( 8-puzzle)

 – Irrecoverable ( Chess)

• The recoverability of a problem plays an important role indetermining the complexity of the control structure necessary for theproblem’s solution. – Ignorable problems can be solved using a simple control structure that

never backtracks

 – Recoverable problems can be solved by a slightly more complicatedcontrol strategy that does sometimes make mistakes

 – Irrecoverable problems will need to be solved by systems thatexpends a great deal of effort making each decision since decision mustbe final. We will require planning .

I th i P di t bl ?

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 48/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Is the universe Predictable?

• Certain Outcome ( ex: 8-puzzle)

• Uncertain Outcome ( ex: Bridge, controlling arobot arm)

• For solving certain outcome problems, openloop approach ( without feedback) will work fine.

• For uncertain-outcome problems, planning canat best generate a sequence of operators thathas a good probability of leading to a solution.

We need to allow for a process of plan revisionto take place.

Is a good solution absolute or relative?

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 49/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Is a good solution absolute or relative?

• Any path problem

• Best path problem

• Any path problems can often be solved in

a reasonable amount of time by usingheuristics that suggest good paths toexplore.

• Best path problems are computationallyharder.

I th l ti t t th?

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 50/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Is the solution a state or a path?

• Examples:

 – Finding a consistent interpretation for the sentence“The bank president ate a dish of pasta salad with the

fork ”. We need to find the interpretation but not the

record of the processing.

 – Water jug : Here it is not sufficient to report that wehave solved , but the path that we found to the state

(2,0). Thus the a statement of a solution to this

problem must be a sequence of operations ( Plan)

that produces the final state.

What is the role of knowledge?

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 51/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

What is the role of knowledge?

• Two examples: – Chess: Knowledge is required to constrain the search for a

solution

 – Newspaper story understanding: Lot of knowledge is requiredeven to be able to recognize a solution.

• Consider a problem of scanning daily newspapers todecide which are supporting the democrats and which aresupporting the republicans in some election. We need lots

of knowledge to answer such questions as: – The names of the candidates in each party

 – The facts that if the major thing you want to see done is havetaxes lowered, you are probably supporting the republicans

 – The fact that if the major thing you want to see done is improvededucation for minority students, you are probably supporting thedemocrats.

 – etc

Does the task require Interaction with a person?

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 52/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Does the task require Interaction with a person?

• The programs require intermediateinteraction with people for additional inputs

and to provided reassurance to the user.• There are two types of programs:

 – Solitary

 – Conversational:

• Decision on using one of theseapproaches will be important in the choiceof problem solving method.

Problem Classification

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 53/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Problem Classification

• There are several broad classes into

which the problems fall. These classescan each be associated with generic

control strategy that is appropriate for 

solving the problems: – Classification : ex: medical diagnostics,

diagnosis of faults in mechanical devices

 – Propose and Refine: ex: design and planning

Production System Characteristics

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 54/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Production System Characteristics

1. Can production systems, like problems, be describedby a set of characteristics that shed some light on howthey can easily be implemented?

2. If so, what relationships are there between problemtypes and the types of production systems best suitedto solving the problems?

• Classes of Production systems: – Monotonic Production System: the application of a rule

never prevents the later application of another rule that couldalso have been applied at the time the first rule was selected.

 – Non-Monotonic Production system

 – Partially commutative Production system: property that if application of a particular sequence of rules transforms state x

to state y, then permutation of those rules allowable, alsotransforms state x into state y.

 – Commutative Production system

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 55/62

Commutative Production system

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 56/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

Commutative Production system

• A partially Commutative production system

has a property that if the application of aparticular sequence of rules transformstate x into state y, then any permutation

of those rules that is allowable, alsotransforms state x into state y.

• A Commutative production system is a

production system that is both monotonicand partially commutative.

Partially Commutative, Monotonic

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 57/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

y ,

• These production systems are useful for solvingignorable problems.

• Example: Theorem Proving• They can be implemented without the ability to backtrack

to previous states when it is discovered that an incorrectpath has been followed.

• This often results in a considerable increase inefficiency, particularly because since the database willnever have to be restored, It is not necessary to keeptrack of where in the search process every change wasmade.

• They are good for problems where things do not change;new things get created.

Non Monotonic, Partially Commutative

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 58/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

, y

• Useful for problems in which changes occur but

can be reversed and in which order of operations is not critical.

• Example: Robot Navigation, 8-puzzle, blocks

world• Suppose the robot has the following ops: go

North (N), go East (E), go South (S), go West

(W). To reach its goal, it does not matter whether the robot executes the N-N-E or N-E-N.

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 59/62

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 60/62

Issues in the design of search programs

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 61/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

• The direction in which to conduct the

search ( forward versus backwardreasoning).

• How to select applicable rules ( Matching)

• How to represent each node of the search

process ( knowledge representation

problem)

Summary

8/8/2019 AI_Lectures Part 2

http://slidepdf.com/reader/full/ailectures-part-2 62/62

Ajay Prasad, Assistant Professor

Dept of CSE, School of Engineering, Sir Padampat Singhania University

y

Four steps for designing a program to solve

a problem:1.Define the problem precisely

2.Analyse the problem

3.Identify and represent the knowledge requiredby the task

4.Choose one or more techniques for problem

solving and apply those techniques to theproblem.


Recommended