Ch' 3 Search - PowerPoint PPT Presentation

About This Presentation
Title:

Ch' 3 Search

Description:

Ch. 3 Search. Supplemental s for CSE 327. Prof. Jeff Heflin ... if Ji = Cj Jj then. Jj' = Jj Ji, Ji'=0. fill-jug-i-from-jug-j. if Jj = Ci Ji then ... – PowerPoint PPT presentation

Number of Views:29
Avg rating:3.0/5.0
Slides: 11
Provided by: JeffH47
Category:
Tags: courses | make | search

less

Transcript and Presenter's Notes

Title: Ch' 3 Search


1
Ch. 3 Search
  • Supplemental slides for CSE 327
  • Prof. Jeff Heflin

2
Problem Solving Agent Algorithm
  • function SIMPLE-PROBLEM-SOLVING-AGENT(percept) r
    eturns an action
  • static seq, an action sequence, initially
    empty state, some description of the current
    world state goal, a goal, initially
    null problem, a problem formulation
  • state ? UPDATE-STATE(state,percept) if seq is
    empty then do goal ? FORMULATE-GOAL(state) pro
    blem ?FORMULATE-PROBLEM(state,goal) seq ?
    SEARCH(problem) action ? FIRST(seq) seq ?
    REST(seq) return action
  • From Figure 3.1, p. 61

3
8-puzzle Successor Function
blank-right
blank-down
blank-left
blank-up
4
8-puzzle Search Tree
initial state
5
Tree Search Algorithm
function TREE-SEARCH(problem,fringe) returns a
solution, or failure fringe ? INSERT(MAKE-NODE(IN
ITIAL-STATEproblem,fringe) loop do if
EMPTY?(fringe) then return failure node ?
REMOVE-FIRST(fringe) if GOAL-TESTproblem
applied to STATEnode succeeds then return
SOLUTION(node) fringe ? INSERT-ALL(EXPAND(node,p
roblem),fringe)
Notes 1. fringe argument should be an empty
queue. The type of the queue (e.g., LIFO, FIFO,
etc.) will affect the order of the search 2.
INITIAL-STATEproblem is just syntax for
accessing an objects data (think
problem.initialState in C/Java) From
Figure 3.9, p. 72
6
Depth-first Search
1
A
not generated
on fringe
2
7
C
B
in memory
deleted
3
8
6
9
D
E
F
G
4
5
H
I
7
Breadth-first Search
1
A
not generated
on fringe
2
3
C
B
in memory
deleted
4
7
6
5
D
E
F
G
8
9
H
I
8
Uniform Cost Search
State space
Search tree
1
10
I
G

g(n)0
I
4
B
5
2
C
3
g(n)4
G
B
g(n)10
not generated
4
3
on fringe
G
g(n)9
C
g(n)7
in memory
deleted
9
Uninformed Search Summary
10
Water Jug Problem
  • state ltJ12, J8, J3gt
  • initial state lt0, 0, 0gt
  • goal test lt1, x, ygt
  • x and y can be any value
  • path cost
  • 1 per solution step?
  • 1 per gallon of water moved?
  • actions/successor function
  • let C1212, C88, C33
  • fill-jug-i
  • if Ji lt Ci then JiCi
  • empty-jug-i-into-jug-j
  • if Ji lt Cj Jj thenJj Jj Ji, Ji0
  • fill-jug-i-from-jug-j
  • if Jj gt Ci Ji thenJj Jj (Ci Ji),
    JiCi
Write a Comment
User Comments (0)
About PowerShow.com