Professional Documents
Culture Documents
FUNDAMENTALS
LECTURE 6 – SOLVING
PROBLEMS BY SEARCHING
(INFORMED SEARCH)
PART 2
RIGHT, SUCK
LOOP LOOP
10
13
• In Lecture 5, since the heuristic function of best first search is not good
enough, so A* is invented where the heuristic function consider the
cost from each node to the goal and from the starting node to next
node.
14
Move 3 tiles
Move 2 tiles
5 4 1 2 3
Goal
Start 6 1 8 8 4
7 3 2 7 6 5
• Path cost: total number of vertical or horizontal moves
• Two different heuristics:
• h1(n) = number of misplaced tiles (wrong position).
• h2(n) = total Manhattan distance
(number of squares to desired location for each tile)
Goal State
3
3
5 3
1 2 3
8 b 4
7 6 5
Goal State
1 2 3
8 b 4
7 6 5
Goal State
• An A* search with a dominating heuristic function h2 has the property that any
node it expands is also expanded by A* with h1 (Hart, Nillson & Raphale, 1968).
b*=1.79
6≈1+1.79+(1.79)^2
n (successor from
initial state) = 6
d=2
• Proof:
• A* will expand only nodes whose f-values <= C* where C* is an
optimal cost path
• The evaluation function of a goal node along an optimal path equals
C*
• Lemma:
• Anytime before A* terminate, there exists and OPEN node n’ on an
optimal path with f(n’) <= C*
• C* = optimal cost path
34