19-Lecture 19 - Hurestic Search - Algorithms
19-Lecture 19 - Hurestic Search - Algorithms
Lecture 19
Heuristic Search Algorithms
Procedure Best-First-Search
Begin
1.Identify possible starting states and measure the distance
"Best-First" Search
(f) of their closeness with the goal; Put them in a list 𝐿;
2.While 𝐿 is not empty do
2.1 Begin
2.1 Identify the node n from L that has the minimum
f; If there exist more than one node with minimum f,
select any one of them (say, n) arbitrarily;
2.2 If 𝑛 is the goal then
return n along with the path from the starting node
and exit;
2.3 Else remove 𝑛 from 𝐿 and add all the children of 𝑛 to
the list 𝐿, with their labeled paths from the starting
node;
2.2 End
3. End While;
End.
2
Heuristic Search Algorithms:
3
Heuristic Search Algorithms:
4
Heuristic Search Algorithms:
5
Heuristic Search Algorithms:
6
Heuristic Search Algorithms:
7
Heuristic Search Algorithms:
8
Heuristic Search Algorithms:
9
Heuristic Search Algorithms:
1 2
10
Heuristic Search Algorithms:
1 2
11
Heuristic Search Algorithms:
1 2
12
Heuristic Search Algorithms:
1 2 3 4
13
Heuristic Search Algorithms:
1 2
14
Heuristic Search Algorithms:
1 2 3 5 4
15
Heuristic Search Algorithms:
16
Heuristic Search Algorithms:
17
Heuristic Search Algorithms:
18
Heuristic Search Algorithms:
19
Heuristic Search Algorithms:
20
Heuristic Search Algorithms:
21
Heuristic Search Algorithms:
22
Heuristic Search Algorithms:
Procedure Hill-Climbing
"Hill-Climbing" Search
Begin
1.Identify possible starting states and measure the distance
(𝑓) of their closeness with the goal node; Push them in a
stack according to the ascending order of their 𝑓;
2. Repeat
2.1 Pop stack to get the stack-top element;
2.2 If the stack-top element is the goal, announce it and
exit
2.3 Else push its children into the stack in the ascending
order of their f values;
3.3 Until the stack is empty;
End.
23
Heuristic Search Algorithms:
24
Heuristic Search Algorithms:
25
Heuristic Search Algorithms:
26