Professional Documents
Culture Documents
Heuristic Search
Accumulated Estimated
Cost VS Cost
Uniform Cost search Best first search
Produced by Qiangfu Zhao (2008), All rights reserved © AI Lec04/5
Estimation of the cost
Best first search (e.g. distance to the goal)
• Step 1: Put the initial node x0 and its heuristic value H(x0) to the
open list.
• Step 2: Take a node x from the top of the open list. If the open list is
empty, stop with failure. If x is the target node, stop with success.
• Step 3: Expand x and get a set S of child nodes. Add x to the closed
list.
• Step 4: For each x’ in S but not in the closed list, estimate its
heuristic value H. If x’ is not in the open list, put x’ along with the
edge (x,x’) and H into the open list; otherwise, if H is smaller than
the old value H(x’), update x’ with the new edge and the new
heuristic value.
• Step 5: Sort the open list according to the heuristic values of the
nodes, and return to Step 2.
0 {(0,0),4} --
1 2 1 0
(0,2) (1,2) (2,2) (0,2) (1,2) (2,2)
2 1 1
3 3 2 1
(0,1) (1,1) (2,1) (0,1) (1,1) (2,1)
2 3
5 4 3 2
1
(0,0) (1,0) (2,0) (0,0) (1,0) (2,0)
Min f(x)
s. t. x in D
• All x in D are called feasible solutions, and D is usually
defined by a group of functions as follows:
D={x | gi(x) <= 0, i=1,2,…}
Produced by Qiangfu Zhao (2008), All rights reserved © AI Lec04/18
Various optimization problems
• If the objective function f(x) and all constrain functions
are linear, the problem is a linear programming problem,
and can be solved by using the simplex algorithm.
• If f(x) is quadratic (2nd order) and the constrain functions
are linear, the problem is called a quadratic optimization
problem.
• If f(x) is a convex function, and D is a convex set, we can
easily find the “global optimal” solution.
x2
lx1+(1-l)x2
x1
x1 lx1+(1-l)x2 x2
B 4 C 8 D
3 (14) (10) (2)
2
8 E
A 5 3 3 (0)
(15)
H G F
4 (11) (9) (5)
2 4
• What are the advantage and dis-advantage of the best-first search algorithm, compared with the uniform cost
search algorithm?
• What condition is needed to guarantee the best solution when we use the A* algorithm?
• Write the definitions of a local optimal solution and the global optimal solution.
– Local optimal solution: