Best-First Search

Download Report

Transcript Best-First Search

Artificial Intelligence
Lecture
Md. Morshedul Islam
Assistant Professor
Department of Computer Science & Engineering
Bangladesh University of Business and Technology (BUBT)
April 13, 2015
Artificial Intelligence,
Lecturer #13
1
Contents

Informed Search Strategies
Heuristic Information
Hill Climbing Methods
Best-First Search, etc.
April 13, 2015
Artificial Intelligence,
Lecturer #13
2
Informed Search Strategies




Informed search algorithm have some idea of where
to look for solutions.
This uses problem specific knowledge and can find
solutions more efficiently than uninformed search.
These strategies often depend on the use of heuristic
information (heuristic search function).
Heuristic search function h(n), is estimated cost of
the cheapest path from node n to goal node.
April 13, 2015
Artificial Intelligence,
Lecturer #13
3
Heuristic Information (1/2)

Information about the problem:
The nature of the states
The cost of transforming from one state to another
The promise of taking certain path
The characteristics of the goals

This information can often be expressed in the
form of heuristic evaluation function f(n,g), a
function of the node n and/or the goal g.
April 13, 2015
Artificial Intelligence,
Lecturer #13
4
Heuristic Information (2/2)


Heuristics play an important role in search strategies
because of the exponential nature of most problems.
These help to reduce the number of alternatives from
an exponential number to a polynomial number and
thereby obtain a solution in a tolerable amount of
time.
April 13, 2015
Artificial Intelligence,
Lecturer #13
5
Heuristic Search: Example

Traveling salesman problem (Minimal distance tour): n-cities
with path connecting the cities. A tour is any path which,
 begins with some starting city,
 visits each of the other cities exactly once, and
 returns to the starting city.



A simple heuristic for choosing the next city at any point in a
tour is one which picks the nearest unvisited neighbor.
This policy gives no guarantee of an optimal solutions, but its
solution is often good.
Time required for this search is O(n2) [Normally exponential]
April 13, 2015
Artificial Intelligence,
Lecturer #13
6
Hill Climbing Methods (1/2)



Hill climbing is like depth-first searching where the
most promising child is selected for expansion.
This method requires that some information be
available with which to evaluate and order the most
promising choices.
At each point of the search path, a successor node
that appears to lead most quickly to the top of the hill
(goal) is selected for expansion.
April 13, 2015
Artificial Intelligence,
Lecturer #13
7
Hill Climbing Methods (2/2)




When the children have been generated, alternative
choices are evaluated using some type of heuristic
function.
The path that appears most promising is then chosen
and no further reference to the parent or other children
is retained.
This process continues from node to node with
previously expanded nodes being discarded.
It terminates when it reaches a ‘peak’ where no neigh
bor has a higher value.
April 13, 2015
Artificial Intelligence,
Lecturer #13
8
Hill Climbing Methods:
An Example
S
21
16
9
21
19
11
April 13, 2015
28
18
22
20
23
24
23
25
27
Artificial Intelligence,
25
25
Lecturer #13
25
16
25
19
25
9
Hill Climbing Methods:
Advantages & Disadvantages

Advantages:
 Save spaces: The algorithm does not maintain a search tree, so
the current node data structure need only record the state and its
objective function value.

Disadvantages:
 Foothill trap: it occurs when local maxima or picks are found
(Global maximum??).
 Ridge trap: It occurs when several adjoining nodes have higher
values than surrounding nodes.
 Plateau trap: It occurs when all neighboring nodes have the same
values.
April 13, 2015
Artificial Intelligence,
Lecturer #13
10
Best-First Search (1/2)



Uses heuristic information to select most promising
paths to goal node.
Unlike hill climbing, this algorithm retains all
estimates computed for previously generated nodes
and makes its selection based on the best among
them all.
At any point in the search process, best-first moves
forward from the most promising of all the nodes ge
nerated so far.
April 13, 2015
Artificial Intelligence,
Lecturer #13
11
Best-First Search (2/2)
Algorithm





Step-1: Place the starting node s on the queue
Step-2: If the queue is empty, return failure and stop.
Step-3: If the first element on the queue is a goal node g,
return success and stop, Otherwise,
Step-4: Remove first element from the queue, expand it and
compute the estimated goal distances for each child. Place
the children on the queue and arrange all queue elements in
ascending order corresponding to goal distance from the front
of the queue.
Step-5: Return to step 2.
April 13, 2015
Artificial Intelligence,
Lecturer #13
12
Best-First Search: An Example
L1: S20, S22, S28
L2: S35, S36, S38
L3: S40, S45
S
20
15
5
10
g
April 13, 2015
22
16
18
8
2
18
12
8
28
12
Artificial Intelligence,
12
Lecturer #13
20
25
22
15
10
10
5
13
Best-First Search:
Advantages and Disadvantages


Advantages:
 If the evaluation function is accurate, then this will
indeed be the best node.
 Its overcome the problem that occurs in hill climbing
search
Disadvantages:
 If the evaluation function will sometimes off , then this
will lead the search astray.
 It is not optimal
Note: Best-first search known as greedy best-first
search
April 13, 2015
Artificial Intelligence,
Lecturer #13
14
Recommended Textbooks




[Negnevitsky, 2001] M. Negnevitsky “ Artificial Intelligenc
e: A guide to Intelligent Systems”, Pearson Education Limite
d, England, 2002.
[Russel, 2003] S. Russell and P. Norvig Artificial Intelligenc
e: A Modern Approach Prentice Hall, 2003, Second Edition
[Patterson, 1990] D. W. Patterson, “Introduction to Artificial
Intelligence and Expert Systems”, Prentice-Hall Inc., Englew
ood Cliffs, N.J, USA, 1990.
[Minsky, 1974] M. Minsky “A Framework for Representing
Knowledge”, MIT-AI Laboratory Memo 306, 1974.
April 13, 2015
Artificial Intelligence,
Lecturer #13
15
End of Presentation
Questions or Suggestions?
Thanks to all !!!
April 13, 2015
Artificial Intelligence,
Lecturer #13
16