Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSE (c) S. Tanimoto, 2002 State-Space Search

Similar presentations


Presentation on theme: "CSE (c) S. Tanimoto, 2002 State-Space Search"— Presentation transcript:

1 CSE 415 -- (c) S. Tanimoto, 2002 State-Space Search
Computers should solve problems. A traditional problem domain for AI is the blocks world. Problem description: Given blocks A, B and C, with C on B, arrange the blocks so that A is on B and B is on C. You may only pick up and move one block at a time. A C B A B C CSE (c) S. Tanimoto, State-Space Search

2 CSE 415 -- (c) S. Tanimoto, 2002 State-Space Search
A state consists of a complete description or snapshot of a situation arrived at during the solution of a problem. Initial state: the starting position or arrangement, prior to any problem-solving actions being taken. Goal state: the final arrangement of elements or pieces that satisfies the requirements for a solution to the problem. CSE (c) S. Tanimoto, State-Space Search

3 CSE 415 -- (c) S. Tanimoto, 2002 State-Space Search
The set of all possible states of the elements or components to be used in solving a problem forms the space of states for the problem. This is known as the state space. CSE (c) S. Tanimoto, State-Space Search

4 CSE 415 -- (c) S. Tanimoto, 2002 State-Space Search
Moves A move is a transition from one state to another. An operator is a partial function that can be applied to a state to produce a move. An operator can serve as a type of move. A sequence of moves that leads from the initial state to a goal state constitutes a solution. CSE (c) S. Tanimoto, State-Space Search

5 CSE 415 -- (c) S. Tanimoto, 2002 State-Space Search
State Representation Possible methods: Board position (for a puzzle or game). List of parameter values. Set of statements in propositional calculus. Set of statements in predicate calculus. B is on the table Ontable(B) C A is on the table Ontable(A) A B C is on B On(C, B) CSE (c) S. Tanimoto, State-Space Search

6 Operator Preconditions
Precondition: A necessary property of a state in which a particular operator can be applied. Example: In checkers, a piece may only move into a square that is vacant. Vacant(place) is a precondition on moving a piece into place. Example: In Chess, a precondition for moving a rook from square A to square B is that all squares between A and B be vacant. (A an B must also be either in the same row or the same column.) CSE (c) S. Tanimoto, State-Space Search

7 The Combinatorial Explosion
Suppose a search process begins with the initial state. Then it considers each of k possible moves. Each of those may have k possible subsequent moves. In order to look n steps ahead, the number of states that must be considered is 1 + k + k kn. For k > 1, this expression grows rapidly as n increase. This is known as the combinatorial explosion. CSE (c) S. Tanimoto, State-Space Search

8 CSE 415 -- (c) S. Tanimoto, 2002 State-Space Search
Search Trees By applying operators from a given state we generate its children or successors. Successors are descendants as are successors of descendants. If we ignore possible equivalent states among descendants, we get a tree structure. Depth-First Search: Examine the nodes of the tree by fully exploring the descendants of a node before trying any siblings of a node. CSE (c) S. Tanimoto, State-Space Search

9 CSE 415 -- (c) S. Tanimoto, 2002 State-Space Search
Graph Search When descendant nodes can be reached with moves via two or more paths, we are really searching a more general graph than a tree. Depth-First Search: Examine the nodes of the graph by fully exploring the “descendants” of a node before trying any “siblings” of a node. CSE (c) S. Tanimoto, State-Space Search

10 Depth-First Search: Iterative Formulation
1. Put the start state on a list OPEN 2. If OPEN is empty, output “DONE” and stop. 3. Select the first state on OPEN and call it S. Delete S from OPEN. Put S on CLOSED. If S is a goal state, output its description 4. Generate the list L of successors of S and delete from L those states already appearing on CLOSED. 5. Delete any members of OPEN that occur on L. Insert all members of L at the front of OPEN. 6. Go to Step 2. CSE (c) S. Tanimoto, State-Space Search

11 Breadth-First Search: Iterative Formulation
1. Put the start state on a list OPEN 2. If OPEN is empty, output “DONE” and stop. 3. Select the first state on OPEN and call it S. Delete S from OPEN. Put S on CLOSED. If S is a goal state, output its description 4. Generate the list L of successors of S and delete from L those states already appearing on CLOSED. 5. Delete any members of OPEN that occur on L. Insert all members of L at the end of OPEN. 6. Go to Step 2. CSE (c) S. Tanimoto, State-Space Search

12 CSE 415 -- (c) S. Tanimoto, 2002 State-Space Search
Best-First Search Similar to Depth-first and breadth-first searches. However, the list OPEN is maintained as a priority queue, with each state s on OPEN having a “heuristic value” f(s) such that the smaller f(s) is, the higher is the priority of that state for expansion. f(s) reflects an estimated “cost” of the state s. It can also be thought of as an estimate of a sort of distance between s and the nearest goal state. e.g., “longitude difference” estimates the distance between two cities. CSE (c) S. Tanimoto, State-Space Search


Download ppt "CSE (c) S. Tanimoto, 2002 State-Space Search"

Similar presentations


Ads by Google