Download presentation
Presentation is loading. Please wait.
1
Introducing Underestimates
OPTIMAL Search When cost of TRAVERSING the path should be minimized (even at expense of more complicated SEARCHING) : Uniform Cost Branch and Bound Introducing Underestimates Path Deletion A*
2
Re-introduce the costs of arcs in the NET
B E C F G S 3 4 5 2 S A D B E C F G 3 2 4 5
3
Uniform cost algorithm = uniformed best-first
3 4 5 2 7 8 9 6 10 11 12 13 At each step, select the node with the lowest accumul-ated cost.
4
Uniform cost algorithm:
1. QUEUE <-- path only containing the root; 2. WHILE QUEUE is not empty AND goal is not reached DO remove the first path from the QUEUE; create new paths (to all children); reject the new paths with loops; add the new paths and sort the entire QUEUE; 3. IF goal reached THEN success; ELSE failure; (BY ACCUMULATED COST)
5
Problem: NOT always optimal!
C 1 5 B 1 2 D 5 10 Uniform cost returns the path with cost 102, while there is a path with cost 25. G 100 E 5 15 F 5 20 5
6
The Branch-and-Bound principle
Use any (complete) search method to find a path. Remove all partial paths that have an accumulated cost larger or equal than the found path. Continue search for the next path. Iterate. 3.5 S B D C G A 5 E 6 First goal reached 2 3 0.5 G X ignore
7
A weak integration of branch and bound in uniform cost:
100 B 5 S A C 1 2 102 Change the termination condition: only terminate when a path to a goal node HAS BECOME THE BEST PATH. F 5 D E 10 15 20 25
8
Optimal Uniform cost version:
1. QUEUE <-- path only containing the root; 2. WHILE QUEUE is not empty AND first path does not reach goal remove the first path from the QUEUE; create new paths (to all children); reject the new paths with loops; add the new paths and sort the entire QUEUE; 3. IF goal reached THEN success; ELSE failure; (by accumulated cost)
9
Example: 3 4 4 7 8 7 8 9 6 7 8 9 11 10 A D S S A D A B D S A B D D A E
F 11 10
10
S A D B 8 E 9 F 11 10 B C E 11 12 S A D B E 9 F 11 10 C 12 D E 10 S A D B E F 11 10 C 12 A B 13 S A D B E F 11 10 C 12 13 E B F 15 14
11
S A D B E F 11 C 12 13 15 14 F G 13 Don’t stop yet! S A D B E F C 11 12 13 15 14 G B A C 15 S A D B E F C 13 15 14 G E F D 14 16 STOP!
12
Properties of extended uniform cost :
Optimal path: If there exists a number > 0, such that every arc has cost , and if the branching factor is finite, Then extended uniform cost finds the optimal path (if one exists). Memory and speed: In the worst case, at least as bad as for breadth-first: needs additional sorting step after each path- expansion ! How to improve ?
13
Extension with heuristic estimates:
Replace the ‘accumulated cost’ in the ‘extended uniform cost’ algorithm by a function: f(path) = cost(path) + h(endpoint_path) where: cost(path) = the accumulated cost of the partial path h(T) = a heuristic estimate of the cost remaining from T to a goal node f(path) = an estimate of the cost of a path extending the current path to reach a goal. +
14
Example: Reconsider the straight-line distance:
B C F 4 3 2 5 Example: Reconsider the straight-line distance: h(T) = the straight-line distance from T to G D E G S A B C F 4 6.7 10.4 11 8.9 6.9 3
15
A D = 13.4 = 12.9 S S A D 13.4 D A E = 19.4 = 12.9 S A D E 13.4 19.4 E B F = 13.0 = 17.7 S A D E B F 13.4 19.4 17.7 STOP! F G = 13.0
16
Estimate-extended Uniform cost algorithm:
1. QUEUE <-- path only containing the root; 2. WHILE QUEUE is not empty AND first path does not reach goal remove the first path from the QUEUE; create new paths (to all children); reject the new paths with loops; add the new paths and sort the entire QUEUE; 3. IF goal reached THEN success; ELSE failure; (by f = cost + h)
17
Optimality With the same condition on the arcs-costs and on the branching factor: IF for all T: h(T) is an UNDERestimate of the remaining cost to a goal node THEN estimate-extended uniform cost is optimal. Intuition: includes underestimated remaining cost S A D E B F 13.4 19.4 17.7 G 13 G with real remaining cost, this path must at least be 13.4
18
More on underestimates:
Example: Real remaining costs 3 2 1 S A D F B E H C G I 1 3 2 1 5 4 Over- estimate If h is NOT an underestimate: S A D F 1+3 1+5 1+4 B 2+2 A B C 3+1 C G 4 Not the optimal path!
19
More on underestimates:
Example: 3 2 S A D F B E H C G I 1 Real remaining costs 1 2 3 Under- estimate If h is an underestimate: S A D F 1+1 1+2 1+3 A B 2+0 C 3+0 B G 4 C 2+1 E 3 ! D E Bad underestimates always get cor- rected by increasing accumulated cost
20
Speed and memory In the worst case: no improvement over ‘branch and bounded extended uniform cost’ Just take h = 0 everywhere. For good heuristic functions: search may expand much less nodes ! See our running example. BUT: the cost of computing such functions may be high Trade-off
21
An orthogonal extension: path deletion
Discard redundant paths: in the ‘branch and bound extended uniform cost’ : S A D 4 3 A B D 7 8 Accumulated distance X discard ! Principle: the minimum distance from S to G via I = (min. dist. from S to I) + (min. dist. from I to G)
22
More precisely: 7 8 9 6 Q P X IF the QUEUE contains: THEN S A D B E
a path P terminating in I, with cost cost_P a path Q containing I, with cost cost_Q cost_P cost_Q THEN delete P
23
A D 3 4 S S A D 4 B 7 8 X S A D B 7 E 9 6 X S A D B 7 E F 11 10 X
24
S A D B E F 10 C 11 12 X S A D B E F C 11 G 13 X Note how this optimization reduces the number of expansions VERY much, compared to ‘branch and bound extended uniform cost’. 5 expansions less !
25
A* search IS: Branch and bound extended, Heuristic Underestimate extended, Redundant path deletion extended, Uniform Cost Search. Note that redundant path deletion is based on the accumulated costs only, so that there is no problem combining it with heuristic underestimates.
26
A* algorithm: 1. QUEUE <-- path only containing the root;
2. WHILE QUEUE is not empty AND first path does not reach goal remove the first path from the QUEUE; create new paths (to all children); reject the new paths with loops; add the new paths and sort the entire QUEUE; IF QUEUE contains path P terminating in I, with cost cost_P, and path Q containing I, with cost cost_Q AND cost_P cost_Q THEN delete P 3. IF goal reached THEN success; ELSE failure; (by f = cost + h)
27
STOP! A D S S A D E X Only difference is here. X X 3 + 10.4 = 13.4
= 12.9 S S A D E 13.4 = 19.4 = 12.9 X Only difference is here. S A D E B F 13.4 = 17.7 = 13.0 X S A D E B F 13.4 17.7 G = 13.0 STOP! X
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.