State Space Analysis - PowerPoint PPT Presentation

1 / 34
About This Presentation
Title:

State Space Analysis

Description:

Heuristic. from the Greek verb heuriskein 'to ... Which heuristic is better. h2 ... time depends on heuristic. if # values f can take on is small, then good ... – PowerPoint PPT presentation

Number of Views:492
Avg rating:3.0/5.0
Slides: 35
Provided by: kathy203
Category:

less

Transcript and Presenter's Notes

Title: State Space Analysis


1
State Space Analysis
  • State a suitable representation for the problem
    state
  • State what the initial and final states are in
    this representation
  • State the available operators for getting from
    one state to another, giving any conditions on
    when they may be applied

2
Room Navigation
  • Goal Find a path from Room A to H

A
A B C D E F G H I J K L
E
B
I
C
F
J
D
K
H
G
L
3
Example Blocks World
  • Put ltblock name 1gt on ltblock name 2gt
  • Constraints
  • can only move 1 block at a time
  • blocks must be clear to be moved

Goal Put C on E
A
B
D
C
E
4
Blocks World Operators
  • MOVE moves a block from one location to another
    by moving the hand
  • preconditions both blocks must be clear
  • CLEAR moves the block above a block to the table
  • preconditions block above current block must be
    clear

5
Reasoning Process
  • Each operator has preconditions
  • Preconditions can be met by other operators

6
Example
Goal Put C on E
A
B
D
C
E
  • Move(C, E)
  • Clear(C)
  • Move(B, Table)
  • Clear(B)
  • Move(A, Table)
  • finish Move(B, Table)
  • Clear(E)
  • Move(D, Table)
  • finish Move(C, E)

7
Space/Time requirements (Search)
  • branching factor b 10, depth d
  • Assume 1000 nodes can be goal-checked and
    expanded per second, and a node needs 100 bytes
    of storage.
  • Breadth-first search
  • Depth-first search for depth 12 space
    12kilobytes

8
More Blind Search methods
  • Depth-limited Search
  • Iterative Deepening Search
  • Bidirectional Search

9
Depth-limited search
  • Impose a cutoff on the maximum depth of a path
  • if depth set appropriately (e.g. of cities - 1)
  • guaranteed to find a solution, but not to find
    the shortest solution
  • if depth too small
  • wont find a solution at all

10
Iterative deepening search
  • How to pick a good limit?
  • pick it by solving the problem at all depths
  • Explore the space doing limited depth-first
    search at depth 0, then 1, then 2, . . .
  • Wasteful?
  • space used is like depth-first search
  • time is less of a problem and most of the nodes
    are at the bottom of the tree, so actual number
    re-opened is relatively small

11
Bidirectional search
  • Simultaneously search forward from the start and
    backward from the goal, stopping when they meet.
  • Properties
  • if branching factor is b in both directions, only
    need to explore half the depth
  • b 10, d 6
  • breadth-first 1,111,111 nodes
  • bidirectional 2,222 nodes
  • needs reversible operators or easy way to
    calculate predecessors
  • works best with 1 goal state, but can work with
    multiple if it is a finite set
  • needs efficient way to check to see if a node
    already exists
  • what kind of search does each half do?

