ch. 4 informed search supplemental slides for cse 327 prof. jeff heflin
DESCRIPTION
A* on 8-puzzle f=0+3=3 f=1+3=4 f=2+4=6f=2+2=4f=2+3=5f=2+4=6 f=3+3=6 f=3+1=4 f=4+2=6f=4+0= Heuristic = H 1 Whether or not this node is expanded depends on how you break ties. It could be expanded at any time or not at all.TRANSCRIPT
Ch. 4 – Informed Search
Supplemental slides for CSE 327Prof. Jeff Heflin
A* Example• Use A* to solve the 8-puzzle:
1 2 34 6 87 5
1 2 34 5 67 8
initial state: goal state:
• Choose a heuristic– H1: The number of tiles out of place
– H2: Sum of distances of tiles from goal positions
• Ignore moves that return you to the previous state
path cost is the total number of moves made
A* on 8-puzzle1 2 34 6 87 5
1 2 34 67 5 8
1 2 34 6 87 5
1 24 6 37 5 8
1 2 34 67 5 8
1 2 34 87 6 5
1 2 34 6 8
7 5
1 34 2 67 5 8
1 2 34 6
7 5 8
1 2 34 5 67 8
1 2 34 5 6 7 8
1 2 34 5 67 8
f=0+3=3
f=1+3=4 f=1+3=4
f=2+4=6 f=2+2=4 f=2+3=5 f=2+4=6
f=3+3=6 f=3+3=6 f=3+1=4
f=4+2=6 f=4+0=4
1
2 3
4
5
6
Heuristic = H1
Whether or not this node is expanded depends on how you break ties. It could be expanded at any time or not at all.
A* on 8-puzzle1 2 34 6 87 5
1 2 34 67 5 8
1 2 34 6 87 5
1 24 6 37 5 8
1 2 34 67 5 8
1 34 2 67 5 8
1 2 34 6
7 5 8
1 2 34 5 67 8
1 2 34 5 6 7 8
1 2 34 5 67 8
f=0+4=4
f=1+3=4 f=1+5=6
f=2+4=6 f=2+2=4
f=3+3=6 f=3+3=6 f=3+1=4
f=4+2=6 f=4+0=4
1
2
3
4
5
Heuristic = H2
Summary of Search Algorithms
type ordering optimal? complete? efficient?
depth-first uninformed LIFO no no if lucky
breadth-first uninformed FIFO yesa yes no
uniform cost uninformed g(n) yesb yesb no
greedy informed h(n) no no usually
A* informed g(n)+h(n) yesc yes yes
a – optimal if step costs are identicalb – optimal and complete if step costs > 0c – optimal if heuristic is admissible