You are on page 1of 9

This lecture

Lecture 6: Search 5
ŠOther Time and Space Variations of A*
„ Finish off RBFS
Victor R. Lesser
„ SMA*
CMPSCI 683
Fall 2010 „ Anytime A*
„ RTA* (maybe if have time)

V. Lesser; CS683, F08

RBFS - Recursive Best-First Search Algorithm


RBFS - Recursive Best-First Search
Š Mimics best-first search with linear space
Š Similar to recursive depth-first f(10) INF

„ Limits recursion by keeping track of the f-value of the best


f(12) 14 f(14)
alternative path from any ancestor node – one step look-ahead f(16)

„ If current node exceeds this value, recursion unwinds back to


the alternative path – same idea as contour ; Pathmax heuristic; Define contour
guarantee monotonic f limit
„ As recursion unwinds, replaces f-value of node with best f-
value of children
z Allows to remember whether to re-expand path at later time
Defines next highest f-contour
Š Exploits information gathered from previous Recursive search on best successor,

searches about minimum f so as to focus further remember when to backup

searches
V. Lesser; CS683, F08 V. Lesser; CS683, F08
V. Lesser; CS683, F08

RFBS(Sibiu,447/Timiso
ara)

RFBS(Riminicu,415/Fagaras)

All successors above


limit of 415, Back up
value of Pitesti 417 as 447
lowest

447

Avoids going down this past again


unless lowest unexplored f-contour is
417

V. Lesser; CS683, F08 V. Lesser; CS683, F08


RBFS -- Pro’s and Con’s SMA*(Simplified Memory-Bounded A*)

Š More efficient than IDA* and still optimal ŠUses a given amount of memory to remember
„ Best-first Search based on next best f-contour; fewer
regeneration of nodes nodes so that they don’t have to be repeatedly
regenerated
„ Exploit results of search at a specific f-contour by saving next f-
countour associated with a node who successors have been
explored. ŠIt will utilize whatever memory is made
Š Like IDA* still suffers from excessive node regeneration available to it.
Š IDA* and RBFS not good for graphs
ŠIt avoids repeated states as far as its memory
„ Can’t check for repeated states other than those on current path
allows.
Š Both are hard to characterize in terms of expected
time complexity
V. Lesser; CS683, F08 V. Lesser; CS683, F08

SMA*
SMA* Example
• Expand deepest lowest f-cost leaf-node
A
0+12=12
• Best first search on f-cost
10 8
• Update f-cost of nodes whose successors B G
have higher f-cost 10+5=15 8+5=13
10 10 8 16
• Drop shallowest & highest f-cost leaf node C D H I
20+5=25 20+0=20 16+2=18 24+0=24

• remember best forgotten descendant 10 10 8 8


E F J K

• Paths longer than node limit get ∞ cost. 30+5=35 30+0=30 24+0=24 24+5=29

V. Lesser; CS683, F08 V. Lesser; CS683, F08


SMA* Example (3-node limit) SMA* Example (3-node limit) cont.
A A A A
15(15) 15 15(24) 20(24)

A A A A
12 12 13 13(15) G B G B B
24(inf) 15 24 15 20(inf)

B B G G
15 15 13 13 I C D
25
24 20
inf
H
18
Reach goal Regenerate node B, Why don’t
inf remember that there C is not
node I but it we need to
is not the was node with f =15 goal node search
Update A Remember next that had been and it is at
based on lowest cost f node
cheapest so anymore
continue removed, remember max depth after finding
lowest cost f B that is removed
search successor of G has D.
successor?
V. Lesser; CS683, F08 V. Lesser; CS683, F08
f=24

SMA* Analysis Sketch of SMA* Algorithm


Š It is complete, provided the available memory is
sufficient to store the shallowest solution path.
Š It is optimal, if enough memory is available to store the
shallowest optimal solution path. Otherwise, it returns
the best solution (if any) that can be reached with the
available memory.
Š Can keep switching back and forth between a set of
candidate solution paths, only a few of which can fit in
memory (thrashing)
Memory limitations can make a problem intractable wrt time ; parent could have been removed previously

Š With enough memory for the entire tree, same as A*


V. Lesser; CS683, F08
Memory-bounded heuristic search Approaches for Reducing Search Cost
Š IDA* - Iterative-deepening A*
Use f-cost (g+h) as cutoff
„

At each iteration, the cutoff value is the smallest f-cost of any node that
„
Š Staged search involves periodically pruning
exceeded the cutoff on the previous iteration unpromising paths
Š Recursive best-first search (RBFS)
„ SMA* is an example of a staged search
„ Best-first search with only linear space

„ Keep track of the f-value of the best alternative

„ As the recursion unwinds, it forgets the sub-tree and back-up the f-value of
the best leaf as its parent’s f-value. Š Node expansion may be so costly (because the
Š SMA* proceeds like A* branching factor is high or the cost to apply operators
„ Expanding the best leaf until memory is full is high) that exhaustive node expansion is not practical.
„ Drop the worst leaf node, and back-up the value of the forgotten node to its
parent.
„ Complete IF there is any reachable solution.
„ Optimal IF any optimal solution is reachable.
V. Lesser; CS683, F08 V. Lesser; CS683, F08

