Ch. 4 – Informed Search Supplemental slides for CSE 327 Prof. Jeff Heflin
A* Example Use A* to solve the 8-puzzle: initial state: goal state: Choose a heuristic –H 1 : The number of tiles out of place –H 2 : 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-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.
A* on 8-puzzle f=0+4=4 f=1+3=4f=1+5=6 f=2+4=6f=2+2=4 f=3+3=6 f=3+1=4 f=4+2=6f=4+0= Heuristic = H 2
Summary of Search Algorithms typeorderingoptimal?complete?efficient? depth-firstuninformedLIFOno if lucky breadth-firstuninformedFIFOyes a yesno uniform costuninformedg(n)yes b no greedyinformedh(n)no usually A*informedg(n)+h(n)yes c yes a – optimal if step costs are identical b – optimal and complete if step costs > 0 c – optimal if heuristic is admissible