Download presentation
Presentation is loading. Please wait.
1
State Space Search I Chapter 3
The Basics
2
State Space Problem Space is a Graph Nodes: problem states
Arcs: steps in a solution process One node corresponds to an initial state One node corresponds to a goal state State Space
3
State Space Solution Path
An ordered sequence of nodes from the initial state to the goal state State Space
4
State Space Search Algorithm
Finds a solution path through a state space State Space
5
The Water Jug Problem Die Hard: With a Vengeance (1995)
(Bruce Willis, Samuel L. Jackson, Jeremy Irons) The Water Jug Problem
6
A Slight Variation Suppose we have An empty 4 gallon jug
A source of water A task: put 2 gallons of water in the 4 gallon jug A Slight Variation
7
Representation State Space Node on the graph is an ordered pair (x,y)
X is the contents of the 4 gallon jug Y is the contents of the 3 gallon jug Intitial State: (0,0) Goal State: (2,N) N ε {0, 1, 2, 3} Representation
8
Rules if x < 4, fill x : (x,y) (4,y)
if y < 3, fill y : (x,y) (x,3) if x > 0, empty x : (x,y) (0,y) if y > 0, empty y : (x,y) (x,0) if (x+y) >= 4 and y > 0 : (x,y) (4, y – (4 – x)) fill the 4 gallon jug from the 3 gallon jug (see next slide) if (x+y) >= 3 and x > 0 : (x,y) (x –(3 – y), 3)) Fill the 3 gallon jug from the 4 gallon jug if (x+y) <= 4 and y > 0 : (x,y) (x+y), 0) Pour the 3 gallon jug into the 4 gallon jug if (x+y) <= 3 and x > 0 : (x,y) (0, x + y) pour the 4 gallon jug into the 3 gallon jug Rules
9
5 & 6 Redux if (x+y) >= 4 and y > 0 : (x,y) (4, y – (4 – x))
fill the 4 gallon jug from the 3 gallon jug if (x+y) >= 3 and x > 0 : (x,y) (x –(3 – y), 3)) Fill the 3 gallon jug from the 4 gallon jug 4-X 3-Y If x is the amount in the 4 gallon, 4-X is the amount necessary to fill it. This amount has to be subtracted from the 3 gallon jug (where the water came from). 5 & 6 Redux
10
if (x+y) <= 4 and y > 0 if (x+y) <= 3 and x > 0
Pour the 3 gallon jug into the 4 gallon jug: (x,y) (x+y), 0) if (x+y) <= 3 and x > 0 pour the 4 gallon jug into the 3 gallon jug: (x,y) (0, x + y)
11
Is there a solution path?
Initial State: (0,0) Goal State: (2,N) Is there a solution path?
12
Breadth First Search (0,0) 1 2 (0,3) (4,0) (0,3) 6 7 2 (3,0) 6 (4,3)
(1,3) Breadth First Search etc
13
Depth First (0,0) 1 (4,0) 2 3 (4,3) 7 (0,3) (3,0) 2 (3,3)
Etc. and without visiting already visited states
14
Backward/Forward Chaining
Search can proceed From data to goal From goal to data Either could result in a successful search path, but one or the other might require examining more nodes depending on the circumstances Backward/Forward Chaining
15
Data to goal is called forward chaining for data driven search Goal to data is called backward chaining or goal driven search
16
Examples Water jug was data driven Grandfather problem was goal driven
To make water jug goal driven: Begin at (2,y) Determine how many rules could produce this goal Follow these rules backwards to the start state Examples
17
Reduce the size of the search space
Object
18
if Goal is clearly stated Many rules match the given facts For example: the number of rules that conlude a given theorem is much smaller than the number that may be applied to the entire axiom set Use Goal Driven
19
If Most data is given at the outset Only a few ways to use the facts Difficult to form a goal (i.e., hypothesis) For example: DENDRAL, an expert system that finds molecular structure of organic compounds based on spectrographic data. There are lots of final possibilities, but only a few ways to use the initial data Said another way: initial data constrains search Use Data Driven
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.