Professional Documents
Culture Documents
Lecture 005 - 006
Lecture 005 - 006
Problem Solving as
Searching – Informed
Search
Informed
Search Strategies
In Today’s
Learning
Lecture
Outcomes
Hill Climbing
Search Beam Search
3
4
Judea Pearl
Heuristic Function
It is denoted by h(n)
Example
6
Heuristic Function
We want a path from Islamabad to Lahore
h(Islamabad) = ManhattanDistance(Islamabad,
Rawalpindi, Gujar khan, Gujranwala, Lahore)
Example
7
8-puzzle
Misplaced Tiles Heuristics is the number of tiles
out of place
8
Euclidean Distance Heuristic
8-Puzzle
9
Manhattan Distance Heuristic
This heuristic sums the distance that the tiles
are out of place
8-Puzzle h(n) = 1 + 1 + 0 + 0 + 0 + 1 + 1 + 2 = 6
10
State space generated in Eucleadian Distance
heuristic search
8-Puzzle
11
State space generated in Eucleadian Distance
heuristic search
8 - Puzzle
12
Best First Search
The algorithm maintains a priority queue of
nodes to be explored
Problem
Formulation
14
Greedy Best First Search
Idea
15
Road Distances in km
Romania
16
17
All options open
Best First
Search
18
19
20
Properties
resembles depth-first search in the way it prefers to
follow a single path all the way to the goal, but will
back up when it hits a dead end
Local maxima:
Once the top of a hill is reached the algorithm
will halt since every possible step leads down
Plateaux:
If the landscape is flat, meaning many states
have the same goodness, algorithm
degenerates to a random walk
Ridges :
If the landscape contains ridges, local
improvements may follow a zigzag path up the
Problems ridge, slowing down the search
27
Foothills: Plateaus
Local
maximum
Ridges
Problems
28
Random-restart hill-climbing
Solution
29
Beam Search
A D
A D
Depth 4) S
A D
Optimization:
ignore leafs B D A E
that are not _C E X X B F
X
goal nodes 10.4 0.0
A _C G
32
Degree = 2 S
9 11
At every level use only 2 A B
best nodes 7.3 8.5 7.1 9
C D E F
7
5.3
G H 5 I J
6 2
4
2.5 0
K L M N
Beam Search
33
Properties
34
Example
36
37
A* Search
38
A* Search
39
A* Search
40 A* on 8-puzzle with h(n) = w(n)
41
42
THANKS!
Any questions?
You can find me at
Facebook/babaryaqoob92
Twitter/byaqoobkhan
43