Professional Documents
Culture Documents
Introduction
• In this lecture we will introduce a new method
of search called informed search algorithms
which is based on heuristics
1
Fundamentals of Ar tificial Intelligence
2
Fundamentals of Ar tificial Intelligence
Definitions of Heuristics
• “A rule of thumb, simplification, or
educated guess that reduces or limits the
search for solutions in domains that are
difficult and poorly understood. Unlike
algorithms, heuristics do not guarantee
optimal, or even feasible, solutions and are
often used with no theoretical guarantee”
Web Dictionary Definition
3
Fundamentals of Ar tificial Intelligence
Definitions of Heuristics
• “A rule of thumb or guideline (as opposed to
an invariant procedure). Heuristics may not
always achieve the desired outcome, but they
are extremely valuable to problem-solving
processes ”
Wilson
• “The art of good guessing”
A Dictionary Definition
4
Fundamentals of Ar tificial Intelligence
Notion of Heuristics
• In AI, a heuristic is a function, h(n), that
estimates the best of a node n to continue
search in order to reach a goal
5
Fundamentals of Ar tificial Intelligence
Notion of Heuristics
• Heuristic h(n) has the following properties:
– h(n) = 0 implies that n is a goal node
– h(n) >= 0 for all nodes n
– h(n) = infinity implies that n is a dead end
from which a goal cannot be reached
6
Fundamentals of Ar tificial Intelligence
Notion of Heuristics
• Heuristic is a domain-specific information that
selects the best path to continue searching
along
7
Fundamentals of Ar tificial Intelligence
Examples
• Heuristics used in some games:
8
Fundamentals of Ar tificial Intelligence
Examples
- Blue means the actual cost
- Red means the heuristic value
S
1 5 8
8 A 3 B 5 C
9
Fundamentals of Ar tificial Intelligence
loop do
if no candidates for expansion then return failure
choose node for expansion according to strategy
if node contains goal state then return solution
else expand node and add the resulting nodes search tree
end
10
Fundamentals of Ar tificial Intelligence
11
Fundamentals of Ar tificial Intelligence
Best-First Search
• It combines both breadth and depth search
techniques. Its advantages are:
• In breadth:
– Avoiding getting lost in depth within the tree search
• In depth:
– Solution can be found without visiting all the nodes
Best-first search explores nodes following their
heuristic values (increasing or decreasing order)
12
Fundamentals of Ar tificial Intelligence
Best-First Search
• Strategy
– Use an evaluation function for each node in order
to determine the nearest node to the goal
– Expand the most desirable unexpanded node
• Implementation
– Put successors in decreasing order of desirability
13
Fundamentals of Ar tificial Intelligence
Best-First Search
• Special cases: There are two cases for this
search algorithm
– Greedy search
– A* search
• In this lecture, we will talk about the greedy
search algorithm
• A* search algorithm will be discussed in the
next lecture
14
Fundamentals of Ar tificial Intelligence
Greedy Search
• It is the simplest best-first search strategy
• It heuristic function is as follows:
h(s) = cost estimation for s to the goal
• Greedy search try to minimize the estimated
cost to reach the goal
• The most desirable node will be expanded first
15
Fundamentals of Ar tificial Intelligence
Greedy Search
16
Fundamentals of Ar tificial Intelligence
optimal solution is
h=1 w
the path to goal g
with cost 3 h=0 f
17
Fundamentals of Ar tificial Intelligence
18
Fundamentals of Ar tificial Intelligence
8 S
19
Fundamentals of Ar tificial Intelligence
8 S
1 5 8
9 A 4 B 3 C
20
Fundamentals of Ar tificial Intelligence
8 S
1 5 8
9 A 4 B 3 C
4 5
0 G
21
Fundamentals of Ar tificial Intelligence
• Optimal: No
22