Heuristic node expansion


Š Use a generator approach to incrementally produce
successors ordered by quality (must have operator-
ordering function);
Real-Time Concerns
Š Limit expansion so that only likely successors are
generated (often called plausible-move generator);
Š Prune unpromising successors immediately
following node expansion;
Š Delay state computation until expansion time when
possible (must be able to compute h without state
only on operator/previous state)

V. Lesser; CS683, F08


Real-time problem solving Simon’s “Bounded-Rationality”
Š Practical and theoretical difficulties: “A theory of rationality that does not give an account of
problem solving in the face of complexity is sadly
„ Agents have limited computational power.
incomplete. It is worse than incomplete; it can be
„ They must react within an acceptable time. seriously misleading by providing “solutions” that are
„ Computation time normally reduces the value of without operational significance”
the result.
„ There is a high degree of uncertainty regarding “The global optimization problem is to find the least-
the rate of progress. cost or best-return decision, net of computational
costs.”
„ The “appropriate” level of deliberation is
situation dependent. -- Herbert Simon, 1958

V. Lesser; CS683, F08 V. Lesser; CS683, F08

Satisficing Satisficing versus Optimizing


Š A Scottish word which means satisfying.
“It appears probable that, however adaptive the
Š Denotes decision making that searches until an behavior of organisms in learning and choice
situations, this adaptiveness falls far short of the
alternative is found that is satisfactory by the
ideal “maximizing” postulated in economic
agent's aspiration level criterion. theory. Evidently, organisms adapt well enough
to ‘satisfice’; they do not, in general, ‘optimize.’
Š Heuristic search as satisficing. ”
Š Formalizing the notion of satisficing.

V. Lesser; CS683, F08 V. Lesser; CS683, F08


Optimizing in the Real-World Anytime algorithms
“In complex real-world situations, optimization Decision
becomes approximate optimization since the Quality
description of the real-world is radically simplified Ideal
until reduced to a degree of complication that the
decision maker can handle. Satisficing seeks Time
simplification in a somewhat different direction,
retaining more of the detail of the real-world situation,
but settling for a satisfactory, rather than approximate- z Ideal (maximal quality in no time)
best, decision.”

z Which approach is preferable?

V. Lesser; CS683, F08 V. Lesser; CS683, F08

Anytime algorithms Anytime algorithms


Decision Decision
Quality Quality
Traditional Anytime Traditional
Ideal Ideal Value

Time Time
Time cost

z Ideal (maximal quality in no time) z Ideal (maximal quality in no time)


z Traditional (quality maximizing) z Traditional (quality maximizing)
z Anytime (utility maximizing)

Value is a combination of quality of solution and


amount of time to arrive at solution
V. Lesser; CS683, F08 V. Lesser; CS683, F08
Anytime A* Weighted evaluation functions
z A* is best first search with f(n) = g(n) + h(n) z Use f’(n) = (1 − w)∗g(n) + w∗h(n)
z Three changes make it an anytime algorithm: z Higher weight on h(n) tends to search deeper.
(1) Use a non-admissible heuristic so that sub-optimal solutions are z Admissible if h(n) is admissible and w ≤ 0.5
found quickly. z Same relative node ordering as admissible heuristic
(2) Continue the search after the first solution is found using it to h(n) >= w∗h(n)/ (1 − w) and f(n) = f’(n)/ (1 − w)
prune the open list ?????
z Otherwise, the search is non-admissible, but it
(3) When the open list is empty, the best solution generated is normally finds solutions much faster.
optimal. z An appropriate w makes possible a tradeoff between
the solution quality and the computation time.
z How to choose a non-admissible heuristic?

V. Lesser; CS683, F08 V. Lesser; CS683, F08

Pruning States in Anytime A*


Pseudocode of Anytime WA*

; keep track of real and


non-admissible f
Incumbent represent best
complete solution so far found
Š For each node, store real f(n) = g(n)+h(n)
; can prune node if it cannot be „ f(n) is the lower bound on the cost of the best solution
better than existing solution
path through n
Š When find solution/goal node n1
„ f(n1) is an upper bound of the cost of the optimal
; if have found shorter path to node update
node and put it back in play
solution
„ Prune all nodes n on the open list that have
real f(n) >= f(n1) ??
Could you prune
; bound error open list after
each new
incumbent ??
V. Lesser; CS683, F08 V. Lesser; CS683, F08
Adjusting W Dynamically*
Suppose you had the following situations, how would you adjust
w.

Š the open list has gotten so large that you are running out of
memory?

Š you are running out of time and you have not yet reached an
answer?

Š there are a number of nodes on the open list whose h value is


very small?

V. Lesser; CS683, F08

You might also like