12
Heuristic
  • from the Greek verb heuriskein
  • to find to discover
  • Archmides supposedly said Heureka (I have found
    it) after discover the principle of flotation in
    his bath
  • History
  • 1957 used to refer to the study of
    problem-solving techniques (particularly for
    mathematics)
  • 1963 used to be something that is not an
    algorithm (A process that may solve a given
    problem, but offers no guarantee of doing so, is
    called a heuristic for that problem
  • rule of thumb
  • now refers to any technique that improves the
    average-case performance on a problem-solving task

13
Optimal Searches (Ch. 4)
  • Goal find optimal solution
  • Methods
  • branch and bound
  • greedy search
  • A

14
Branch-and-Bound (Uniform Cost)
  • Keep track of all partial paths extend shortest
    until goal is found
  • Continue expanding partial paths whose length is
    less than the complete path already found
  • Why? If always expand just the shortest, isnt
    the first one found certain to be the shortest
    overall?

15
Sample problem city path
  • Salesman must get from S to G

4
4
3
5
5
4
3
4
2
  • S-A-D-E-F-G costs 35243 17
  • S-D-E-F-G costs 4243 13
  • S-A-B-E-F-G costs 34543 19

16
S
D 4
A 3
B 7
D 8
A 9
E 6
S
D 4
A 3
B 7
D 8
A 9
E 6
C 11
E 12
B 11
F 10
17
S
D 4
A 3
B 7
D 8
A 9
E 6
C 11
E 12
E 10
B 13
B 11
F 10
18
S
D 4
A 3
B 7
D 8
A 9
E 6
C 11
E 12
E 10
B 13
B 11
F 10
B 15
F 14
G 13
19
S
D 4
A 3
B 7
D 8
A 9
E 6
C 11 deadend
E 12
E 10
B 13
B 11
F 10
B 15
F 14
C 15
A 15
G 13
D 14
F 16
20
Greedy Search
  • There is a function to estimate of distance to
    goal
  • Expand node with lowest estimate
  • Note doesnt take into account cost of path so
    far
  • Can have problems if redundancies arent detected

21
Combine previous 2 methods
  • Know cost of path already constructed
  • Have a function to estimate dist. to goal
  • characteristics of estimate important
  • if perfect, great
  • if overestimate, may put searcher off the path
    altogether
  • if underestimate, may cause some waste but wont
    eliminate best solution
  • stop when all partial paths have estimates longer
    than solution already found

22
Sample problem city path
  • Salesman must get from S to G

4
4
3
5
5
4
3
4
2
  • S-A-D-E-F-G costs 35243 17
  • S-D-E-F-G costs 4243 13
  • S-A-B-E-F-G costs 34543 19

23
Example
  • Route planning
  • straight line distance on map is always an
    underestimate (or a perfect estimate)

S
D 4 8.9 12.9
A 3 10.4 13.4
A 910.4 19.4
E 66.9 12.9
B 11 6.717.7
F 103 13
24
S
D 4 8.9 12.9
A 3 10.4 13.4
A 910.4 19.4
E 66.9 12.9
B 11 6.717.7
F 103 13
G 13
25
Redundant Partial Paths
  • The best way through a particular, intermediate
    place is the best way to it from the starting
    place, followed by the best way from it to the
    goal. There is no neeed to look at any other
    paths to or from the intermediate
    place.
  • Dynamic Programming Principle

S
D 4
A 3
B 7
D 8
No reason to expand this
26
A Algorithm
  • Combination of methods
  • Branch and Bound
  • Cost estimate (underestimate)
  • Properties
  • optimal
  • complete
  • number of nodes exponential in length of solution
    (space problem, also time)

27
Admissible Heuristic
  • heuristic function that never overestimates the
    cost to reach the goal
  • result estimated cost of a path at any point
    deeper in the tree never increases - Monotonicity

28
Example 8-puzzle
  • Slide tiles horizontally or vertically into space
    until tiles are in desired order
  • Typical solution 20 steps
  • Branching factor about 3
  • nodes (exhaustive) 320 3.5x109
  • different states 9! 362,880

29
Possible Heuristics
  • h1 - the number of tiles that are in the wrong
    position
  • in example, h1 7
  • admissible since each out of place tile must be
    moved at least once
  • h2 - the sum of the distances (horizontal and
    vertical) of the tiles from their goal positions
  • city block distance, Manhattan distance
  • admissible since any move can only move one tile
    one step closer to the goal
  • in example, h2 232420218

30
Which heuristic is better
  • h2
  • for every node n in a configuration c, h2(n) gt
    h1(n) therefore h2(c) gt h1(c)
  • h2 is said to DOMINATE h1
  • A using h2 will expand fewer nodes on average
    than A using h1

31
How to find heuristics?
  • Find an actual estimate to a relaxed problem
  • If a tile could move anywhere, then h1 would be
    accurate
  • If a tile could move into an adjacent square
    whether occupied or not, then h2 would be accurate

32
Memory Bounded Search
  • A can still take lots of memory
  • Try iterative deepening A (IDA)
  • each search is a depth-first search using an
    f-cost limit (rather than a depth limit)
  • Properties
  • complete, optimal (like A)
  • space requirement is proportional to the longest
    path (e.g. bd)
  • time depends on heuristic
  • if values f can take on is small, then good
  • if values f can take on is large, N2 where N is
    the number of iterations
  • restrict values of f differences of a fixed-cost
    amount c
  • solutions can be worse than optimal by at most c

33
SMA (Simplified Memory-Bounded A)
  • IDA only remembers current f-cost and doesnt
    retain any other history so SMA
  • utilize whatever memory is available
  • avoid repeated states as often as possible
  • Properties
  • complete if there is enough memory available to
    store the shallowest solution path
  • optimal if enough memory available to store
    shallowest optimal solution path
  • optimally efficient if enough memory available
    for entire search tree

34
SMA process
  • When expanding
  • if no memory available drop the least-promising
    node
  • remember f-cost in ancestor of node dropped so
    that node isnt regenerated unnecessarily
Write a Comment
User Comments (0)
About PowerShow.com