04 Problem Solving in AI - Search Algorithms
04 Problem Solving in AI - Search Algorithms
Algorithms
Start: a
Goal: f, j
Successors:
a b, c b d, e
c f, g dh
e i, j fk
Search tree
a
b c
d e f g
h i j k
b c
d e f g
h i j k
b c
d e f g
h i j k
a h’ =1.6
h’ = 0.7 b c h’=0.8
a h’=1.6
h’=0.7 b c h’=0.8
h’=0.7 b c h’=0.8
2 1 6 1 2 3
4 8 8 4
7 5 3 7 6 5
Heuristic for the 8-puzzle
A good heuristic is provided by the total, over numbered
tiles, of the Manhatten distance (md) of a tile from its final
position
md = sum of horizontal and vertical distance to correct position
E.g. in diagram, tile number 6 has to travel distances of 1
to the left and 2 down : md = 1+2
Can be improved by adding a sequence misalignment
factor
A tile in the centre scores 1
A tile on a non-central square scores 0 if it is followed the clockwise
direction by the correct tile in the goal configuration; else its score is 2