More advanced aspects of search - PowerPoint PPT Presentation

About This Presentation
Title:

More advanced aspects of search

Description:

Title: Constraint propagation Author: Danny De Schreye Last modified by: daniel de schreye Created Date: 8/23/1998 4:27:56 AM Document presentation format – PowerPoint PPT presentation

Number of Views:52
Avg rating:3.0/5.0
Slides: 53
Provided by: Danny183
Category:

less

Transcript and Presenter's Notes

Title: More advanced aspects of search


1
More advanced aspects of search
  • Optimality proof of A
  • Further properties of A
  • Extensions of A
  • Concluding comments

2
Optimality of Aa formal proof
  • Terminology
  • Basic properties of A
  • Termination of A
  • Finds a path
  • Finds the best path

3
A algorithm
1. QUEUE lt-- 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)
4
Terminology and notation
  • Paths p, q,
  • Accumulated cost of a path p cost(p)
  • End node of a path end(p)
  • The best path B S,N,M,,G
  • Subpaths see drawing
  • p SN is a subpath of B
  • assumes that it is an initial part of B

5
Property 1
6
Property 2
During each WHILE-loop
If a subpath of B is selected and removed - all
its extensions are computed, - at least 1 of
these is a subpath of B and has no loop (B has
no loop), - at least 1 subpath of B is added
7
Corollary
For any path p, such that f(p) gt cost(B) p is
never selected during A (and never becomes first
in QUEUE).
Property 1 and Property 2
8
Termination of A
Let d be any natural number gt cost(B) / ?
Let p be any path of length d
9
A returns a path to a goal
On termination, either goal found
empty QUEUE
A returns the best path
Assume it returns B, with cost(B) gt cost(B)
f(B) cost(B) h(B) ? cost(B)
gt cost(B)
10
Other properties of A
  • Classification of which nodes are selected.
  • Heuristic power.
  • Finding the best path to each node
  • Monotonicity restriction

11
Which nodes get selected?
12
A better characterization of the selected nodes
First implication corollary
A does not terminate before B becomes the first
in the QUEUE and selects lower f-value paths first
13
General picture
  • Search tree is partitioned in 3 layers

14
The f(p) ? cost(B) layer
  • Is the top layer completely selected?
  • Can it happen that some path p with f(p) ?
    cost(B) never turns up in the QUEUE?
  • YES !

Termination
15
Heuristic power
  • To what extend is A improved by better heuristic
    functions?
  • Can we compare them?

16
Some underestimating heuristics for 8-puzzle
  • h1(T) ? 0

Note in every state T h3(T) ? h2(T) ? h1(T)
17
Heuristic power in 8-puzzle
18
Heuristic power of h
19
Minimal cost pathsMonotonicity

How to avoid redundant path deletion.
20
Minimal-cost paths to nodes.
  • A same node may be found multiple times (possibly
    with different costs )
  • dealt with by redundant path deletion in A
  • Do we detect all redundant paths ?? NO !

21
Monotonicity
  • Definition

A heuristic function h satisfies the monotonicity
restriction if
22
Monotonicity examples
for each arc h(A) ?? h(B) cost(A,B)
  • 8-puzzle h2
  • 8-puzzle h1
  • h1 ? 0

23
Monotonicity the result
IF h satisfies the monotonicity restriction AND
A( h) selects path p THEN cost(p) is the
lowest cost with which we can ever
reach end(p)
  • So
  • under monotonicity each node is reached through
    the best path first !

24
Practical Relevance
IF A( h) later selects a path q with end(q)
end(p) (check via table)
Do NOT extend q, simply remove it from the QUEUE
25
Monotonicity further motivation
  • It is unreasonable that f decreases along a path
  • This throws away information !!
  • We already knew that total cost on this path to
    the goal is at least 9 (knowledge in node A)
  • So how can this estimate be lower in node B ?
  • Cannot happen under Monotonicity !

26
Pathmax
  • a variant of A to enforce monotonicity.
  • Redefine f
  • f (SAB) max( f(SAB) , f (S...A) )
  • Is as if we are working with an h that satisfies
    monotonicity

h(A) f (S...A) - cost (SA) ? f
(SAB) - cost(SA) f (SAB) -
cost(SAB) cost(A,B) h(B)
cost(A,B)
27
Extensions of A
  • Iterated deepening A
  • Simplified Memory-bounded A

28
Iterative-deepening A
29
Memory problems with A
  • A is similar to breadth-first
  • Here 2 extensions of A that improve memory
    usage.

30
Iterative deepening A
How to establish the f-bounds? - initially
f(S) generate all successors record the minimal
f(succ) gt f(S) Continue with minimal f(succ)
instead of f(S)
31
Example
f-limited, f-bound 100
32
Example
f-limited, f-bound 120
33
Example
f-limited, f-bound 125
34
f-limited search
1. QUEUE lt-- path only containing the root
f-bound lt-- ltsome natural numbergt f-new
lt-- ? 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 with f(path) ?
f-bound to front of QUEUE
f-new lt-- minimum of current f-new
and of the minimum of new f-values which
are larger than f-bound 3. IF goal
reached THEN success ELSE report f-new
35
Iterative deepening A
36
Properties of IDA
  • Complete and optimal
  • under the same conditions as for A
  • Memory
  • Let ? be the minimal cost of an arc
  • O( b (cost(B) /?) )
  • Speed
  • depends very strongly on the number of
    f-contours there are !!
  • In the worst case f(p) ? f(q) for every 2
    paths
  • 1 2 . N O(N2)

37
Why is this optimal,even without monotonicity ??
38
Properties practical
  • If there are only a reduced number of different
    contours
  • Else, the gain of the extended f-contour is not
    sufficient to compensate recalculating the
    previous
  • In such cases

39
Simplified Memory-bounded A
40
Simplified Memory-bounded A
  • Fairly complex algorithm.
  • Optimizes A to work within reduced memory.
  • Key idea

(15)
41
Generate children 1 by 1
42
Too long path give up
43
Adjust f-values
better estimate for f(S)
44
SMA an example
(15)
13
12
45
Example continued
15
(15)
(24)
20
13
15
(?)
13
20
(?)
(?)
24
15
46
SMA properties
  • Complete If available memory allows to store
    the shortest path.
  • Optimal If available memory allows to store
    the best path.
  • Otherwise returns the best path that fits in
    memory.
  • Memory Uses whatever memory available.
  • Speed If enough memory to store entire tree
    same as A

47
Concluding comments
  • More on non-optimal methods
  • The optimality Trade-off

48
Non-optimal variants
  • Sometimes non-admissible heuristics desirable
  • Example symmetry
  • but cannot be captured with underestimating h
  • Use non-admissible A.

49
Non-optimal variants (2)
  • Reduce the weight of the cost in f

50
Approaching the complexity
  • Optimal path finding is by nature NP complete !
  • in the worst case (depending on the actual search
    space !) , behave exponential
  • in the average case are polynomial

51
Complexity continued
  • OR, use algorithms that
  • ALWAYS produce solutions in polynomial time
  • in the worst case (actual search space), the
    solution is far form the optimal one
  • in the average case, it is close to the optimal
    one
  • Examples local search, non-admissible A, ? ? 1 .

52
Example traveling salesmanwith minimal cost
  • Assume there are N cities
  • Worst case
  • solution found/ best solution ? log2(N1)/2
  • Average case
  • solution found 20 longer than best
Write a Comment
User Comments (0)
About PowerShow.com