linear space best first search

Upload: xml

Post on 30-May-2018

222 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/14/2019 Linear Space Best First Search

    1/38

    Artificial Intelligence 62 (1993) 41-78 41ElsevierARTINT 965

    Linear-space best-f irst searchR i c h a r d E . K o r fCo m puter Science Department, Universi ty o f Cali fornia, L os Angeles, Lo s Angeles,CA 90024, USA

    Received September 1991Revised July 1992

    AbstractKorf, R.E., Linear-space best-first search, Artificial Intelligence 62 (1993) 41-78.Best-first search is a general heuristic search algorithm that always expands next afrontier node of lowest cost. It includes as special cases breadth-first search, Dijkstra'ssingle-source shortest-path algorithm, and the A* algorithm. Its applicability, however,is limited by its exponential memory requirement. Previous approaches to this problem,such as iterative deepening, do not expand nodes in best-first order if the cost functioncan decrease along a path. We present a linear-space best-first search algorithm (RBFS)that always explores new nodes in best-first order, regardless of the cost function,and expands fewer nodes than iterative deepening with a nondecrcasing cost function.On the sliding-tile puzzles, RBFS with a nonmonotonic weighted evaluation functiondramatically reduces computation time with only a small penalty in solution cost. Ingeneral, RBFS reduces the space complexity of best-first search from exponential tolinear, at the cost of only a constant factor in time complexity in our experiments.

    1 . In tr oduc t ion and ove r v i e wH e u r i s t ic s e a r c h i s a g e n e r a l p r o b l e m - s o l v i n g m e c h a n i s m i n a rt if ic i a l in -

    t e ll ig e n c e . T h e s e q u e n c e o f s te p s r e q u i r e d f o r s o lu t i o n o f m o s t A I p r o b l e m si s n o t k n o w n a p r i o r i , b u t m u s t b e d e t e r m i n e d b y a s y s t e m a t i c t r i a l - a n d -e r ro r e x p l o r a t i o n o f a l t er n a t i v e s. A t y p i c a l s i n g le - a g e n t s e a r ch p r o b l e m i st h e T r a v e l i n g S a l e s m a n P r o b l e m ( T S P ) o f f i n d i n g a s h o r te s t t o u r t h a t v is i tse a c h o f a s e t o f c it ie s , a n d r e t u r n s t o t h e s t a r t in g c it y . C la s s ic t o y e x a m p l e si n c l u d e t h e s l i d in g - ti le p u z z le s , c o n s i s t in g o f a f r a m e c o n t a i n i n g n u m b e r e ds q u a r e t il e s, a n d a n e m p t y p o s i t i o n c a l l e d t h e " b l a n k " ( s ee F i g. 1 ) . T h e

    Correspondence to: R.E. Korf, Computer Science Department, University of California, LosAngeles, Los Angeles, CA 90024, USA. Telephone: (310) 206-5383. E-mail: [email protected].

    0004-3702/93/$ 06.00 (~ 1993 -- Elsevier Science Publishers B.V. All fights reserved

  • 8/14/2019 Linear Space Best First Search

    2/38

    42 R.E. Korf

    3 4 56 7 8

    1 2 3 1 2 3 44 5 6 7 5 6 7 8 98 9 1 0 1 1 1 0 1 1 1 2 1 3 i 1 4

    1 2 1 3 1 4 1 5 1 5 1 6 1 7 1 8 1 92 0 2 1 2 2 2 3 2 4

    Fig . 1 . Eight , F i f teen , and T we nty- Fo ur Puzz les .

    l eg a l o p e r a t o r s s l i d e a n y t il e h o r i z o n t a l ly o r v e r t ic a l l y a d j a c e n t t o t h e b l a n ki n t o t h e b l a n k p o s i t i o n . T h e t a s k i s t o r e a r r a n g e t h e t i l e s f r o m s o m e r a n -d o m i n it ia l c o n f i g u r a t i o n i n t o a p a r t i c u l a r g o al c o n f i g u r a t i o n , i n a m i n i m u mn u m b e r o f m o v e s . F i n d i n g o p t i m a l s o l u ti o n s to t h e T S P [9 ] o r sl id i n g -t il ep u z z l e s [ 2 1 ] i s N P - c o m p l e t e .

    A s e a r c h t a s k i s f o r m u l a t e d a s a problem spac e graph. N o d e s r e p r e s e n ts ta t e s o f t h e p r o b l e m , a n d e d g e s r e p r e s e n t le g al m o v e s . A problem instancec o n s i s ts o f a p r o b l e m s p a c e t o g e t h e r w i t h a n i n it ia l s t a te a n d a s e t o f g oa ls ta te s . A s o l u t i o n t o a p r o b l e m i n s t a n c e i s a p a t h f r o m t h e i n i ti a l n o d et o a g o a l n o d e . A l th o u g h m o s t p r o b l e m s p a c e s a r e g ra p h s w i t h c y c le s , f o rs i m p l i c i ty w e r e p r e s e n t t h e m a s t re e s , a t t h e c o s t o f a s in g le s t a te i n t h eg r a p h b e i n g r e p r e s e n t e d b y m u l t i p le n o d e s in t h e t r ee . T h e branching fac tor( b ) o f a s e a r c h t re e i s th e a v e r a g e n u m b e r o f c h i l d re n o f a g i v e n n o d e , w h i let h e m a x i m u m depth (d) o f a p r o b l e m i n s t a n c e i s t h e l e n g t h o f t h e l o n g e stp a t h g e n e r a t e d i n s o lv in g th e p r o b l e m i n st a n ce . T h e t e r m generating a n o d er e f e r s t o c r e a t i n g t h e d a t a s t r u c t u r e r e p r e s e n t i n g th e n o d e , w h i le expandinga n o d e m e a n s t o g e n e r a t e al l o f i ts c h i l d r e n .

    I.I . Best-first searchBest-first search i s a g e n e r a l h e u r i s t i c s e a r c h a l g o r i t h m . I t m a i n t a i n s a nopen l i st c o n t a i n i n g t h e f r o n t i e r n o d e s o f t h e t r e e th a t h a v e b e e n g e n e r a t e d

    b u t n o t y e t e x p a n d e d , a n d a closed l i s t c o n t a i n i n g t h e i n t e r i o r o r e x p a n d e dn o d e s . E v e r y n o d e h a s a n a s s o c i a t e d c o s t v a l u e . A t e a c h c y c l e, a n o p e n n o d eo f m i n i m u m c o s t is e x p a n d e d , g e n e r a t i n g a ll o f i t s c h i ld r e n . T h e c h i l d re na r e e v a l u a t e d b y t h e c o s t f u n c t i o n , i n s e r t e d i n t o t h e o p e n l is t, a n d t h e p a r e n tn o d e i s p l a c e d o n t h e c l o s e d l is t. I n i t i a ll y , tla e o p e n l is t c o n t a i n s j u s t t h ei n i t i a l n o d e , a n d t h e a l g o r i t h m t e r m i n a t e s w h e n a g o a l n o d e i s c h o s e n f o re x p a n s i o n .S p e c i a l c a s e s o f b e s t - f ir s t s e a r c h i n c l u d e b r e a d t h - f i r s t s e a r c h , D i j k s t r a ' ss in g l e - so u r c e s h o r t e s t - p a t h a l g o r i th m , a n d t h e A * a l g o r it h m , d i f f e r in g o n l y i nt h e i r c o s t f u n c t i o n s . I f t h e c o s t o f a n o d e is i ts d e p t h i n t h e t r e e , t h e n b e s t - f ir s ts e a r c h b e c o m e s b r e a d t h - f i r s t s e a r c h , e x p a n d i n g a l l n o d e s a t a g i v e n d e p t hb e f o r e e x p a n d i n g a n y n o d e s a t a g r e a t e r d e p t h . I f ed g e s h a v e d i f f e r e n t co s ts ,

  • 8/14/2019 Linear Space Best First Search

    3/38

    Linear-space best-first search 43a n d t h e c o s t o f a n o d e n i s g ( n ) , t h e s u m o f t h e e d g e c o s ts f r o m t h e r o o t ton o d e n , t h e n b e s t - f i r s t s e a rc h b e c o m e s D i j k s t r a 's s i n g le - so u r c e s h o r t e s t- p a t ha l g o r i t h m [ 5 ] . I f t h e c o s t f u n c t i o n i s f ( n ) = g ( n ) + h ( n ) , w h e r e h ( n )i s a h e u r i s t i c e s t i m a t e o f t h e c o s t o f re a c h i n g a g o a l f r o m n o d e n , t h e nb e s t - f i r s t s e a rc h b e c o m e s t h e A * a lg o r i t h m [ 8 ] . I f h ( n ) n e v e r o v e r e s t i m a t e st h e a c t u a l c o s t f r o m n o d e n t o a g o a l, th e n A * w i ll r e t u r n m i n i m u m - c o s ts o lu t io n s . F o r e x a m p l e , a c o m m o n n o n - o v e r e s t i m a t i n g h e u r is t ic f u n c t i o n f o rt h e s l i d in g - t il e p u z z l e s i s M a n h a t t a n d i s t a n c e : t h e s u m o v e r al l t i le s o f t h en u m b e r o f g r i d u n i t s e a c h t il e is d i s p l a c e d f r o m i ts g o al p o s i ti o n . S i m i l ar ly ,t h e c o s t o f a m i n i m u m s p a n n i n g t re e is a lo w e r b o u n d o n t h e s h o r te s t T S Pt o u r o f a s e t o f c i t ie s . F u r t h e r m o r e , u n d e r c e r t a in c o n d i t io n s , A * g e n e r a t e st h e f e w e s t n o d e s o f a n y a l g o r i t h m g u a r a n t e e d t o f i n d a l o w e s t - c o s t s o l u t i o n[ 4 ] .1 .2 . L i m i t a t i o n s o f b e s t- fi rs t s e a rc h

    T h e m o s t s e r i o u s l im i t a t i o n , h o w e v e r , o f b e s t - f i rs t s ea r c h is i ts m e m o r yr e q u i r e m e n t , w h i c h is p r o p o r t io n a l t o th e n u m b e r o f n o d e s s to r ed . S i n c e b e s t-f i rs t s e a r c h s t o r e s a ll n o d e s i n t h e o p e n o r c l o s e d li st s, i t s s p a c e c o m p l e x i t yis t h e s a m e a s i ts t i m e c o m p l e x i t y , w h i c h i s o f t e n e x p o n e n t i a l. G i v e n t h er a t i o o f m e m o r y t o p r o c e s s in g s p e e d o n c u r r e n t c o m p u t e r s , b e s t- f i rs t s ea r cht y p i c a l ly e x h a u s t s th e a v a i l a b l e m e m o r y i n a m a t t e r o f m i n u t e s , h a l t in g t h ea l g o r it h m . S e c o n d a r y s t o r a g e d o e s n ' t h e lp , s i n c e in o r d e r t o e f fi c i e n tl y d e t e c td u p l i c a t e n o d e s , t h e o p e n a n d c l o s e d l is ts m u s t b e r a n d o m l y a c ce s se d .

    A s e c o n d a r y l i m i t a ti o n i s t h e t i m e r e q u i r e d t o g e n e ra t e n e w n o d e s a n di n s e rt t h e m i n t o t h e o p e n l is t. T o g e n e r a t e e a c h n e w n o d e , b e s t - f ir s t s e a r c hm u s t m a k e a c o m p l e t e c o p y o f t h e p a r e n t s ta te , m o d i f i e d a c c o rd i n g ly . T h i st a k e s t i m e p r o p o r t i o n a l t o th e s i ze o f t h e s ta t e r e p r e s e n ta t i o n . F o r e x a m p l e ,i n t h e s l id i n g - t il e p u z z le s , th i s r e q u i r e s t im e p r o p o r t i o n a l t o t h e n u m b e r o ft i l e s . I n a d d i t i o n , e a c h n e w s t a t e m u s t b e i n s e r t e d i n t o t h e o p e n l i s t i n am a n n e r t h a t f a c i l i ta t e s r e t r i e v i n g a l o w e s t - c o s t o p e n n o d e . I f a h e a p is u s e d ,i n s e r t io n a n d r e t r i e v a l r e q u i r e O ( lo g N ) t i m e p e r n o d e , w h e r e N i s t h e t o t a ln u m b e r o f o p e n n o d e s .1.3 . Overview

    W e w i ll a d d r e s s b o t h t h e s e l i m i t a t io n s i n th i s p a p e r . F i r s t w e r e v i e w ap r e v i o u s a p p r o a c h t o th e s e p r o b l e m s , t h e i t e ra t iv e - d e e p e n i n g a l g o r it h m . F o rs o m e p ro b l e m s , h o w e v e r , i te r a ti v e d e e p e n i n g g e n e ra t e s m a n y m o r e n o d e st h a n b e s t - f i r s t s e a rc h , a n d i f t h e c o s t f u n c t i o n c a n d e c r e a s e a l o n g a p a t h ,t h e n i t e r a t i v e d e e p e n i n g n o l o n g e r e x p a n d s n o d e s i n b e s t - f i r s t o r d e r . W ep r e s e n t a n e w R e c u r s i v e B e s t -F i r s t S e a r c h a lg o r i t h m ( R B F S ) t h a t r u n s i nl i n e a r s p a c e , a n d a l w a y s e x p a n d s n e w n o d e s i n b e s t -f i rs t o r d e r, r e g a rd l e sso f t h e c o s t f u n c t i o n . F o r p e d a g o g i c a l r e a s o n s , w e fi rs t p r e s e n t a s i m p l e

  • 8/14/2019 Linear Space Best First Search

    4/38

    44 R.E. Korfb u t i n e f f i c ie n t v e r s io n o f t h e a l g o r i t h m , S i m p l e R e c u r s i v e B e s t- F i rs t S e a r c h( S R B F S ) , a n d t h e n t h e f u ll R B F S a l g o r i t h m . W e t h e n p r o v e t h a t R B F S i s ab e s t -f ir s t se a r ch . T h e s p a c e c o m p l e x i t y o f b o t h a l g o r i th m s is O ( b d ) . F o r th es p e c ia l ca s e o f c o s t a s d e p t h , S R B F S g e n e r a t e s a s y m p t o t ic a l l y m o r e n o d e st h a n b r e a d t h - f ir s t s e a rc h , b u t R B F S is a s y m p t o t i c a l l y o p t i m a l . W e a l s o s h o wt h a t w i t h a n o n d e c r e a s i n g c o s t f u n c t i o n , R B F S g e n e r a t e s f e w e r n o d e s t h a ni te r a t iv e d e e p e n i n g . W e p r e s e n t e m p i r i c a l r e s u lt s f o r R B F S o n t h e T S P u s i n gt h e A * e v a l u a t i o n f u n c t i o n , s h o w i n g th a t R B F S g e n e r a t e s s ig n i f i c a n tl y f e w e rn o d e s t h a n I D A * . O n t h e s l i d i n g - ti le p u z z l e s , u s i n g a w e i g h t e d c o s t f u n c t i o n ,f ( n ) = g ( n ) + W h ( n ) , R B F S f in d s n e a r ly o p t i m a l s o l u t i o n s w i t h o r d e r s o fm a g n i t u d e r e d u c t io n s i n n o d e s g e n e r a t e d , a n d p r o d u c e s c o n s i s te n t ly s h o r te rs o l u t i o n s t h a n i te r a t iv e d e e p e n i n g w i t h t h e s a m e v a l u e o f W , b u t g e n e r a t e sm o r e n o d e s . T h e s e a l g o r i th m s f ir s t a p p e a r e d i n [ 1 3 ], a n d t h e m a i n r e su l tsw e r e s u m m a r i z e d i n [ 1 4,1 5 ].

    2 . P r e v i o u s w o r kT h e m e m o r y l i m i t a t i o n o f b e s t -f ir s t s ea r c h w a s f ir s t a d d r e s s e d b y i t e r a t iv e

    d e e p e n i n g [ 1 0 ]. O t h e r r e l a te d a l g o r i th m s w i ll b e d i s c u s s e d i n S e c t io n 7.2 .1 . l t e r a t i v e d e e p e n i n g

    I t e ra t i v e d e e p e n i n g p e r f o r m s a s e ri es o f d e p t h - fi r st s e a rc h e s, p r u n i n gb r a n c h e s w h e n t h e i r c o s t e x c e e d s a t h r e s h o l d fo r t h a t i t e r a ti o n . T h e i n i-t ia l t h r e s h o l d i s th e c o s t o f t h e r o o t n o d e , a n d t h e t h r e s h o l d fo r e a c hs u c c e e d i n g i te r a t io n is t h e m i n i m u m n o d e c o s t th a t e x c e e d e d t h e t h r e s h o l do n t h e p r e v i o u s i t e r a t i o n . T h e a l g o r i t h m t e r m i n a t e s w h e n a g o a l n o d e i sc h o s e n f o r e x p a n s i o n . S i n c e i t e r a t iv e d e e p e n i n g i s a d e p t h - f i r s t s e a r c h , ito n l y s t o re s th e n o d e s o n t h e c u r r e n t s e a rc h p a t h , r e q u i r in g O ( d ) s p a ce .I f t h e c o s t o f a n o d e i s i t s d e p t h , i t e r a t i v e d e e p e n i n g b e c o m e s d e p t h - f ir s ti t e ra t i v e d e e p e n i n g ( D F I D ) , c o r r e s p o n d i n g t o b r e a d t h - f ir s t s e a r ch [ 1 0 ,2 6 ].D F I D p e r f o r m s a s e ri es o f d e p t h - fi r s t s e a rc h e s , in c r e a s in g th e d e p t h c u t o f fb y o n e a t e a c h i t e r a t io n , u n t i l a g o a l is fo u n d . T h e t o t a l n u m b e r o f n o d e sg e n e r a t e d b y D F I D is b d + 2 b d - ! + 3 b d - 2 + . . . + d b = O ( b d ) , a n d t h er a t io o f t h e n u m b e r o f n o d e s g e n e ra te d b y D F I D to t h e n u m b e r g e n e r a t e db y b r e a d t h - f i rs t s e a r c h i s a p p r o x i m a t e l y b / ( b - 1 ) .I f w e r u n i te r a t iv e d e e p e n i n g w i t h c o s t e q u a l t o g ( n ) , w e g e t a n i t e ra t iv e -d e e p e n i n g v e r s i o n o f D i jk s t r a 's a l g o r it h m . A l te r n a ti v e l y , i f w e u s e t h e A *e v a l u a t io n f u n c t io n , f ( n ) = g ( n ) + h ( n ) , w e g e t i t e r a t i v e - d e e p e n i n g - A *( I D A * ) [ 1 0 ]. I D A * w a s t h e f ir s t a l g o r i t h m t o f i n d o p t i m a l s o l u t io n s to t h eF i f t e e n P u z z le .A n a d d i t i o n a l b e n e f i t o f i t e ra t iv e d e e p e n i n g i s t h a t t h e t i m e p e r n o d eg e n e r a t i o n i s le s s t h a n f o r b e s t - fi r s t s e a r c h . I t e r a t iv e d e e p e n i n g o n l y s t o r e s a

  • 8/14/2019 Linear Space Best First Search

    5/38

    Linear-space best-first search 45s in g l e c o p y o f t h e s t a te , m a k i n g i n c r e m e n t a l c h a n g e s t o t h e s t a t e t o g e n e r a t e ac h i ld n o d e , a n d u n d o i n g t h o s e c h a n g e s to r e tu r n t o th e p a r en t . F o r e x a m p l e ,t o m a k e a m o v e i n t h e s l id i n g -t il e p u z z l e s , o n l y t h e l o c a t i o n s o f t h e t i l em o v e d a n d t h e b l a n k a re m o d i f ie d . T h u s , t h e t i m e t o g en e r a te a m o v ei s l e s s t h a n f o r b e s t - f i r s t s e a r c h , w h i c h m u s t c o p y th e e n t i r e s t a t e a lo n gw i t h a n y ch a n g es . F u r t h e r m o r e , i te r a t i v e d e e p e n i n g d o e s n o t m a i n t a i n a n yo p e n o r c l o s e d li st s, a n d h e n c e d o e s n o t i n c u r t h e l o g a r i t h m i c i n s e r ti o n a n dr e t r i e v a l c o s t s o f s t a n d a r d b e s t- 'f ir s t s e a r c h . F o r t h e s a m e r e a s o n , t h e c o d ef o r I D A * i s a l s o s h o r t e r a n d e a s i e r t o i m p l e m e n t t h a n t h a t o f A * .

    I n t h e c a s e o f b r e a d t h - f i r s t s e a rc h , D i j k s t r a ' s a l g o r i th m , a n d A * w i t hconsistent h e u r i s t i c f u n c t i o n s [ 1 8 ] , t h e c o s t f u n c t i o n i s monotonic, i n t h es e n s e t h a t t h e c o s t o f a c h i l d i s a l w a y s g r e a te r t h a n o r e q u a l t o t h e c o s t o fi ts p a r e n t . F o r m a l l y , a c o s t f u n c t i o n f ( n ) is m o n o t o n i c i f a n d o n l y i f f o ra ll n o d e s n a n d n ' , w h e r e n ' i s a c h i ld o f n , f( n' ) >i f (n ).

    W i t h a m o n o t o n i c c o s t f u n c t io n , i t e ra t iv e d e e p e n i n g e x p a n d s n o d e s i nb e s t - fi r s t o r d e r . T o p r o v e t h i s , w e f i rs t d e f i n e a n o p e n n o d e a s o n e t h a t h a sb e e n g e n e r a t e d a t l e a s t o n c e , b u t n o t e x p a n d e d y e t . I n s t a n d a r d b e s t - f i rs ts e a r c h , a l l o p e n n o d e s a r e e x p l i c i t l y s t o r e d i n t h e o p e n l i s t , w h e r e a s i ni te r a t i v e d e e p e n i n g , a t m o s t o n e o p e n n o d e i s e v e r i n m e m o r y a t a n y g i v e nt i m e . W e t h e n d e f i n e a n a l g o r i t h m t o e x p a n d n o d e s i n b e s t - f i r s t o r d e r i fw h e n e v e r a n o d e i s e x p a n d e d , i ts c o s t i s l es s t h a n o r e q u a l t o t h e c o s t s o fa l l o p e n n o d e s a t t h e t i m e .T h e o r e m 2 . 1 . Given a monotonic cost function, iterative deepening expandsnodes in best-first order.P r o o f . T h e p r o o f i s b y i n d u c t i o n o n t h e n u m b e r o f i te r a t io n s . F o r th e b a s iss t e p , c o n s i d e r t h e f i r s t i t e r a t i o n . A t t h e s t a r t o f t h e f i r s t i t e r a t io n , t h e r o o tn o d e r i s t h e o n l y o p e n n o d e . T h e i n i t i a l c u t o f f t h r e s h o l d C 1 = f ( r ) ,a n d t h e f ir s t i t e r a t io n o n l y e x p a n d s n o d e s f o r w h i c h f (n ) ~ Cl = f( r) .S i n c e th e c o s t f u n c t i o n is m o n o t o n i c , a ll n o d e s i n t h e t re e r o o t e d a t r h a v ef ( n ) >>f(r ). T h u s , a n y o p e n n o d e s g e n e r a t e d d u r i n g t h e f ir s t i t e ra t i o nh a v e f ( n ) >I f ( r ) , a n d t h e f i r s t i t e r a t i o n e x p a n d s n o d e s i n b e s t - f i rs t o r d e r .

    F o r th e i n d u c t i o n s t ep , a s s u m e t h a t f o r a ll i t e r a ti o n s u p t o a n d i n c l u d in gi t e r a t i o n k , i t e ra t i v e d e e p e n i n g e x p a n d s n o d e s i n b e s t - f i rs t o r d e r . N o wc o n s i d e r i t e r a t i o n k + 1. L e t Ck a n d Ck+l b e t h e c u t o f f t h r es h o l d s f o ri t e r a t i o n s k a n d k + l , re s p e c t iv e l y . S i n c e th e c o s t f u n c t i o n i s m o n o t o n i c ,i t e r a t i o n k e x p a n d s a l l n o d e s n f o r w h i c h f(n) ~ Ck. A t t h e e n d o fi te r a t i o n k , t h e o p e n n o d e s c o n s is t o f t h o s e t h a t w e r e g e n e r a te d b u t n o te x p a n d e d d u r i n g i t e r a t i o n k , a n d t h u s h a v e c o s t s f ( n ) > Ck. Ck+l i s t h em i n i m u m o f t h o s e v a lu e s . D u r i n g i t e r a ti o n k + 1, o n l y th o s e n o d e s f o r w h i c hf (n) t Ck+l, s i n c e i f f ( n ) < Ck+l, t h e n f ( n )

  • 8/14/2019 Linear Space Best First Search

    6/38

    46 R . E . K o r f

    Fig. 2. T ree fragme nt with nonm onotoniccost function.n o d e n w o u l d h a v e b e e n e x p a n d e d d u r i n g i t e r a ti o n k , a n d w o u l d n o lo n g e rb e a n o p e n n o d e d u r i n g i t e r a t i o n k + 1. T h u s , s in c e all n o d e s e x p a n d e dd u r i n g i t e r a t i o n k + 1 h a v e f ( n ) f Ck+l, i t e r a t i o n k + 1 e x p a n d s n o d e s in b e s t - fi r s to r d e r . T h e r e f o r e , b y i n d u c t i o n , i te r a t i v e d e e p e n i n g a lw a y s e x p a n d s n o d e s i nb e s t -f i r s t o r d e r , g i v e n a m o n o t o n i c c o s t f u n c t i o n . [ ]2.2. Limitations of iterative deepening

    W h e n t h e c o s t f u n c t i o n is n o n m o n o t o n i c , h o w e v e r , m e a n i n g th a t t h e c o s to f a c h i ld c a n b e le ss th a n t h e c o s t o f it s p a r e n t , t h e n i t e r a t i v e d e e p e n i n g n ol o n g e r e x p a n d s n o d e s i n b e s t - f i r s t o r d e r . F o r e x a m p l e , th i s o c c u r s in pureheuristic search, w h i c h is b e s t - f ir s t s e a r c h w i t h f ( n ) = h ( n ) [ 6 ] , o r in t h eheuristic path algorithm, a b e s t - f i r s t s e a r c h w i t h f (n) = g(n) + Wh(n)[ 1 9 ], w i th W > 1. T h e i m p o r t a n c e o f t h e s e a lg o r i t h m s i s t h a t e v e n t h o u g ht h e y f i n d s u b o p t i m a l s o l u ti on s , t h e y g e n e r a t e m a n y f e w e r n o d e s t h a n a r er e q u i r e d t o f i n d o p t i m a l s o l u ti o n s .

    F o r e x a m p l e , c o n s i d e r th e t r e e f r a g m e n t in F i g . 2 , w h e r e t h e n u m b e r sr e p r e s e n t n o d e c o s t s . A b e s t - f i r s t s e a r c h w o u l d e x p a n d t h e s e n o d e s i n t h eo r d e r 5, 1, 2. W i t h i t e r a t iv e d e e p e n i n g , h o w e v e r , t h e i n i t i a l th r e s h o l d w o u l db e t h e c o s t o f t h e r o o t n o d e , 5. A f t e r g e n e r a t i n g t h e l e f t c h i l d o f th e r o o t ,n o d e 2 , i te r a t i v e d e e p e n i n g w o u l d e x p a n d a ll d e s c e n d e n t s o f n o d e 2 w h o s ec o s ts d i d n o t e x c e e d th e t h r e s h o l d o f 5, in d e p t h - f i r s t o rd e r , b e f o r e e x p a n d i n gn o d e 1. E v e n i f a ll th e c h i ld r e n o f a n o d e w e r e g e n e r a t e d a t o n c e , a n d o r d e r e db y t h e i r c o s t v a l u e s , s o t h a t n o d e 1 w a s e x p a n d e d b e f o r e n o d e 2, i t e r a t iv ed e e p e n i n g w o u l d e x p l o re s u b t re e s b e lo w n o d e s 4 a n d 3 b e f o r e e x p a n d i n gn o d e 2. T h e p r o b l e m is th a t w h i l e s e a r c h in g n o d e s w h o s e c o s t s a r e le ss th a nt h e c u r r e n t t h r e s h o l d , i te r a t i v e d e e p e n i n g ig n o r e s th e i n f o r m a t i o n i n t h ev a l u e s o f t h o s e n o d e s , a n d p r o c e e d s d e p t h - f ir s t .T h i s p r o b l e m is e v e n m o r e s e r i o u s o n a g r a p h w i th c y c le s . F o r e x a m p l e ,w i t h a p u r e h e u r i s t ic c o s t f u n c t i o n , f ( n ) = h ( n ) , t h e r e m a y b e c y c l e si n t h e g r a p h i n w h i c h t h e m a x i m u m n o d e c o s t i s l e s s t h a n t h e c u r r e n tc o s t th r e s h o l d . I n t h a t c a se , i te r a t i v e d e e p e n i n g w il l g o a r o u n d s u c h a c y c l ef o r e v e r w i th o u t t e r m i n a t i n g . F o r t u n a t e l y , s in c e i t e ra t iv e d e e p e n i n g m a i n t a i n st h e c u r r e n t s e a r c h p a t h o n t h e r e c u r s i o n s ta c k , t h is p r o b l e m c a n b e f i x e d b yc o m p a r i n g e a c h n e w l y g e n e r a t e d n o d e w i th t h o s e o n t h e c u r r e n t p a th , a n d

  • 8/14/2019 Linear Space Best First Search

    7/38

    Linear-space best-first search 4 7A B C

    _

  • 8/14/2019 Linear Space Best First Search

    8/38

    4 8A

    D

    G

    R.E. KorfB

    E

    H

    C

    F

    I

    F i g . 4 . S R B F S e x a m p l e w i t h c o s t e q u a l t o d e p t h .

    t h e v a l u e o f t h e l e f t c h i ld . T h u s , t h e r e c u r s i v e c a ll o n t h e r i g h t c h i l d h a s a nu p p e r b o u n d e q u a l t o t h e v a l u e o f it s l o w e s t- c o s t b r o th e r , 2 . S R B F S e x p a n d st h e r ig h t c h i ld , a n d e v a l u a t e s t h e g r a n d c h i l d r e n , a s s h o w n i n F i g . 3 B . S i n c et h e v a l u e s o f b o t h g r a n d c h il d re n , 4 a n d 3 , e x c e e d t h e u p p e r b o u n d o n t h e i rp a r e n t , 2 , t h e r e c u r s i v e c a l l t e r m i n a t e s . I t r e t u r n s a s i ts r e s u l t t h e m i n i m u mv a l u e o f i ts c h i ld r e n , 3. T h i s b a c k e d - u p v a l u e o f 3 i s s t o r e d a s th e n e w v a l u eo f t h e r ig h t c h i l d ( F ig . 3 C ) , i n d i c a t in g t h a t t h e l o w e s t - c o s t o p e n n o d e b e l o wt h is n o d e h a s a c o s t o f 3. A r e c u r s i v e c a ll is t h e n m a d e o n t h e n e w b e s tc h i ld , t h e l e f t o n e , w i t h a n u p p e r b o u n d e q u a l t o 3, w h i c h i s t h e n e w v a l u eo f i ts lo w e s t - c o s t b r o t h e r , t h e r i g h t ch i ld . I n g e n er a l, t h e u p p e r b o u n d o n ac h i ld n o d e is e q u a l to th e m i n i m u m o f t h e u p p e r b o u n d o n i t s p a r e n t, a n dt h e c u r r e n t v a l u e o f i ts l o w e s t - c o s t b r o t h e r .

    F i g u r e 4 s h o w s a m o r e e x t e n s i v e e x a m p l e o f S R B F S . In t h i s ca s e , th ec o s t f u n c t i o n i s s i m p l y th e d e p t h o f t h e n o d e i n t h e t re e , c o r r e s p o n d i n g t ob r e a d t h - f i r s t s e a r c h . T h e c h i l d r e n o f a n o d e a r e g e n e r a t e d f r o m l e ft t o r i g h t,a n d t ie s a re b r o k e n i n f a v o r o f t h e m o s t r e c e n t l y g e n e r a t e d n o d e .

    I n i t i a l l y , t h e stored v a l u e o f a n o d e , F ( n ) , e q u a l s i ts static v a l u e , f ( n ) .A f t e r a r e c u r s i v e c a l l o n t h e n o d e r e t u r n s , i t s s t o r e d v a l u e i s e q u a l t o t h e

  • 8/14/2019 Linear Space Best First Search

    9/38

    Linear-space best-first searchA B C

    F i g . 5. I n e f f i c i e n c y o f S R B F S a n d i t s s o l u t i o n .

    4 9

    m i n i m u m v a l u e o f al l f ro n t i e r n o d e s i n t h e s u b t re e e x p l o r e d d u r i n g th e l a stc a ll . S R B F S p r o c e e d s d o w n a p a t h u n t i l th e s t a t ic v a l u e s o f a ll c h i l d r e no f th e l a s t n o d e e x p a n d e d e x c e e d th e s t o r e d v a l u e o f o n e o f t h e n o d e sf u r t h e r u p t h e t r e e . I t t h e n r e t u r n s b a c k u p t h e t re e , re p l a c i n g p a r e n t v a l u e sw i t h th e m i n i m u m o f t h e i r c h i l d r e n ' s v a lu e s a n d f r e e in g m e m o r y , u n t i l i tr e a c h e s t h e b e t t e r n o d e , a n d t h e n p r o c e e d s d o w n t h a t p a t h . T h e a l g o r it h mis p u r e l y r e c u r s i v e w i t h n o s id e - e f fe c t s , r e s u l ti n g i n v e r y l o w o v e r h e a d p e rn o d e g e n e r a t i o n . A t a n y p o i n t , t h e r e c u r s i o n s t a ck c o n t a i n s t h e p a t h t o al o w e s t- c o s t f r o n t i e r n o d e , p l u s t h e s i b li ng s o f a ll n o d e s o n t h a t p a t h . T h u s ,i ts s p a c e c o m p l e x i t y is O (bd) , w h i c h i s l in e a r in t h e m a x i m u m s e a r c h d e p t hd . I n p s e u d o - c o d e , t h e a l g o r i t h m is a s f o ll ow s :

    S R B F S ( n od e : N , b o u n d : B )I F f ( N ) > B , R E T U R N f ( N)I F N i s a g o a l , E X I T a l g o r i t h mI F N h a s n o c h i l d r en , R E T U R N i n f i n i t yF O R e a c h c h i l d N i o f N , F[ i ] : = f ( N i )s o r t N i a n d F [ i] i n i n c r e a s i n g o r d e r o f F [i ]I F o n l y o n e c h i l d , F [ 2 ] : = i n f i n i t yW H I L E ( F [I ] < = B a n d F [I ] < i n f i n i t y )

    F [ 1 ] : = S R B F S ( N I , S I N ( B , F [ 2 ] ) )i n s e r t N 1 a n d F [I ] i n s o r t e d o r d e r

    r e t u r n F [ I ]O n c e a g o a l n o d e i s c h o s e n f o r e x p a n s i o n , t h e a c t u a l s o l u t i o n p a t h i s o n

    t h e r e c u r s i o n s t a ck , a n d r e t u r n i n g i t in v o l v e s s im p l y r e c o r d i n g t h e m o v e s a te a c h l e v e l . F o r s i m p l i c i t y , w e o m i t t h i s f r o m t h e a b o v e d e s c r i p t i o n .

    S R B F S e x p a n d s n o d e s i n b e s t- f ir s t o r d e r , e v e n i f t h e c o s t f u n c t i o n i sn o n m o n o t o n i c . U n f o r t u n a t e l y , h o w e v e r , S R B F S is in e f f i c ie n t . I f w e c o n t i n u et h e e x a m p l e f r o m F ig . 4, w h e r e c o s t is e q u a l to d e p t h , e v e n t u a l l y w e w o u l dr e a c h t h e s i tu a t i o n s h o w n i n F ig . 5 A , fo r e x a m p l e , w h e r e t h e l e f t c h i l d h a sb e e n e x p l o r e d to d e p t h 7 a n d t h e r ig h t c h i ld t o d e p t h 8. N e x t , a r e c u r s i v ec a ll w i ll b e m a d e o n t h e l e f t c h i ld , w i t h a n u p p e r b o u n d o f 8, th e v a l u e o f it sb r o t h e r . T h e l e f t c h i l d w i l l b e e x p a n d e d , a n d i t s t w o c h i l d r e n a s s i g n e d t h e i rs t a t ic v a l u e s o f 2, a s s h o w n i n F i g . 5 B . A t t h is p o i n t , a r e c u r s i v e c a ll w i ll b em a d e o n t h e f i g h t g r a n d c h i ld w i th a n u p p e r b o u n d o f 2, th e m i n i m u m o f i t sp a r e n t ' s b o u n d o f 8, a n d i ts b r o t h e r ' s v a l u e o f 2 . T h u s , t h e r i g h t g r a n d c h i l d

  • 8/14/2019 Linear Space Best First Search

    10/38

    50 R.E. Korfw i ll b e e x p l o r e d t o d e p t h 3, t h e n t h e l e f t g r a n d c h i l d t o d e p t h 4 , t h e r i g h t tod e p t h 5, t h e l e f t t o d e p t h 6 , a n d t h e r ig h t t o d e p t h 7 , b e f o r e n e w g r o u n d c a nf in a l ly b e b r o k e n b y e x p l o r i n g t h e l ef t g r a n d c h i l d t o d e p t h 8. M o s t o f th i sw o r k is r e d u n d a n t , s i n c e t h e l e ft c h i ld h a s a l r e a d y b e e n e x p l o r e d t o d e p t h 7.3.2. F ul l recurs ive bes t - f i rs t search

    T h e w a y t o a v o i d t h i s i n e f f ic i e n c y is fo r c h i ld r e n t o i n h e r i t t h e i r p a r e n t ' sv a l u e s a s t h e i r o w n , i f t h e p a r e n t ' s v a l u e s a r e g r e a te r t h a n t h e c h i l d r e n 'sv a l u e s . I n t h e a b o v e e x a m p l e , t h e c h i l d r e n o f t h e l e ft c h i ld s h o u l d i n h e r i tt h e i r p a r e n t ' s v a l u e o f 7 a s th e i r s t o r e d v a l u e , i n s t e a d o f 2 , a s s h o w n i nF i g. 5 C . T h e n , t h e r i g h t g r a n d c h i l d w o u l d b e e x p l o r e d i m m e d i a t e l y t o d e p t h8 , b e f o r e e x p l o r i n g t h e l e ft g r a n d c h i ld . H o w e v e r , w e m u s t d i s t in g u i s h t h isc a s e f r o m t h a t i n F i g . 2 , w h e r e t h e f a c t t h a t t h e c h i l d ' s v a l u e i s s m a l l e r t h a ni ts p a r e n t ' s v a l u e is d u e t o n o n m o n o t o n i c i t y i n t h e c o s t f u n c t i o n , r a t h e r t h a np r e v i o u s e x p a n s i o n o f t h e p a r e n t n o d e . I n t h a t c a se , t h e c h i ld r e n s h o u l d n o ti n h e r i t t h e i r p a r e n t ' s v a l u e , b u t u s e t h e i r s t a t i c v a l u e s i n s t e a d .

    T h e d i s t i n c t i o n i s m a d e b y c o m p a r i n g t h e s to r e d v a l u e o f a n o d e , F ( n ) , t oi ts s ta t ic v a l u e , f ( n ) . I f a n o d e h a s n e v e r b e e n e x p a n d e d b e f o r e , i ts s t o r e dv a l u e e q u a l s i t s s t a t i c v a l u e . I n o r d e r t o b e e x p a n d e d , t h e u p p e r b o u n d o n an o d e m u s t b e a t l e a s t a s l a r g e a s i t s s t o r e d v a l u e . T h e r e c u r s i v e c a l l o n t h en o d e w i ll n o t r e t u r n u n t i l t h e v a l u e s o f a ll th e f r o n t i e r n o d e s i n t h e s u b t r e eb e l o w i t e x c e e d i ts u p p e r b o u n d , a n d i ts n e w s t o r e d v a l u e w i ll b e s e t to t h em i n i m u m o f t h e se v a lu e s . T h u s , i f a n o d e h a s b e e n p r e v i o u s ly e x p a n d e d , i tss t o r e d v a l u e e x c e e d s i t s s t a t i c v a l u e .

    I f t h e s t o r e d v a l u e o f a n o d e i s g r e a t e r t h a n i ts s t a ti c v a l u e , i t s s t o r e dv a l u e i s t h e m i n i m u m o f t h e l a st s t o r e d v a l u e s o f i ts c h il d re n . T h e s t o r e dv a l u e o f s u c h a n o d e is t h u s a l o w e r b o u n d o n t h e v a l u e s o f i ts c h il d re n , a n dt h e v a l u e s o f t h e c h i ld r e n s h o u l d b e s e t t o t h e m a x i m u m o f t h e ir p a r e n t 'ss t o r e d v a l u e a n d t h e i r o w n s t a ti c v a l u e s . I f t h e s t o r e d v a l u e o f a n o d e ise q u a l t o i ts s ta t ic v a l u e , th e n t h e n o d e h a s n e v e r b e e n e x p a n d e d b e f o r e , a n dt h e v a l u e s o f i ts c h i l d r e n s h o u l d b e s e t to t h e i r s t a t ic v a l u e s . I n g e n e r a l, ap a r e n t ' s s t o r e d v a l u e i s p a s s e d d o w n t o i t s c h i ld r e n , w h i c h i n h e r i t t h e v a l u eo n l y i f i t e x c e e d s b o t h t h e p a r e n t ' s s t a t i c v a l u e a n d t h e c h i l d 's s t a t i c v a l u e .

    T h e fu l l r e c u r s i v e b e s t -f i r st s e a r c h a lg o r i t h m ( R B F S ) t a k e s t h r e e a rg u -m e n t s : a n o d e N , i ts s t o r e d v a lu e F ( N ) , a n d a n u p p e r b o u n d B . T h et o p - l e v e l c a l l t o R B F S i s m a d e o n t h e r o o t n o d e r , w i t h a v a l u e e q u a l t ot h e s t a t i c v a l u e o f r , f ( r ) , a n d a n u p p e r b o u n d o f c~. I n p s e u d o - c o d e , th ea l g o r i t h m i s a s f o l l o w s :

    R B F S ( n od e : N , v a l u e : F ( N ) , b o u n d : B )I F f ( N ) > B , r e t u r n f ( N )I F N i s a g o a l , E X I T a l g o r i t h mI F N h a s n o c h i l d r e n , R E T U R N i n f i n i t y

  • 8/14/2019 Linear Space Best First Search

    11/38

    Lin ear- spac e bes t- first search 51A

    C

  • 8/14/2019 Linear Space Best First Search

    12/38

    52 R.E. Korf3 a n d i ts b r o t h e r ' s v a l u e o f 3, a n d i ts s t o r e d v a l u e o f 3 i s p a s s e d d o w n t oi t s c h i l d r e n . I n t h i s c a s e t h e p a r e n t ' s s t o r e d v a l u e o f 3 e q u a l s i ts s ta t i c v a l u eo f 3 , a n d t h e c h i l d r e n ' s s t o r e d v a l u e s a r e s e t t o t h e i r s t a t i c v a l u e s o f 4 , a ss h o w n i n F i g . 6 D . A t t h is p o i n t , e v e n i f t h e s t a t ic v a l u e s o f t h e c h i l d r e nw e r e le s s t h a n t h a t o f t h e i r p a r e n t , t h e c h i l d r en w o u l d a d o p t t h e i r s t a ti cv a l u e s , a n d t h e s u b t r e e s b e l o w t h e m w o u l d b e e x p l o r e d i n b e s t- f ir s t o r d e r ,u n t il t h e v a l u e s o f a ll th e f r o n t i e r n o d e s e x c e e d e d t h e u p p e r b o u n d o f 3.

    L i k e S R B F S , R B F S e x p l o r e s n e w n o d e s i n b e s t - f i r s t o r d e r , e v e n w i t h an o n m o n o t o n i c c o s t f u n c t i o n , a n d a l s o r u n s i n l in e a r s p a ce . I ts a d v a n t a g eo v e r S R B F S is t h a t i t i s m o r e e f f ic i en t . R B F S b e h a v e s d i f fe r e n t ly d e p e n d i n go n w h e t h e r i t is e x p a n d i n g n e w n o d e s , o r p re v i o u s l y e x p a n d e d n o d e s . I nn e w t e r r i t o r y , i t p r o c e e d s s t r i c t l y b e s t - f i r s t , w h i l e o n o l d g r o u n d i t g o e sd e p t h - f i r s t , u n t i l it re a c h e s a l o w e s t - c o s t n o d e o n t h e o l d f r o n t i e r, a t w h i c hp o i n t i t r e v e r t s b a c k t o b e s t - f i r s t b e h a v i o r .

    I f t h e r e a r e c y c l e s i n t h e g r a p h , a n d c o s t d o e s n o t a l w a y s in c r e a s e w h i l et r a v e r s i n g a c y c le , a s w i t h a p u r e h e u r i s t i c c o s t fu n c t i o n , f ( n ) = h ( n ) , t h es a m e m o d i f i c a t io n w e d e s c r i b e d f o r i te r a ti v e d e e p e n i n g i n S e c t i o n 2 .2 m u s tb e m a d e t o R B F S , i n o r d e r t o a v o i d i n f i n i t e l o o p s . I n p a r t i c u l a r , e a c h n e wn o d e m u s t b e c o m p a r e d a g a in s t th e s t a c k o f n o d e s o n t h e c u r r e n t p a t h , a n dp r u n e d i f i t i s a l r e a d y o n t h e s ta c k .

    4 . C o r r e ct n e ss o f R B F SI n t h i s s e c t io n w e p r o v e t h a t R B F S s e a r c h e s a t re e i n b e s t -f i r s t o r d e r ,

    f i n d i n g a g o a l i f o n e e x is ts . T h e s a m e r e su l t a p p l i e s t o S R B F S a s w ell , b u tw e p r e s e n t t h e r e s u l t s f o r R B F S o n l y , s i n c e R B F S p e r f o r m s t h e s a m e t a s ka s S R B F S , b u t m o r e e f f ic i en t ly . T h e r e a d e r w h o i s i n c l in e d t o s k i p o v e r t h ep r o o f s i s e n c o u r a g e d t o a t l e a s t r e a d t h e d e f i n i t i o n s a n d t h e s t a t e m e n t s o ft h e l e m m a s a n d t h e o r em s , s in c e t h e y p r o v i d e i n si gh t i n t o th e b e h a v i o r o ft h e a l g o r i t h m .

    W e a s s u m e t h a t t h e p r o b l e m s p a c e i s a p o t e n t i a l ly i n f in i te t r e e , r o o t e d a tn o d e r . I f t h e p r o b l e m s p a c e is a g ra p h , t h e n t h e a l g o r i th m s e a rc h e s t h e t re eg e n e r a t e d b y a d e p t h - f i r s t t r a v e r s a l o f t h e g r a p h s t a r ti n g a t s t a t e r . A n y n o d et h a t h a s m u l t i p l e p a t h s t o i t i n th e g r a p h w i ll b e r e p r e s e n t e d b y m u l t i p lec o p i e s in t h e t r e e , o n e f o r e a c h d i s t i n c t p a t h t o i t.

    A s s o c i a t e d w i t h e v e r y n o d e n i n t h e tr e e is a s t a t i c e v a l u a t i o n f ( n ) . G i v e na t r e e T c o n t a i n i n g a n o d e n , w e d e f i n e a s u b t r e e T ( n ) a s a t r e e r o o t e d a tn , s u c h th a t f o r a n y n o d e m i n T ( n ) , a ll t h e b r o t h e r n o d e s o f m a r e a l s oin T ( n ) . I n o t h e r w o r d s , i f o n e c h i ld o f a n o d e is in t h e s u b t r e e , t h e n a llc h i l d r e n o f t h e n o d e a r e i n t h e s u b t r e e a s w e ll . A s u b t r e e is c o m p o s e d o finterior nodes, a ll o f w h o s e c h i l d r e n a r e i n t h e s u b t r e e , i f a n y , a n d f ron t ie rnodes, n o n e o f w h o s e c h i l d re n a r e in t h e s u b t r e e . A s u b t r e e i s exp lored b y

  • 8/14/2019 Linear Space Best First Search

    13/38

    Linear-space best-first search 53g e n e r a t i n g a l l o f i ts n o d e s . N o n - g o a l t e r m i n a l n o d e s a r e r e g a r d e d a s in t e r i o rn o d e s o n c e th e y h a v e b e e n e x p a n d e d , a n d R B F S r e t u rn s c~ a s t h e v a l u e o fs u c h n o d e s .

    G i v e n a t r e e T , a n o d e n , a n d a n u p p e r b o u n d b , w e d e f i n e a b-boundedsubtree o f n , T ( n , b ), a s a s u b t r e e T ( n ) i n w h i c h a l l i n t e r i o r n o d e s m h a v ef ( m ) b. F o r a g i v e n n a n db , T ( n , b ) is u n i q u e . I t i s e x p l o r e d b y s u c c e s s i v e l y e x p a n d i n g t h o s e n o d e sm w i t h f ( m ) ~< b , u n t i l a l l u n e x p a n d e d n o d e s a r e e i t h e r t e r m i n a l n o d e s ,o r f r o n t i e r n o d e s w i t h f ( m ) > b. I f b ~< c , then T ( n , b ) i s a s u b t r e e o fT ( n , c ), s i n c e in c r e a s in g t h e b o u n d c a n o n l y g e n e r a te a l a rg e r s u b t re e .

    T o g u a r a n t e e t e rm i n a t i o n , w e c o n s t r a i n t h e e v a l u a t i o n f u n c t i o n f ( n ) s ot h a t a ll f i n i t e - b o u n d e d s u b t r e e s a r e f in i te . I n o t h e r w o r d s , f o r a ll n o d e s n , a n df i n i t e v a l u e s b , T ( n , b ) c o n t a i n s a f i n it e n u m b e r o f n o d e s a n d e d g e s. T h i sc o n s t r a i n t is s a t i sf i e d b y t h e A * e v a l u a t i o n f u n c t i o n f ( n ) = g ( n ) + h ( n ) ,a n d t h e w e i g h t e d e v a l u a t i o n f u n c t i o n f ( n ) = g ( n ) + W h ( n ) , b u t n o t b yt h e p u r e h e u r i s t ic f u n c t i o n f ( n ) = h ( n ) o n a n i n f in i t e t re e . E v e n s t a n d a r db e s t - f i r s t s e a r c h m a y n o t t e r m i n a t e w i t h t h i s e v a l u a t i o n f u n c t i o n o n a ni n f i n i t e t r e e .

    W e d e f i n e M F ( n , b) t o b e t h e m i n i m u m f v a l u e o f a n y f r o n t ie r n o d e i nT ( n , b ). I f t h e r e a r e n o f r o n t i e r n o d e s i n T ( n , b ) , t h e n M F ( n , b) i s d e f i n e da s c ~ . N o t e t h a t M F ( n , b ) > b , s i n c e f o r a l l f r o n t i e r n o d e s m i n T ( n , b ) ,f ( m ) > b . L et D ( n , b ) b e t h e m a x i m u m d e p t h o f T ( n , b ) , o r t h e d e p t h o fa d e e p e s t n o d e o f T ( n , b ) b e l o w n o d e n . F i n a l ly , l e t F ( n ) b e t h e c u r r e n ts t o r e d v a l u e o f n o d e n i n R B F S . W e u s e F [ i ] to d e n o t e t h e c u r r e n t s t o re dF v a l u e o f t h e i t h c h i l d i n t h e s o r t e d o r d e r o f c h i ld r e n .

    W e f i rs t e s t a b li s h a s i m p l e p r o p e r t y o f al l c a ll s t o R B F S .L e m m a 4 .1 . A l l ca lls to R B F S a r e o f th e f o r m R B F S ( n , F ( n ) , b ) , w h er eF ( n )

  • 8/14/2019 Linear Space Best First Search

    14/38

    5 4 R.E. KorfP r e e f . T h e p r o o f i s b y i n d u c t i o n o n D ( n , b ) , t h e d e p t h o f T ( n , b ) . S i n c e bi s f in i te , a n d b y a s s u m p t i o n a ll f in i t e - b o u n d e d s u b t r e e s a r e f i n it e , D ( n , b )i s f i n i t e .

    Ba s i s s t e p : D ( n , b ) = 0 . I n o t h e r w o r d s , n i s t h e o n l y n o d e i n T ( n , b ) ,a n d t h u s f (n) > b . T h e r e f o r e , R B F S ( n , F ( n ) , b ) w i l l r e t u r n f (n) w i t h o u te x p a n d i n g n , h e n c e e x p l o r i n g T ( n , b ) a n d r e t u r n i n g M F ( n , b ) .

    Induct ion s tep: A s s u m e t h e l e m m a i s t r u e f o r al l ca ll s R B F S (n , F ( n ) , b ) f o rw h i c h D (n , b) b, t h e n F ( n' ) = f ( n' ) > b.T h u s , n ' i s t h e o n l y n o d e o f T ( n ' , b ) , a n d F ( n ' ) = f ( n ') = M F ( n ' , b ) .

    I f a c h i l d n ' w a s e x p a n d e d d u r in g R B F S ( n , F ( n ) , b ) , i t s c u r r e n t v a l u eF (n ' ) i s t h e o n e r e t u r n e d b y t h e l a s t r e c u r s i v e c a l l o n i t, R B F S ( n ' , F ( n ' ) , b ' ).S i n c e b ' = m i n ( b , F [ 2 ] ) , w h e r e F [ 2 ] i s t h e l o w e s t F v a lu e a m o n g t h eb r o t h e r s o f n t, a n d t h e s u c c e s s i v e F v a l u e s o f a g iv e n n o d e f o r m a s t r i c tl yi n c re a s i n g s e q u e n c e w i t h i n a p a r e n t c a l l , t h e u p p e r b o u n d b ' o n t h e la s tc a l l t o R B F S ( n ' , F ( n ' ) , b ' ) m u s t b e t h e l a r g e s t u p p e r b o u n d f o r a n y c a l lt o R B F S ( n ' , F ( n ' ) , b ' ) m a d e d u r i n g t h e p a r e n t c a l l t o R B F S ( n , F ( n ) , b ) .T h u s , t h e l a r g e s t s u b t r e e e x p l o r e d b e l o w n ' d u r i n g R B F S ( n , F ( n ) , b ) w a se x p l o r e d d u r i n g t h e l a s t r e c u r s i v e c a l l R B F S ( n ' , F ( n ' ) , b ' ) , a n d T ( n ' , b ' )c o n t a i n s a n y p r e v i o u s s u b t r e e s o f n ' e x p l o r e d d u r i n g R B F S ( n , F ( n ) , b ) .S i n c e b ' b . S i n c e a l l i n t e r i o r n o d e s m

  • 8/14/2019 Linear Space Best First Search

    15/38

    Linear-space best-first search 55of T ( n ' , b ' ) have f ( m ) ~ b , and all frontier nodes m of T ( n ' , b ' ) havef ( m ) > b , T ( n ' , b ' ) = T ( n ' , b ) , and M F ( n ' , b ' ) = M F ( n ' , b ) = F ( n ' ) .

    The union of all the subtrees T ( n ' , b ) for all the children n ' of n isequal to T ( n , b ) . Furthermore, the minimum of F ( n ') = M F ( n ' , b ) for allthe children n' of n, which is the value returned by R B F S ( n , F ( n ) , b ) , isequal to M F ( n , b ). Thus, R B F S (n , F ( n ) , b ) explores T (n, b ) and returnsM F ( n , b ) . By induct ion then, the lem ma is true for all such calls. []

    We now turn to the order of node expansion by RBFS. Recall that wedefine an open node to be one that has been generated at least once, butnot expanded yet. While in standard best-first search all open nodes areexplicitly stored, in RBFS very few of these nodes are actually in memoryat any point in time. Define O D ( n ) to be the min imum f value of all opennodes that are descendents of node n, and let O N ( n ) be the minimum fvalue of all open nodes that are n o t descendents of node n.L e m m a 4.3. F o r a ll c alls R B F S ( n , F ( n ) , b ) , F ( n )

  • 8/14/2019 Linear Space Best First Search

    16/38

    56 R.E. Korff ( n ' ) o r F ( n ) , F ( n ' )

  • 8/14/2019 Linear Space Best First Search

    17/38

    Linear-space best-first search 57a n d f ( n ) ~ O D ( n ), f ( n ) i s l es s t h a n o r e q u a l t o t h e f v a l u e s o f a ll o p e nn o d e s i n t h e t r e e w h e n n i s e x p a n d e d . [ ]

    F i n a l ly , w e s h o w t h a t R B F S s e a r c h e s t h e e n t i r e t r e e i n b e s t- f ir s t o r d e r ,e v e n t u a l l y f i n d i n g a s o l u t i o n i f o n e e x i s ts .T h e o r e m 4.5 . R B F S ( r , f ( r ) , c c ) w ill pe rform a comp lete best-first search o fthe t ree rooted at node r , ex i t ing a f ter f ind ing the f i rs t goal node chosen fo rexpansion.P r o o f . L e m m a 4 . 4 s h o w s t h a t R B F S p e r f o r m s a b e s t - f i r s t s e a r c h . A l l t h a tr e m a i n s i s t o s h o w t h a t R B F S ( r , f ( r ) , c ~ ) w i l l p e r f o r m a c o m p l e t e s e a r c ho f t h e t r e e , r o o t e d a t n o d e r , u n t i l c h o o s i n g a g o a l n o d e f o r e x p a n s i o n .S i n c e f ( r ) < c~, R B F S ( r , f ( r) , oo) w il l e x p a n d n o d e r , g e n e ra t in g e a c h o fi t s c h i l d r e n r ' , a n d a s s i g n i n g F ( r ' ) = f ( r ' ) . I t w i l l t h e n p e r f o r m a s e r i e so f r e c u r s i v e c a lls R B F S ( r ' , F ( r ' ) , b ' ) o n t h e c h i l d r ' w i t h t h e l o w e s t c u r r e n tv a l u e o f F ( r ' ) . F r o m t h e p r o o f o f L e m m a 4 .2 , w e k n o w t h a t t h e s e q u e n c e o fF ( r ' ) v a l u e s f o r e a c h c h i l d r ' i s s t r i c tl y in c r e a s i n g . S in c e t h e b o u n d o n t h ep a r e n t c a l l i s oo , t h e W H I L E l o o p f o r th e r e c u r s i v e ca l ls c a n n e v e r t e r m i n a t e ,g e n e r a t i n g a n u n b o u n d e d n u m b e r o f r e c u r s iv e c al ls . B y r e p e a t e d ly m a k i n gr e c u r s i v e c a ll s o n a c h i l d o f th e r o o t w i t h t h e l o w e s t F v a l u e , a n d s t ri c tl yi n c r e a s i n g th e F v a l u e o f t h e c h i l d w i t h e a c h c a ll , w e g u a r a n t e e t h a t t h e r ew il l b e a n u n b o u n d e d n u m b e r o f r e c u r s iv e c a lls o n e a c h c h i ld . S i n c e t h eu p p e r b o u n d o n e a c h o f t h e s e ca ll s is th e n e x t lo w e s t F v a lu e , th e u p p e rb o u n d s a l s o i n c r e a s e c o n t i n u a l l y , m e a n i n g t h a t l a r g er a n d l ar g e r s u b t re e s o fe a c h c h i l d a r e e x p l o r e d , g u a r a n t e e i n g a c o m p l e t e s e a r c h o f t h e t r e e . F in a l ly ,t h e o n l y e x i t f r o m t h e t o p - le v e l c a ll o n t h e r o o t o f t h e t r e e o c c u r s w h e n ag o a l n o d e is c h o s e n f o r e x p a n s i o n . [ ]

    5 . C o m p l e x it y o f S R B F S a n d R B F SW e n o w t u r n t o t h e s p a c e a n d t im e c o m p l ex i t ie s o f S R B F S a n d R B F S .

    5. I . Space com plexi tyT h e s p ac e c o m p l e x i ty o f S R B F S a n d R B F S is O ( b d ) , w h e r e b i s t h e

    b r a n c h i n g f a c t o r a n d d is t h e m a x i m u m s e a r c h d e p t h . E a c h r e c u r s iv e ca llo f e i th e r a l g o r i th m m u s t s to r e a ll t h e c h i l d r e n o f t h e a r g u m e n t n o d e , a l o n gw i t h t h e i r F v a l u e s . T h i s r e q u i r e s O ( b ) s p a c e , w h e r e b is t h e b r a n c h i n gf a c t o r o f t h e t re e . T h e m a x i m u m n u m b e r o f ac t iv e c a l ls th a t m u s t b e s t o r edo n t h e r e c u r s io n s ta c k a t a n y p o i n t is eq u a l to t h e m a x i m u m s e a r c h d e p t hd . T h u s , t h e o v e r a l l s p a c e c o m p l e x i t y is O ( b d ) .

  • 8/14/2019 Linear Space Best First Search

    18/38

    58 R.E. KorfI n g e n er a l , t h e m a x i m u m s e a r c h d e p t h d d e p e n d s o n t h e p r o b l e m s p a c e ,

    t h e p r o b l e m i n s ta n c e , a n d t h e c o s t fu n c t i o n . F o r th e t ra v e l i n g s a l e s m a np r o b l e m , f o r e x a m p l e , t h e m a x i m u m s e a r c h d e p t h i s t y p ic a l l y t h e n u m b e r o fc it ie s . I n th e c a s e o f a m o n o t o n i c c o s t f u n c t i o n , t h e m a x i m u m s e a rc h d e p t his t h e lo n g e s t p a t h i n w h i c h n o n o d e c o s t s e x c e e d th e m i n i m u m s o l u t i o nc o s t. F o r e x a m p l e , i n t h e s l id i n g -t il e p u z z l e s w i th a m o n o t o n i c c o s t f u n c t i o n ,t h e m a x i m u m s e a r ch d e p t h w i ll n o t e x c e e d t h e s h o r t e s t s o l u t i o n l en g t h.5.2. General time complexity

    T h e t i m e c o m p l e x i t y o f s t a n d a r d b e s t - f i rs t s e a r c h is O ( N l o g N ) , w h e r eN is t h e n u m b e r o f n o d e s g e n e r a t e d , d u e t o t h e m a n a g e m e n t o f t h e o p e nl is t. S i n c e S R B F S a n d R B F S h a v e n o g l o b a l o p e n l is ts , h o w e v e r , th e i r t i m ec o m p l e x i t y is l in e a r i n t h e n u m b e r o f n o d e s g e n e ra te d , a s s u m i n g a c o n s t a n tb r a n c h i n g f a c t o r . E a c h c a l l t o S R B F S o r R B F S g e n e r a t e s b n e w n o d e s , w h e r eb is t h e b r a n c h i n g f a c t o r . T h e m o s t e x p e n s i v e s t e p i n a c a ll i s s e l e c ti n g ac h i ld o f m i n i m u m F v a l u e . R e g a r d l e s s o f w h e t h e r t h e c h i l d re n a r e k e p t i n ah e a p o r s o r t e d , s i n c e t h e r e a r e o n l y a c o n s t a n t n u m b e r o f c h i ld r e n , i n s e r ti o na n d r e t r i e v a l t a k e o n l y c o n s t a n t t i m e . T h u s , t h e o v e r a ll t i m e c o m p l e x i t y isa co n s t a n t t i m e s t h e n u m b e r o f n o d e g e n e ra t i o n s.

    T h e a c tu a l n u m b e r o f n o d e s g e n e ra t e d b y R B F S o r S R B F S d e p e n d s o nt h e p a r t i c u l a r c o s t f u n c t i o n . W e c o n s i d e r t h e b e s t c a s e , w o r s t c a s e , a n d t h es p e c ia l c a s e o f c o s t a s d e p t h . I n a d d i t i o n , w e c o m p a r e t h e t im e c o m p l e x i t yo f R B F S t o i t e r a ti v e d e e p e n i n g i n th e c a s e o f a m o n o t o n i c c o s t f u n c t i o n .F i n a l l y , w e r e fe r to a n a v e r a g e - c a s e a n a l y s i s o f i t e r a t i v e d e e p e n i n g w i t h am o n o t o n i c c o s t f u n c t io n , w h i c h i m p l i e s t h a t b o t h i t e ra t iv e d e e p e n i n g a n dR B F S a re a s y m p t o t i c a l l y o p t i m a l i n a p a r t i c u l a r a b s t r a c t m o d e l .

    5.3. Best-case time complexityT h e b e s t - ca s e t i m e c o m p l e x i t y o f b o t h R B F S a n d S R B F S o c c u r s w h e n a lln o d e s h a v e i d e n t i c a l c o s t v a l u e s . I n th a t c a s e , n e i t h e r a l g o r i th m e x p a n d s a n yn o d e m o r e t h a n o n c e . I n a n i n f i n it e t re e , th e y w i ll c o n t i n u e d o w n a s in g lep a t h f o r e v e r , b u t o n a u n i f o r m f i n i t e t r e e , b o t h a l g o r i t h m s g e n e r a t e e v e r yn o d e e x a c t l y o n c e , a n d t h e i r t i m e c o m p l e x i t y is O(bd), a s s u m i n g t h a t n og o a l i s f o u n d .

    5.4. Worst-case time complexityC o n v e r s e l y , th e w o r s t - c a s e t i m e c o m p l e x i t y o c c u r s w h e n a ll n o d e s h a v e

    u n i q u e c o s t v a l u e s , a n d a r e a rr a n g e d s o t h a t s u c c e s s i v e n o d e s i n a n o r d e r e ds e q u e n c e o f c o s t v a l u e s ar e i n d i f f e re n t s u b t r e e s o f t h e r o o t n o d e . F o re x a m p l e , F i g . 7 s h o w s a w o r s t - c a s e b i n a r y t re e . I n t h i s c as e , i n o r d e r t oe x p a n d e a ch n e w o p e n n o d e a t d e p t h d , b o t h S R B F S a n d R B F S m u s t

  • 8/14/2019 Linear Space Best First Search

    19/38

    Linear-space best-first search 59

    Fig. 7. W orst-case binary t ree for SR BFS and RBFS.a b a n d o n t h e i r c u r r e n t p a t h a ll t h e w a y b a c k t o th e r o o t . T h e s t o re d v a l u e o fo n e o f t h e r e m a i n i n g c h i l d r e n o f t h e r o o t w il l e q u a l t h e c o s t o f t h e n e x t o p e nn o d e , i n d i c a t in g w h i c h c h i l d it is t o b e f o u n d u n d e r . H o w e v e r , t h e r e is n oi n f o r m a t i o n a s to w h e r e i t i s t o b e f o u n d u n d e r t h i s c h il d . I n th e w o r s t ca s e,w e m a y h a v e t o g e n e ra t e a l l n o d e s d o w n t o a n d i n c lu d i n g d e p t h d u n d e rt h i s c h i ld , i n o r d e r t o f i n d o n e o f lo w e s t c o s t. S i n c e t h e y a r e a ll d e s c e n d e n t so f t h e s a m e c h i l d o f t h e r o o t , t h e r e a re O ( b d - l ) s u c h n o d e s . T h u s , e a c hn e w n o d e e x p a n s i o n a t d e p t h d m a y r e q u i r e O ( b d - l ) n o d e g e n e r a t i o n s .S i n c e t h e r e a re b d n o d e s a t d e p t h d , t o c o m p l e t e l y e x p l o re a t re e o f d e p t hd m a y r e q u ir e O ( b 2 d - I ) t i m e . T h i s i s o n l y s li g h tl y b e t t e r t h a n t h e O ( b 2d )w o r s t - c a s e t im e c o m p l e x i t y o f i t e ra t i v e d e e p e n i n g [ 1 7 ].

    T h i s s c e n a r i o i s s o m e w h a t u n r e a l i st ic , h o w e v e r , s in c e in o r d e r t o m a i n t a i nu n i q u e c o s t v a l u e s in t h e f a c e o f a n e x p o n e n t i a ll y g r o w i n g n u m b e r o f n o d e s ,t h e n u m b e r o f b i t s u s e d t o r e p re s e n t t h e v a l u e s m u s t i n c re a s e w i th e a c hl e v el o f t h e t re e . F o r e x a m p l e , i n a b i n a r y t r e e , a n a d d i t i o n a l b i t m u s t b ea d d e d t o t h e r e p r e s e n t a t i o n o f t h e c o s t v a l u e s a t e a c h d e p t h .

    5.5. A special case." cost equal to depthT h e a b o v e re s u lt s i n d i c a te t h a t t h e t i m e c o m p l e x i t y o f S R B F S a n d R B F S

    i s v e r y s e n s i t iv e t o t h e n u m b e r o f d i s t in c t c o s t v a l u e s a n d t h e i r d i s t r i b u t i o ni n t h e s e a r c h t r e e . T h i s m a k e s a n y g e n e r a l a v e r a g e - c a s e a n a l y s i s d i f f i c u l t . T og e t s o m e s e n s e o f a c t u a l p e r f o r m a n c e t o b e e x p e c t e d i n p ra c t i ce , w e a n a l y z e db o t h S R B F S a n d R B F S f o r th e s p e c ia l ca s e w h e r e t h e c o s t fu n c t i o n is s i m p l yt h e d e p t h o f a n o d e i n t h e t re e , c o r r e s p o n d i n g t o b r e a d t h - f i r s t s e a rc h .

    5.5.1. Time complexity o f SRBF S with cost as depthT h e o r e m 5 . 1 . The asymptotic time complexity of SRBFS on a uniform treewith branching factor b, depth d, and cost equal to depth, is O ( x d ) , where

    x = ( b + 1 + # b 2 + 2 b - 3 ) .

  • 8/14/2019 Linear Space Best First Search

    20/38

    6 0 R.E. KorfP r o o f . I n o r d e r to p e r f o r m a s e a r c h to d e p t h d , S R B F S f ir s t g e n e r a t e s al lc h i l d r e n o f t h e r o o t , r e q u i r i n g b n o d e g e n e r a t i o n s . A ll b u t t h e l a s t c h i l d ,b - 1 i n a ll , w i ll b e s e a r c h e d t o d e p t h 1 b e l o w t h e c h i l d . T h e n t h e l a s t c h i l dw i ll b e s e a r c h e d t o d e p t h 2 b e l o w t h e c h i l d . N e x t , a l l b u t t h e l a st o f th er e m a i n i n g c h i l d r e n w il l b e s e a r c h e d t o d e p t h 2 , w h i c h a g a i n is a to t a l o fb - I o f t h e m . I n o t h e r w o r d s , a f t e r t h e c h i l d r e n o f t h e r o o t a r e g e n e r a t e d ,t h e r e a r e a se r ie s o f i t e r a t io n s i n w h i c h b - 1 o f t h e c h i l d r e n a r e s e a r c h e dt o s u c c e s s i v e l y g r e a t e r d e p t h s f r o m 1 t o d - 1, i n c l u s iv e . F i n a l ly , th e l a str e m a i n i n g c h i l d n e e d o n l y b e s e a r c h e d to d e p t h d - 1 t o c o m p l e t e t h e e n t i res e a r c h t o d e p t h d . T h u s , i f N ( d ) i s th e t o t a l n u m b e r o f n o d e s g e n e r a t e d b yS R B F S i n a s e a r c h t o d e p t h d , w e h a v e t h e r e c u r r e n c e :

    d - 1N ( d ) = b + ( b - 1 ) ~ N ( i ) + N ( d - 1 ) .i=l

    H y p o t h e s i z in g t h a t N ( d ) = O ( x a ) , a n d s u b s t i t u t i n g i n t o o u r r e c u r r e n c eg i v e s

    d - 1x a = b + ( b - l ) ~ x i + x a -l ,i = 1

    d-I xdy~ X i ~ ( x - 1 ) 'i = 1X dx a ,~ b + (b - 1 ) - - + X d-1.( x - 1 )

    D r o p p i n g t h e b t e r m , w h i c h i s i n s ig n i f ic a n t , a n d f a c t o r i n g o u t x d - l g i v e s( b - 1 ) x

    x ~ + 1 .( x - 1 )S o m e s i m p l e a l g e b ra g iv e s u s t h e q u a d r a t i c e q u a t i o n

    x 2 - ( b + 1 ) x + 1 = 0 ,w hi ch by the q u a d r a t i c f o r m u l a h a s a s in g le r o o t g r e a te r t h a n o n e ,

    x = ( b + l + x / b 2 + 2 b - 3 )f o r a n o v e r a ll c o m p l e x i t y o f

    N ( d ) = O ( x d ) , w h e r e x = ( b + 1 + x / b 2 + 2 b - 3 ) . [ ]T h e a s y m p t o t i c b r a n c h i n g f a c t o r , x , is s tr ic t ly g r e a t e r t h a n b , in d i c a t i n g

    t h a t S R B F S is n o t a s y m p t o t i c a l l y o p t i m a l i n t h i s c a se . I n th e l i m i t o f la r g eb , x a p p r o a c h e s b + 1. T a b l e 1 g i v e s t h e v a l u e o f x f o r b f r o m 2 t o 1 0.

  • 8/14/2019 Linear Space Best First Search

    21/38

    Linear-space bes t-first search 61Table 1Asymptotic branching factor of SRBFS for breadth-firstse ar c h .b 2 3 4 5 6 7 8 9 10x 2.62 3.73 4.79 5.83 6.85 7.87 8.89 9.90 10.91

    5 .5 .2 . T i m e c o m p l e x i t y o f R B F S w i t h c os t a s d e p thR B F S , h o w e v e r , i s a s y m p t o t i c a l l y o p t i m a l f o r t h e s p e c i a l c a s e o f c o s t a s

    d e p t h .T h e o r e m 5 . 2 . T h e a s y m p t o ti c t i m e c o m p l e x i ty o f R B F S o n a u n i fo r m tr eew i th branching fac tor b , dep th d , an d cos t equal to depth, i s O (b d ).P r o o f . R B F S b e h a v e s l i ke d e p t h - f i rs t i t e r a ti v e d e e p e n i n g ( D F I D ) i n th i sc a se . I n s e a r c h in g t o d e p t h d , R B F S f ir s t s e a r c h e s e v e r y n o d e t o d e p t h d - I .T o t r a n s i t io n f r o m s e a r c h in g f r o m o n e d e p t h t o t h e n e x t, D F I D r e t u r n s tot h e r o o t a n d b e g i n s a n e w i t e r a t io n f r o m s c ra tc h . R B F S , h o w e v e r , b e g i n st h e s e a r c h t o d e p t h d i m m e d i a t e l y a f t e r t h e la s t n o d e a t d e p t h d - 1 h a sb e e n g e n e r a t e d . A t t h is p o i n t , i n s t e a d o f r e t u r n i n g to t h e r o o t , R B F S h a sa s ta c k o f n o d e s f r o m t h e r o o t t o th i s l a s t n o d e a t d e p t h d - 1. T h e t o ta ln u m b e r o f n o d e s o n t h i s s ta c k , n o t c o u n t i n g t h e r o o t , i s b ( d - 1 ) , s in c e t h es ib l in g s o f a ll n o d e s o n t h e c u r r e n t p a t h a r e s t o r e d a s w e ll . T h e s e n o d e s a r en o t r e g e n e r a t e d d u r i n g t h e s e a r c h t o d e p t h d , r e s u l t in g in a s m a l l sa v i n g so v e r D F I D . T h e t o ta l n u m b e r o f n o d e s in a t re e o f d e p t h d is

    d bd+lE b i ~~ ( b - l ) "i=1T h u s , t o s e a rc h t o d e p t h d , R B F S m u s t f ir s t s e a rc h t o d e p t h d - 1 , t h e ng e n e r a t e b d + l / ( b - 1 ) - b ( d - 1 ) n o d e s i n s e a r c h i n g t o d e p t h d . T h i s g iv e st h e f o l l o w in g r e c u r r e n c e :

    b d + lN ( d ) = N ( d - 1 ) + b ( d - 1 ) .( b - 1 )T h i s i s e x a c t l y t h e r e c u r r e n c e f o r D F I D e x c e p t f o r t h e s a v in g s o f b ( d - 1 )n o d e s o n e a c h i t e ra t io n . T h u s , t h e t o ta l s a v i n gs o v e r D F I D i s

    d d-lE b ( i - 1 ) = b Z i = b d ( d - 1 ) = O ( d 2 ) .i=! i=0

    S i n ce t h e a s y m p t o t ic c o m p l e x i ty o f D F I D is O ( b d) [ 10], a n d R B F S g e n e r -a t e s O ( d 2) f e w e r n o d e s t h a n D F I D , t h e a s y m p t o t i c c o m p l e x i t y o f R B F S isa l s o O ( b d ) . []

  • 8/14/2019 Linear Space Best First Search

    22/38

    6 2 R.E. Korf5 .5 .3 . Co m par i so n o f "bread th - fi r s t " search a lgor i thms

    I f w e c o m p a r e t h e f o u r b e s t- f ir s t se a r c h a l g o r i th m s w i t h c o s t e q u a l t od e p t h , w e f i n d t h a t b r e a d t h - f i r s t s e a rc h ( B F S ) , D F I D , a n d R B F S al l h a v ea s y m p t o t i c c o m p l e x i t y O ( b d ) , w h i l e S R B F S i s O ( x d ) w h e r e x > b a n da p p r o a c h e s b + 1 f o r la rg e b . B F S g e n e r a te s t h e f e w e s t n o d e s , a n d t h e r a t ioo f t h e n o d e s g e n e r a t e d b y D F I D t o t h o s e g e n e r a te d b y B F S i s a p p r o x i m a t e l yb / ( b - 1 ) . R B F S g e n e r a t e s O ( d 2 ) f e w e r n o d e s t h a n D F I D .

    5 . 6 . R B F S v e r s u s i t e r a t i v e d e e p e n i n g w i t h m o n o t o n i c c o s t sH o w d o R B F S a n d i te r a ti v e d e e p e n i n g c o m p a r e i n g e n er a l ? I f t h e c o s t

    f u n c t io n i s n o n m o n o t o n i c , t h e t w o a lg o r i t h m s a re n o t d i r e c t ly c o m p a r a b l es i n c e t h e y e x p l o r e d i f f e re n t p a r t s o f t h e t r e e a n d r e t u r n d i f f e re n t s o l u t i o n s .W i t h a m o n o t o n i c c o s t f u n c t i o n , h o w e v e r , t h e y b o t h e x p l o r e t h e s a m e p a r to f t h e t re e , a n d p r o d u c e l o w e s t - c o s t s o l u t i o n s , b u t R B F S g e n e r a te s f e w e rn o d e s t h a n i t e r a t i v e d e e p e n i n g o n a v e r a g e .

    I n a b e s t - f i rs t s e a rc h w i th a m o n o t o n i c c o s t fu n c t i o n , t h e c o s t o f n o d e s e x -p a n d e d f o r t h e f ir s t t i m e is m o n o t o n i c a l l y n o n d e c r e a s in g . E a c h d i s t i n c t c o s tv a l u e i n t h e t r e e g e n e r a t e s a d i f f e r e n t i t e r a t i o n o f i t e r a t i v e d e e p e n i n g , w i t ha t h r e s h o l d e q u a l to t h a t c o s t v a l u e . I n e a c h i t e r a t i o n , i t e r a t i v e d e e p e n i n gp e r f o r m s a d e p t h - f i r s t s e a r c h o f T ( r , c ) , t h e c - b o u n d e d s u b t re e o f r, w h e r er i s t h e r o o t o f t h e t r e e , a n d c is t h e c u t o f f t h r e s h o l d f o r t h a t i t e r a ti o n .W e c a n s im i la r ly d e f i n e a n " i t e r a t i o n " o f R B F S , c o r r e s p o n d i n g t o a c o s tt h r e s h o l d c , a s t h a t i n t e r v a l d u r i n g w h i c h t h o s e n o d e s b e i n g e x p a n d e d f o rt h e f i r s t t i m e a l l h a v e c o s t c . W e b e g i n w i t h a n e c e s s a r y l e m m a .

    L e m m a 5.3 . D u r i n g a n i te r a ti o n w i t h a m o n o t o n i c c o s t f u n c t i o n , f o r a l l c a ll sR B F S ( n , F ( n ) , b ), F ( n ) = c , w h e r e c i s t h e c o st th r e s h o M f o r t h a t i te r a ti o n.

    P r o o f . T h e p r o o f i s b y i n d u c t i o n o n t h e n u m b e r o f c a l l s to R B F S d u r i n gt h e i t e ra t i o n . F o r t h e b a s i s s t e p , w e c o n s i d e r t h e f i rs t ca ll o f a n i t e r a t i o n .F o r t h e v e r y f ir s t i t e r a t i o n , t h e c o s t t h r e s h o l d c is e q u a l t o t h e s t a t i c v a l u eo f t h e r o o t n o d e r , o r f ( r ) . S i n c e t h e i n i t i a l c a l l i s R B F S ( r , f ( r ) , ~ ) ,F ( n ) = f ( r ) = c , t h e c o s t t h r e s h o l d f o r t h a t i t e r a t i o n .

    A t t h e e n d o f e a c h i t e ra t i o n , s i n c e a ll n o d e s o f a g i v e n c o s t c h a v e b e e ne x p a n d e d , b u t n o n o d e s o f g r e a t e r co s t, R B F S h a s e x p l o re d T ( r , c ) , t h ec - b o u n d e d s u b t r e e o f t h e r o o t n o d e r . A t th i s p o i n t , t h e F ( n ) v a l u e s o fa ll n o d e s n o n t h e s t a ck e x c e e d c . T h e m i n i m u m o f t h e se F ( n ) v a l u e s ,M F ( r , c ) = c ' , i s t h e c o s t t h r e s h o l d f o r t h e n e x t i t e r a t i o n . T h e f i r s t ca l l t oR B F S i n t h e n e w i t e r a t i o n w i ll b e o n o n e o f t h e s e n o d e s w i t h F ( n ) = c '.T h u s , f o r t h e f i r s t c a ll in a n y i t e r a ti o n , R B F S ( n , F ( n ) , b ) , F ( n ) = c, t h ec o s t t h r e s h o l d f o r t h e i t e r a t i o n .

  • 8/14/2019 Linear Space Best First Search

    23/38

    Linear-space best-first search 63The induction hypothesis is that for the first k calls to RBFS in an

    iteration with cost threshold c, R B F S ( n , F ( n ) , b ) , F (n) = c. Now considerthe (k + 1 )st call during the itera tion, R B F S ( n ' , F (n ' ) , b ' ) . Its parent call,R B F S ( n , F ( n ) , b ) , was one of the first k calls, and hence by the inductionhypothesis, F ( n ) = c . Cons ider the initial F value of n ' , F ( n ' ) . I f f (n ) F ( n ) ,then F ( n ' ) = f ( n ' ) . With a monotonic cost function, f ( n ' ) >I f ( n ) . Thus,F ( n ' ) = f ( n ' ) >t f ( n ) >1 F ( n ) . Therefore, in either case, the first F valueof n ' , F ( n ' ) >1 F ( n ) . Since the sequence o f F values of a child node isstrictly increasing, at any point F (n ' ) >i F (n ) = c .

    Now consider a recursive call R B F S ( n ' , F ( n ' ) , b ' ) during the currentiteration with cost threshold c. If F ( n ' ) > c , since b ' >1 F ( n ' ) by Lemma4.1, b ' > c . Since, by Lemma 4.3, F ( n ' ) c . But by Lemma 5.3, such a call cannot be in the same iterationwith cost threshold c, thus violating our assumption that n ' is expandedtwice in the same iteration. []T h e o r e m 5.5. W i t h a m o n o t o n i c c o s t f u n c t i o n , R B F S g e n e r a t e s f e w e r n o d e st h a n i te r a t iv e d e e p e n in g , u p to ti e - b r e a k in g a m o n g n o d e s w h o s e c o s t e q u a l st h e s o l u t i o n c o st .Proof. In each iteration, iterative deepening performs a depth-first searchof T ( r , c ) , a c-bounded subtree of r, where r is the root o f the tree, and cis the cutoff threshold for that iteration. Since RBFS is a best-first search,

  • 8/14/2019 Linear Space Best First Search

    24/38

    6 4 R.E. Korfa t t h e e n d o f a n " i t e r a t io n " t h a t e x p a n d s a l l n o d e s o f c o st c , R B F S h a sa l s o e x p l o r e d T ( r , c ) . F u r t h e r m o r e , b y L e m m a 5 .4 , R B F S d o e s n ' t e x p a n da n y n o d e t w ic e d u r i n g t h e s a m e i t e ra t io n . T h e d i f fe r e n c e b e t w e e n i te r a t i v ed e e p e n i n g a n d R B F S is t h a t i t e r a ti v e d e e p e n i n g p e r f o r m s a d e p t h - f i r s t se a r c ho f T ( r , c ) , s t a r ti n g a t th e r o o t r o f th e t r e e, w h e r e a s R B F S p e r f o r m s d e p t h -f i r s t s e a r c h e s o f T ( n , c ) f o r th o s e n o d e s n o n t h e s t a c k a t th e e n d o f t h el a s t i t e r a t i o n , f o r w h i c h F ( n ) = c . I f n o d e s o f a g i v e n c o s t a r e c l u s t e r e dt o g e t h e r in t h e t re e , t h e n s i g n if i c a n t s a v in g s w i ll b e r e a l iz e d b y R B F S o v e ri t e r a t i v e d e e p e n i n g . E v e n i n t h e w o r s t c a se , w h e n n o s u c h c l u s t e r in g e xi st s,a s f o r e x a m p l e w i t h c o s t e q u a l t o d e p t h , t h e n o d e s o n t h e s t a c k a t t h e e n do f t h e l a s t it e r a t i o n a r e n o t r e g e n e r a t e d b y R B F S , w h i le t h e y a r e r e g e n e r a t e db y i t e r a t i v e d e e p e n i n g . T h u s , o n a l l i t e r a t i o n s e x c e p t t h e l a s t o n e , R B F Se x p a n d s s t ri c tl y f e w e r n o d e s t h a n i te r a t i v e d e e p e n i n g .

    O n t h e l a s t i t e r a t i o n , h o w e v e r , t h e o n e t h a t f i n d s th e g o a l , b o t h i t e ra t i v ed e e p e n i n g a n d R B F S t e r m i n a t e a s s o o n a s a g oa l n o d e is c h o s e n f o r e x p a n -s io n . S i n c e t ie - b r e a k i n g a m o n g n o d e s o f e q u a l c o s t is p e r f o r m e d d i f f e r e n t l yb y t h e t w o a l g o r i t h m s , e i t h e r m a y f i n d a g o a l f i r s t , a n d h e n c e e x p a n d f e w e rn o d e s o n t h e l a st i t e r a t i o n . T h u s , w e c a n o n l y c o n c l u d e t h a t w i th a m o n o -t o n i c c o s t f u n c t i o n , R B F S e x p a n d s f e w e r n o d e s t h a n i te r a t i v e d e e p e n i n g , u pt o t i e -b r e a k i n g a m o n g n o d e s w h o s e c o s t e q u a l s t h e g o a l c o s t. [ ]

    T h i s d i f f e r e n c e i n n o d e g e n e r a t io n s m a y o r m a y n o t b e s ig n i f ic a n t, d e -p e n d i n g o n t h e p r o b l e m . F o r e x a m p l e , in t h e a b o v e e x a m p l e o f c o s t e q u a l tod e p t h , t h e d i f f e r e n c e b e t w e e n R B F S a n d D F I D is n o t s ig n if ic a n t, w h e r e a s o nt h e t r a v e l i n g s a l e s m a n p r o b l e m , d i s c u s s e d b e l o w , t h e d i f f e r e n c e is s i g n if ic a n t .5 . 7. A v e r a g e c a s e a n a l y s i s: m o n o t o n i c c o s t s

    F i n a l ly , w e r e f e r t h e r e a d e r t o a n a v e r a g e - c a s e a n a l y s is o f I D A * w i t h am o n o t o n i c c o s t f u n c t io n , p r e s e n t e d i n [ 29 ] . T h e a n a l y t ic m o d e l c o n s is tso f a t re e w i th u n i f o r m b r a n c h i n g f a c to r a n d i n d e p e n d e n t a n d i d e n t i c a ll yd i s t r i b u t e d n o n n e g a t i v e e d g e c o sts , c h o s e n f r o m a n a r b i t r a r y d i sc r e t e p ro b a -b i l it y d i s t r ib u t i o n . T h e c o s t o f a n o d e is t h e s u m o f th e e d g e c o st s f r o m t h er o o t t o t h e g iv e n n o d e , g u a r a n t e e i n g m o n o t o n i c i t y . I n t h is m o d e l , i te r a t i v ed e e p e n i n g is a s y m p t o t i c a l l y o p t i m a l , m e a n i n g t h a t i t g e n e r a t e s a s y m p t o t i -c a l l y t h e s a m e n u m b e r o f n o d e s a s c la s si ca l b e s t- f ir s t s e a r c h . S i n c e R B F Sg e n e r a t e s f e w e r n o d e s t h a n i t e r a ti v e d e e p e n i n g o n a v e r a g e , it f o ll o w s t h a tR B F S is a s y m p t o t i c a l ly o p t i m a l i n t h i s m o d e l a s w e ll .6 . E x p e r i m e n t a l r e s u l t s

    W e i m p l e m e n t e d R B F S , a l o n g w i t h i t e ra t iv e d e e p e n i n g a n d A * f o r c o m -p a r i s o n , o n t h e t r a v e l i n g s a l e s m a n p r o b l e m a n d t h e s l i d i n g - t i l e p u z z l e s .

  • 8/14/2019 Linear Space Best First Search

    25/38

    Linear-space bes t-first search 656 .'1 . T r a v e l i n g s a l e s m a n p r o b l e m

    To demonstrate the superiority of RBFS over iterative deepening witha monotonic cost function, we compared RBFS to IDA* on the Euclideantravelling salesman problem, using the A* evaluation function, f ( n ) =g (n) + h (n). The heuristic function used was the minimum spanning tree(MST) of the cities not yet visited. Since the MST is a lower bound onthe cost of a TSP tour, both IDA* and RBFS find optimal solutions. With10, 11, and 12 cities, RBFS generated an average of 16%, 16%, and 18% ofthe nodes generated by IDA*, respectively. The time per node generationwas roughly the same for the two algorithms, since the cost of computingthe heuristic function dominates the running time. Additional experimentalresults, on the asymmetric TSP and on random trees, can be found in [29].Unfortunately, however, both these algorithms generate significantly morenodes than depth-first branch-and-bound, with nodes ordered by the nearestneighbor heuristic. The reason is that with 16 bits to represent city positions,and for the size of problems that can be practically run, many nodes haveunique cost values and there are relatively few ties. Thus, the overhead ofnode regenerations becomes prohibitive for both RBFS and IDA*, since anew iteration is needed for each distinct cost value. The potential advantageof IDA* and RBFS over depth-first branch-and-bound is that since theformer are best-first searches, they never generate any nodes with costgreater than the optimal solution cost. However, depth-first branch-and-bound is very effective on the TSP, generating only about 10% more thanthe minimum number of nodes, i.e. those with cost less than the optimalsolution cost.On the sliding-tile puzzles, however, depth-first branch-and-bound is noteffective, since it is difficult to find any solution at all. Thus, best-firstsearches are the algorithms of choice.

    6 .2 . O p t i m a l s o l u t i on s t o E i g h t a n d F i f te e n P u z z l e sWe ran RBFS and IDA* on both the Eight and Fifteen Puzzles, using

    the A* evaluation function with the Manhattan distance heuristic. Bothalgorithms find optimal solutions. When averaged over 1000 different EightPuzzle problem instances, RBFS generated 1.4% fewer nodes than IDA*.On the Fifteen Puzzle, however, when averaged over only 100 differentproblem instances, RBFS generated more nodes than IDA*. This effect isdue to noise in the tie-breaking on the last iteration, however, and woulddisappear if a larger number of problem instances could be run. In fact,RBFS generated fewer nodes than IDA* on 51 of the 100 problems. Findingoptimal solutions for the Fifteen Puzzle is expensive, however, requiringhundreds of millions of node generations per problem for either algorithm.

  • 8/14/2019 Linear Space Best First Search

    26/38

    6 6 R.E. Korf6 .3 . W e i g h t e d e v a l u a t io n f u n c t i o n o n F i f t e e n P u z z l e

    I n o r d e r t o f i n d s o l u t io n s m o r e q u i c k l y , I r a P o h l [ 1 9] p r o p o s e d t h eh e u r i s t i c p a t h a l g o r i t h m , a b e s t - f i r s t s e a r c h w i t h f ( n ) = (1 - w ) g ( n ) +( w ) h ( n ) , w h i c h w e s i m p l i fy t o f ( n ) = g ( n ) + W h ( n ) , w h e r e W = w / ( 1 -w ) . T h e s e f o r m s a r e e q u i v a l e n t , s i n c e o n l y t h e r e l a t iv e c o s ts o f d i f f e r e n tn o d e s c a n a f f e c t t h e a l g o r i th m , a n d n o t t h e i r a b s o l u te v a l u e s. A s W i n c r e a s e sb e y o n d o n e , P o h l c o n j e c t u r e d t h a t s o l u t io n l e n g t h s w o u l d i n c re a s e , w h i l en o d e g e n e r a t i o n s w o u l d d e c r e a s e . J o h n G a s c h n i g [7 ] e m p i r i c a l l y s t u d i e d t h i sa l g o r i t h m o n t h e E i g h t P u zz l e , a n d c o n f i r m e d th a t i n c r e a s in g W r e s u lt e di n f i n d i n g s o l u t i o n s f a s t e r at t h e e x p e n s e o f i n c r e a s e d s o l u t i o n l e n g th . M o r er e c e n t ly , D a v i s e t al . [ 3] c o n f i r m e d th e s e r e s u l t s o n b o t h t h e E i g h t P u z z l ea n d t h e T S P . T h e y a l so p r o v e d t h a t f o r W g r e a t e r t h a n o n e , th e r e s u l t in gs o l u ti o n s c a n n o t e x c e e d th e o p t i m a l s o l u t i o n s b y m o r e t h a n a f a c t o r o f W .T h i s g i v e s u s a g u a r a n t e e d u p p e r b o u n d o n t h e r e s u l t i n g s o l u t i o n q u a l i t y .

    O n t h e o t h e r h a n d , J u d e a P e a r l [ 1 8] s h o w e d th a t o n a n a b s t r a c t tr e e w i t hu n i f o r m b r a n c h i n g f a c t o r a n d o n l y a s i ng le g oa l n o d e , e q u a l w e i g h ti n g o fg a n d h r e s u l t s i n t h e f a s t e s t a l g o r i t h m , w i t h o p t i m a l s o l u t i o n s b e i n g a na d d i t i o n a l b o n u s . T h e d i s c r e p a n c y b e t w e e n th e s e e x p e r i m e n t a l a n d a n a l y ti c a lr e s u lt s is p r o b a b l y d u e t o t h e f a c t t h a t t h e a s s u m p t i o n o f a s in g le go a l n o d eis n o t v a l i d i n t h e s l i d in g - t i l e p u z z l e s o r t h e T S P , s i n c e t h e r e i s a p a t h t o ag o a l n o d e b e l o w e v e r y b r a n c h o f th e t re e .

    T h e c o s t f u n c t i o n f ( n ) = g ( n ) + W h ( n ) i s n o n m o n o t o n i c i f W > 1,e v e n i f h ( n ) i s n o n - o v e r e s t i m a t i n g . F o r e x a m p l e , i f n ' i s a c h i ld o f n ,h ( n ' ) = h ( n ) - 1 , a n d g ( n ' ) = g ( n ) + 1 , t h e n

    f (n ' ) = g ( n ' ) + W h ( n ' )= g ( n ) + 1 + W ( h ( n ) - 1 )= g ( n ) + W h ( n ) + 1 - W= f ( n ) + 1 - W< f ( n ) i f W > 1.

    W e c o m p a r e d w e ig h te d -A * ( W A * ) , w e i g h t ed - ID A * ( W I D A * ) , a n d R B F Su s in g t h is e v a l u a t i o n f u n c t i o n o n t h e 1 00 r a n d o m l y g e n e r a t e d F i f t e e n P u z z l ep r o b l e m i n s ta n c e s f r o m [ 1 0] , v a ry i n g W f r o m 1 t o 9 9 . W i t h W < 3, W A *t e n d s t o e x h a u s t t h e a v a il a b le m e m o r y o f 1 00 ,0 00 n o d e s . T h e r a w d a t a f r o mt h e s e e x p e r i m e n t s a r e s h o w n i n T a b l e 2 . C o l u m n A g i v e s W , e x p r e s s e d a st h e i n t e g e r r a t i o ( W h ~ W g ) b e t w e e n t h e w e i g h t o n h ( W h ) a n d t h e w e i g h to n g ( W g ) . T h e r e m a i n i n g c o l u m n s w il l b e d e s c r i b e d b el ow , w i t h t h e d a t ai n e a c h r e p r e s e n t i n g th e a v e r a g e o v e r a ll 1 00 p r o b l e m i n s ta n c e s .

  • 8/14/2019 Linear Space Best First Search

    27/38

    Linear-space best-first search 6 7

    T a b l e 2D a t a f o r F i f t e e n P u z z l e e x p e r i m e n t s .A

    W e i g h tWh/Wg1 / 15 / 44 / 33 / 26 1 / 3 93 1 / 1 96 3 / 3 71 6 / 91 3 / 73 3 / 1 72 / 16 7 / 3 31 7 / 86 9 / 3 17 / 37 1 / 2 91 8 / 77 3 / 2 73 7 / 1 33 / 11 9 / 6177 / 233 9 / 1 1791214 / 18 1 / 1 94 1 / 98 3 / 1 75 / 12 1 / 41 7 / 36 / 14 3 / 78 7 / 1 37 / 12 2 / 38 t l8 9 / 1 19 / 19 1 / 92 3 / 29 3 / 74 7 / 31 9 / 12 4 / 19 7 / 34 9 / 19 9 / 1

    B ~ C ~ D ! E !S o lu t ion Leng t hs IW A* RBFS i W A*

    78 . 417 9 . 6 38 1 . 2 58 3 . 2 785 . 818 8 . 1 58 9 . 2 99 1 . 2 593 . 1197 . 319 7 . 8 01 0 1 . 6 31 0 3 . 2 9

    1 0 3 . 3 11 0 6 . 0 91 0 9 . 2 31 0 9 . 8 31 1 2 . 5 51 1 2 . 8 51 1 6 . 4 9119 . 211 2 0 . 0 91 2 1 . 9 91 2 4 . 1 5 i127 65 !132 . 111 3 5 . 3 31 4 4 . 2 91 4 5 . 2 71 4 5 . 2 7

    W I D A * I5 3 . 0 5 I53.911

    F l G iNodes G eneratedW I DA * RB FS To t a l RB FS New

    5 4 . 4 956 . 315 7 . 3 55 8 . 3 76 0 . 0 36 1 . 5 363.716 6 . 1 5 i6 8 . 1 3

    5 3 .0 5 3 6 3 , 0 2 8 , 0 9 0 5 4 5 , 3 7 0 , 3 7 8 4 5 3 , 4 0 4 , 7 1 55 3..9 1 7 9 3 , 2 9 3 , 3 7 3 1 0 2 , 8 6 4 , 9 3 3 2 0 , 6 9 7 , 2 8 55 4 . 4 1 I 3 2 ,0 2 4,8 1 _ 3 8 , 0 9 1 , 4 4 7 9 , 0 0 4 , 5 1 85 5.8 31 i 7 , 7 9 0 , 4 6 2 1 1 , 0 2 6 , 9 7 7 3 , 5 7 5 , 4 4 75 6 .6 1 ~l 3 6 , 2 1 6 , 0 0 6 4 3 , 2 8 4 , 4 8 0 2 , 5 2 1 , 0 7 15 7 .4 7 8 , 7 9 1 ,2 4 9 1 5 , 8 3 6 , 8 6 0 1 , 4 2 7 , 1 7 9I5 8 . 6 3 8 , 2 3 5 , 2 9 0 1 5 , 0 8 6 , 5 6 3 9 6 0 , 4 4 2

    5 9 . 3 5 2 , 6 9 0 , 7 2 7 6 , 9 9 4 , 4 6 3 8 3 7 , 9 6 56 0 . 7 7 8 8 2 , 4 1 2 2 , 4 1 5 , 8 5 6 4 4 3 , 8 4 06 1.8 9~ ~ 8 7 4 , 5 4 7 4 , 3 2 4 , 0 8 6 3 8 5 , 9 2 46 2 .8 9 2 2 9 , 4 0 7 6 0 0 , 8 4 4 2 6 3 , 4 5 36 8 .5 1 6 3 . 4 5 8 2 6 , 1 5 4 3 , 8 3 2 , 4 9 5 2 7 4 , 6 9 87 1 . 2 3 6 5 . 0 7 h 3 8 9 , 1 1 8 2 , 2 9 2 , 4 7 8 2 1 9 , 4 2 17 4 . 1 3 6 6 . 3 5 ~ 4 0 8 , 8 2 8 2 , 8 9 8 , 4 2 5 2 1 1 , 2 2 97 7 . 8 3 6 8 . 3 9 ~ 1 7 3 , 4 7 2 8 1 3 , 5 8 1 1 7 9 , 5 9 18 0 . 8 5 6 9 . 4 7 1 4 4 , 5 3 6 1 , 6 2 2 , 0 2 3 1 2 7 , 0 1 1 :- +8 4 . 1 9 7 1 . 0 5 1 2 6 , 3 6 0 1 , 2 1 9 , 0 0 0 1 1 7 , 2 2 98 8 . 7 5 7 2 . 4 9 ___ 7 8 , 0 9 9 1 , 5 4 8 , 9 4 6 1 1 9 , 9 5 49 2 .8 1 7 4 . 3 5 7 5 , 5 7 8 9 0 2 , 7 9 3 8 9 , 2 5 39 8 . 2 3 7 7.4 5~ 2 2 , 8 4 1 5 9 , 4 7 7 1 7 2 , 4 5 4 9 3 , 0 3 21 0 2 .9 1 7 8 . 5 9 2 1 , 2 5 0 5 4 , 2 6 3 6 0 6 , 8 9 3 6 5 , 0 1 6

    1 0 7 . 6 9 8 0 . 9 5 1 9 , 1 4 5 5 8 , 7 9 4 7 6 7 , 0 3 5 7 5 , 1 7 61 1 4 . 4 3 8 2 .6 7 1 8 , 2 8 6 _ 7 1 , 1 0 5 6 9 4 , 3 6 4 7 2 , 2 2 31 2 1 . 3 9 8 4 .6 1 1 7 , 2 1 2 b 7 8 , 4 1 6 6 8 5 , 5 7 2 6 1 , 8 1 91 2 8 . 8 9 8 7 . 4 3 1 5 , 8 1 9 6 0 , 4 5 0 2 6 9 , 2 8 9 7 7 , 4 2 91 3 6 .2 1 8 9 . 3 3 1 4 , 2 5 4 5 4 , 0 3 4 7 9 8 , 7 9 3 7 2 , 9 9 91 4 5 . 1 3 9 1 . 1 7 1 2 , 4 0 6 9 8 , 3 4 4 7 0 6 , 8 2 7 7 3 , 3 1 01 5 4 . 5 9 9 2 .8 1 1 2 , 9 7 5 9 1 , 6 8 3 7 8 9 , 6 8 4 7 3 , 5 6 81 6 0 . 1 5 9 5 .8 3 1 2 , 6 8 9 8 7 ,9 8 9 2 0 6 ,4 3 5 8 4 , 0 6 01 6 6 . 8 5 9 7 .4 1 1 3 , 1 6