alpro waktu linier

Upload: aji-saputra-raka-siwi

Post on 03-Apr-2018

229 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/28/2019 Alpro Waktu Linier

    1/9

    A S i m p l e L i n e a r - T i m e A l g o r i t h m f o r F i n d i n g

    P a t h - D e c o m p o s i t i o n s o f S m a l l W i d t h

    K e v i n C a t t e l l , M i c h a e l J . D i n n e e n , M i c h a e l R . F e l l o w s

    D e p a r t m e n t o f C o m p u t e r S c i e n c e

    U n i v e r s i t y o f V i c t o r i a

    V i c t o r i a , B r i t i s h C o l u m b i a V 8 W 3 P 6 , C a n a d a

    m j d , k c a t t e l l , m f e l l o w s @ c s r . u v i c . c a

    A b s t r a c t

    W e d e s c r i b e d a s i m p l e a l g o r i t h m r u n n i n g i n l i n e a r t i m e f o r e a c h x e d c o n s t a n t k ,

    t h a t e i t h e r e s t a b l i s h e s t h a t t h e p a t h w i d t h o f a g r a p h G i s g r e a t e r t h a n k , o r n d s

    a p a t h - d e c o m p o s i t i o n o f G o f w i d t h a t m o s t O ( 2

    k

    ) . T h i s p r o v i d e s a s i m p l e p r o o f o f

    t h e r e s u l t b y B o d l a e n d e r t h a t m a n y f a m i l i e s o f g r a p h s o f b o u n d e d p a t h w i d t h c a n b e

    r e c o g n i z e d i n l i n e a r t i m e .

    C l a s s i c a t i o n : A l g o r i t h m s a n d d a t a s t r u c t u r e s , c o m p u t a t i o n a l c o m p l e x i t y .

    1 I n t r o d u c t i o n

    T h e t o p i c s o f t h e p a t h w i d t h a n d t r e e w i d t h o f g r a p h s h a v e p r o v e n t o b e o f f u n d a m e n t a l i n t e r e s t

    f o r t w o r e a s o n s . F i r s t o f a l l , t h e y p l a y a n i m p o r t a n t r o l e i n t h e d e e p r e s u l t s o f R o b e r t s o n a n d

    S e y m o u r R S 8 3 , R S 8 6 a , R S 9 0 , R S 9 1 , R S ] . S e c o n d l y , a n d m o r e i m p o r t a n t l y f r o m a p r a c t i c a l

    p o i n t o f v i e w , b o u n d e d p a t h w i d t h a n d t r e e w i d t h h a v e p r o v e n t o b e g e n e r a l \ c o m m o n d e n o m -

    i n a t o r s " f o r m a n y n a t u r a l i n p u t r e s t r i c t i o n s o f N P - c o m p l e t e p r o b l e m s . F o r m a n y i m p o r t a n t

    p r o b l e m s , w e n o w k n o w t h a t x i n g a n a t u r a l p a r a m e t e r k i m p l i e s t h a t t h e y e s - i n s t a n c e s

    h a v e b o u n d e d t r e e w i d t h o r p a t h w i d t h ( f o r e x a m p l e s s e e B o d 8 8 b , B F W 9 2 , F H W 9 3 , F L 9 2 ,

    K T 9 2 , M o h 9 0 ] ) . W e a l s o k n o w t h a t m a n y p r o b l e m s c a n b e s o l v e d i n l i n e a r t i m e w h e n t h e

    i n p u t i n c l u d e s a b o u n d e d - w i d t h p a t h - d e c o m p o s i t i o n ( o r t r e e - d e c o m p o s i t i o n ) o f t h e g r a p h

    ( s e e A r n 8 5 , A L S 9 1 , A P 8 9 , B o d 8 8 a , B P T 9 2 , C M 9 3 , W H L 8 5 , W i 8 7 ] a n d B o d 9 2 ] f o r m a n y

    f u r t h e r r e f e r e n c e s ) .

    A f t e r s e v e r a l r o u n d s o f i m p r o v e m e n t R S 8 6 b , L a 9 0 , R e 9 2 ] t h e b e s t k n o w n a l g o r i t h m f o r

    n d i n g t r e e - d e c o m p o s i t i o n s i s d u e t o B o d l a e n d e r B o d 9 3 ] . F o r e a c h x e d k , t h i s a l g o r i t h m

    1

  • 7/28/2019 Alpro Waktu Linier

    2/9

    i n t i m e O ( 2

    k

    2

    n ) e i t h e r d e t e r m i n e s t h a t t h e t r e e w i d t h i s g r e a t e r t h a n k , o r p r o d u c e s a t r e e -

    d e c o m p o s i t i o n o f w i d t h a t m o s t k . B y r s t r u n n i n g t h i s a l g o r i t h m a n d t h e n a p p l y i n g t h e

    a l g o r i t h m o f B K 9 1 , K l 9 3 ] , a s i m i l a r r e s u l t h o l d s f o r p a t h w i d t h . B o t h o f t h e a l g o r i t h m s

    i n v o l v e d a r e q u i t e c o m p l i c a t e d .

    W e d e s c r i b e h e r e a v e r y s i m p l e a l g o r i t h m b a s e d o n \ p e b b l i n g " t h e g r a p h u s i n g a p o o l

    o f O ( 2

    k

    ) p e b b l e s , t h a t i n l i n e a r t i m e ( f o r x e d k ) , e i t h e r d e t e r m i n e s t h a t t h e p a t h w i d t h

    o f a g r a p h i s m o r e t h a n k , o r n d s a p a t h - d e c o m p o s i t i o n o f w i d t h a t m o s t t h e n u m b e r o f

    p e b b l e s a c t u a l l y u s e d . T h e m a i n a d v a n t a g e s o f t h i s a l g o r i t h m o v e r p r e v i o u s r e s u l t s a r e :

    ( 1 ) t h e s i m p l i c i t y o f t h e a l g o r i t h m a n d ( 2 ) t h e i m p r o v e m e n t o f t h e h i d d e n c o n s t a n t f o r a

    d e t e r m i n a t i o n t h a t t h e p a t h w i d t h i s g r e a t e r t h a n k . T h e m a i n d i s a d v a n t a g e i s i n t h e w i d t h

    o f t h e r e s u l t i n g \ a p p r o x i m a t e " d e c o m p o s i t i o n w h e n t h e w i d t h i s l e s s t h a n o r e q u a l t o k .

    2 P r e l i m i n a r i e s

    A l l o f o u r d i s c u s s i o n c o n c e r n s n i t e s i m p l e g r a p h s . S o m e o f t h e g r a p h s h a v e a b o u n d a r y

    o f s i z e k , m e a n i n g t h a t t h e y h a v e a d i s t i n g u i s h e d s e t o f v e r t i c e s l a b e l e d 1 ; 2 ; : : : ; k . T w o

    b o u n d a r i e d g r a p h c a n b e g l u e d ( t o f o r m a r e g u l a r g r a p h ) w i t h t h e o p e r a t o r , w h i c h s i m p l y

    i d e n t i e s v e r t i c e s w i t h t h e s a m e b o u n d a r y l a b e l .

    A n ( h o m e o m o r p h i c ) e m b e d d i n g o f a g r a p h G

    1

    = ( V

    1

    ; E

    1

    ) i n a g r a p h G

    2

    = ( V

    2

    ; E

    2

    ) i s a n

    i n j e c t i o n f r o m v e r t i c e s V

    1

    t o V

    2

    w i t h t h e p r o p e r t y t h a t t h e e d g e s E

    1

    a r e m a p p e d t o d i s j o i n t

    p a t h s o f G

    2

    . ( T h e s e d i s j o i n t p a t h s i n G

    2

    r e p r e s e n t p o s s i b l e s u b d i v i s i o n s o f t h e e d g e s o f

    G

    1

    . ) T h e s e t o f h o m e o m o r p h i c e m b e d d i n g s b e t w e e n g r a p h s g i v e s a p a r t i a l o r d e r , c a l l e d t h e

    t o p o l o g i c a l o r d e r .

    A l o w e r i d e a l J i n a p a r t i a l o r d e r ( U ; ) i s a s u b s e t o f U s u c h t h a t i f X 2 J a n d X Y

    t h e n Y 2 J . T h e o b s t r u c t i o n s e t f o r J i s t h e s e t o f m i n i m a l e l e m e n t s o f U J .

    D e n i t i o n . A p a t h - d e c o m p o s i t i o n o f a g r a p h G = ( V ; E ) i s a s e q u e n c e X

    1

    ; X

    2

    ; : : : ; X

    r

    o f

    s u b s e t s o f V t h a t s a t i s f y t h e f o l l o w i n g t h r e e c o n d i t i o n s :

    1 .

    S

    1 i r

    X

    i

    = V ,

    2 . f o r e v e r y e d g e ( u ; v ) 2 E , t h e r e e x i s t s a n X

    i

    s u c h t h a t u 2 X

    i

    a n d v 2 X

    i

    , a n d

    3 . f o r 1 i < j < k r , X

    i

    \ X

    k

    X

    j

    .

    T h e p a t h w i d t h o f a p a t h - d e c o m p o s i t i o n X

    1

    ; X

    2

    ; : : : ; X

    r

    i s m a x

    1 i r

    j X

    i

    j 1 . T h e p a t h w i d t h

    o f a g r a p h G i s t h e m i n i m u m p a t h w i d t h o v e r a l l p a t h - d e c o m p o s i t i o n s o f G . D e t e r m i n i n g

    p a t h w i d t h i s e q u i v a l e n t t o s e v e r a l V L S I l a y o u t p r o b l e m s s u c h a s g a t e m a t r i x l a y o u t a n d

    v e r t e x s e p a r a t i o n M o h 9 0 , E S T 8 7 ] .

    I t i s e a s y t o s e e t h a t t h e f a m i l y o f g r a p h s o f p a t h w i d t h a t m o s t t i s a l o w e r i d e a l i n t h e

    t o p o l o g i c a l ( a n d m i n o r ) o r d e r . I t i s a l s o k n o w n t h a t t h o s e g r a p h s w i t h o r d e r n h a v e a t m o s t

    n t ( t

    2

    + t ) = 2 e d g e s .

    2

  • 7/28/2019 Alpro Waktu Linier

    3/9

    Tree-2Tree-(t+1)

    Tree-t

    Tree-tTree-t

    Tree-1

    1

    11

    111

    10

    101

    0

    F i g u r e 1 : E m b e d d i n g p a t h w i d t h t t r e e o b s t r u c t i o n s T r e e - t i n b i n a r y t r e e s .

    L e t B

    h

    d e n o t e t h e c o m p l e t e b i n a r y t r e e o f h e i g h t h a n d o r d e r 2

    h

    1 . L e t h ( t ) b e t h e

    l e a s t v a l u e o f h s u c h t h a t B

    h ( t )

    h a s p a t h w i d t h g r e a t e r t h a n t , a n d l e t f ( t ) b e t h e n u m b e r o f

    v e r t i c e s o f B

    h ( t )

    . T o g e t a b o u n d f o r f ( t ) , B

    h ( t )

    n e e d s t o c o n t a i n a t l e a s t o n e o b s t r u c t i o n o f

    p a t h w i d t h t . I n E S T 8 7 ] i t i s s h o w n t h a t a l l t o p o l o g i c a l t r e e o b s t r u c t i o n s o f p a t h w i d t h t c a n

    b e r e c u r s i v e l y g e n e r a t e d b y t h e f o l l o w i n g r u l e s .

    1 . T h e s i n g l e e d g e t r e e K

    2

    i s t h e o n l y o b s t r u c t i o n o f p a t h w i d t h 0 .

    2 . I f T

    1

    ; T

    2

    a n d T

    3

    a r e a n y 3 t r e e o b s t r u c t i o n s f o r p a t h w i d t h t t h e n t h e t r e e T c o n s i s t i n g

    o f a n e w d e g r e e 3 v e r t e x a t t a c h e d t o a n y v e r t e x o f T

    1

    ; T

    2

    a n d T

    3

    i s a t r e e o b s t r u c t i o n

    f o r p a t h w i d t h t + 1 .

    F r o m t h i s c h a r a c t e r i z a t i o n w e s e e t h a t t h e o r d e r s t h e t r e e o b s t r u c t i o n s o f p a t h w i d t h t

    a r e p r e c i s e l y ( 5 3

    t

    1 ) = 2 , ( e . g . , o r d e r s 2 ; 7 ; 2 2 a n d 5 7 f o r p a t h w i d t h t = 0 ; 1 ; 2 a n d 3 ) . W e c a n

    e a s i l y e m b e d a t l e a s t o n e o f t h e t r e e o b s t r u c t i o n s f o r p a t h w i d t h t , a s s h o w n i n F i g u r e 2 , i n t h e

    c o m p l e t e b i n a r y t r e e o f h e i g h t 2 t + 2 . T h u s , t h e c o m p l e t e b i n a r y t r e e o f o r d e r f ( t ) = 2

    2 t + 2

    1

    h a s p a t h w i d t h g r e a t e r t h a n t .

    3 P a t h w i d t h A l g o r i t h m

    U s i n g t h e f ( t ) b o u n d g i v e n i n t h e p r e v i o u s s e c t i o n , t h e m a i n r e s u l t o f t h e p a p e r n o w f o l l o w s :

    T h e o r e m 1 . L e t H b e a n a r b i t r a r y u n d i r e c t e d g r a p h , a n d l e t t b e a p o s i t i v e i n t e g e r . O n e

    o f t h e f o l l o w i n g t w o s t a t e m e n t s m u s t h o l d :

    ( a ) T h e p a t h w i d t h o f H i s a t m o s t f ( t ) 1 .

    ( b ) H c a n b e f a c t o r e d : H = A B , w h e r e A a n d B a r e b o u n d a r i e d g r a p h s w i t h b o u n d a r y

    s i z e f ( t ) , t h e p a t h w i d t h o f A i s g r e a t e r t h a n t a n d l e s s t h a n f ( t ) .

    3

  • 7/28/2019 Alpro Waktu Linier

    4/9

    P r o o f . W e d e s c r i b e a a l g o r i t h m t h a t t e r m i n a t e s e i t h e r w i t h a p a t h - d e c o m p o s i t i o n o f H o f

    w i d t h a t m o s t f ( t ) 1 , o r w i t h a p a t h - d e c o m p o s i t i o n o f a s u i t a b l e f a c t o r A w i t h t h e l a s t

    v e r t e x s e t o f t h e d e c o m p o s i t i o n c o n s i s t i n g o f t h e b o u n d a r y v e r t i c e s .

    I f w e n d a n h o m e o m o r p h i c e m b e d d i n g o f t h e g u e s t t r e e B

    h ( t )

    i n t h e h o s t g r a p h H t h e n w e

    k n o w t h a t t h e p a t h w i d t h o f H i s g r e a t e r t h a n t . D u r i n g t h e s e a r c h f o r s u c h a n e m b e d d i n g ,

    w e w o r k w i t h a p a r t i a l e m b e d d i n g . W e r e f e r t o t h e v e r t i c e s o f B

    h ( t )

    a s t o k e n s , a n d c a l l

    t o k e n s p l a c e d o r u n p l a c e d a c c o r d i n g t o w h e t h e r o r n o t t h e y a r e m a p p e d t o v e r t i c e s o f H i n

    t h e c u r r e n t p a r t i a l e m b e d d i n g . A v e r t e x v o f H i s t o k e n e d i f a t o k e n m a p s t o v . A t m o s t

    o n e t o k e n c a n b e p l a c e d o n a v e r t e x o f H a t a n y g i v e n t i m e . W e r e c u r s i v e l y l a b e l t h e t o k e n s

    b y t h e f o l l o w i n g s t a n d a r d r u l e s :

    1 . T h e r o o t t o k e n i s l a b e l e d b y t h e e m p t y s t r i n g .

    2 . T h e l e f t c h i l d t o k e n a n d r i g h t c h i l d t o k e n o f a h e i g h t h p a r e n t t o k e n P = b

    1

    b

    2

    b

    h

    a r e

    l a b e l e d P 1 a n d P 0 , r e s p e c t i v e l y .

    L e t P i ] d e n o t e t h e s e t o f v e r t i c e s o f H t h a t h a v e a t o k e n a t t i m e s t e p i . T h e s e q u e n c e

    P 0 ] ; P 1 ] ; : : : ; P s ] w i l l d e s c r i b e a p a t h - d e c o m p o s i t i o n e i t h e r o f t h e e n t i r e t y o f H o r o f a

    f a c t o r A f u l l l i n g t h e c o n d i t i o n s o f T h e o r e m 1 . I n t h e c a s e o f o u t c o m e ( b ) t h e b o u n d a r y o f

    t h e f a c t o r A i s i n d i c a t e d b y P s ] .

    T h e p l a c e m e n t a l g o r i t h m i s d e s c r i b e d a s f o l l o w s . I n i t i a l l y c o n s i d e r t h a t e v e r y v e r t e x o f

    H i s c o l o r e d b l u e . I n t h e c o u r s e o f t h e a l g o r i t h m a v e r t e x o f H h a s i t s c o l o r c h a n g e d t o r e d

    w h e n a t o k e n i s p l a c e d o n i t , a n d s t a y s r e d i f t h e t o k e n i s r e m o v e d . O n l y b l u e v e r t i c e s c a n

    b e t o k e n e d , a n d s o a v e r t e x c a n o n l y b e t o k e n e d o n c e .

    f u n c t i o n G r o w T o k e n T r e e

    1 i f r o o t t o k e n i s n o t p l a c e d o n H t h e n

    a r b i t r a r i l y p l a c e o n a b l u e v e r t e x o f H

    e n d i f

    2 w h i l e t h e r e i s a v e r t e x u 2 H w i t h t o k e n T a n d b l u e n e i g h b o r v ,

    a n d t o k e n T h a s a n u n p l a c e d c h i l d T b d o

    2 . 1 p l a c e t o k e n T b o n v

    e n d w h i l e

    3 r e t u r n f t o k e n e d v e r t i c e s o f H g

    p r o g r a m P a t h D e c o m p o s i t i o n O r S m a l l F a t F a c t o r

    1 i 0

    2 P i ] c a l l G r o w T o k e n T r e e

    3 u n t i l j P i ] j = f ( t ) o r H h a s n o b l u e v e r t i c e s r e p e a t

    3 . 1 p i c k a t o k e n T w i t h u n t o k e n e d c h i l d r e n

    3 . 2 r e m o v e T f r o m H

    3 . 3 i f T h a d o n e t o k e n e d c h i l d t h e n

    4

  • 7/28/2019 Alpro Waktu Linier

    5/9

    r e p l a c e a l l t o k e n s T b S w i t h T S

    e n d i f

    3 . 4 i i + 1

    3 . 5 P i ] c a l l G r o w T o k e n T r e e

    e n d u n t i l

    d o n e

    B e f o r e w e p r o v e t h e c o r r e c t n e s s o f t h e a l g o r i t h m , w e n o t e s o m e p r o p e r t i e s : ( 1 ) t h e r o o t

    t o k e n w i l l n e e d t o b e p l a c e d ( s t e p 1 o f t h e G r o w T o k e n T r e e ) a t m o s t o n c e f o r e a c h c o m p o n e n t

    o f H ; ( 2 ) t h e G r o w T o k e n T r e e f u n c t i o n o n l y r e t u r n s w h e n B

    h ( t )

    h a s b e e n e m b e d d e d i n H o r a l l

    p a r e n t t o k e n s o f d e g r e e l e s s t h a n 2 h a v e n o b l u e n e i g h b o r s ; ( 3 ) t h e a l g o r i t h m w i l l t e r m i n a t e

    s i n c e d u r i n g e a c h i t e r a t i o n o f s t e p 3 . 2 a t o k e n e d r e d v e r t e x b e c o m e s u n t o k e n e d , a n d t h i s c a n

    h a p p e n a t m o s t n t i m e s , w h e r e n d e n o t e s t h e o r d e r o f t h e h o s t H .

    S i n c e t o k e n s a r e p l a c e d o n l y o n b l u e v e r t i c e s a n d a r e r e m o v e d o n l y f r o m r e d v e r t i c e s ,

    i t f o l l o w s t h a t t h e i n t e r p o l a t i o n p r o p e r t y o f a p a t h - d e c o m p o s i t i o n i s s a t i s e d . S u p p o s e t h e

    a l g o r i t h m t e r m i n a t e s a t t i m e s w i t h a l l o f t h e v e r t i c e s c o l o r e d r e d . T o s e e t h a t t h e s e q u e n c e

    o f v e r t e x s e t s P 0 ] ; : : : ; P s ] r e p r e s e n t s a p a t h - d e c o m p o s i t i o n o f H , i t r e m a i n s o n l y t o v e r i f y

    t h a t f o r e a c h e d g e ( u ; v ) o f H t h e r e i s a t i m e i w i t h b o t h v e r t i c e s u a n d v i n P i ] . S u p p o s e

    v e r t e x u i s t o k e n e d r s t a n d u n t o k e n e d b e f o r e v i s t o k e n e d . B u t v e r t e x u c a n b e u n t o k e n e d

    o n l y i f a l l n e i g h b o r s , i n c l u d i n g v e r t e x v , a r e c o l o r e d r e d ( s e e s t e p 3 . 1 a n d c o m m e n t ( 2 ) a b o v e ) .

    S u p p o s e t h e a l g o r i t h m t e r m i n a t e s w i t h a l l t o k e n s p l a c e d . T h e a r g u m e n t a b o v e e s t a b -

    l i s h e s t h a t t h e s u b g r a p h A o f H i n d u c e d b y t h e r e d v e r t i c e s , w i t h b o u n d a r y s e t P s ] h a s

    p a t h w i d t h a t m o s t f ( t ) . T o c o m p l e t e t h e p r o o f w e a r g u e t h a t i n t h i s c a s e t h e s e q u e n c e o f

    t o k e n p l a c e m e n t s e s t a b l i s h e s t h a t A c o n t a i n s a s u b d i v i s i o n o f B

    h ( t )

    , a n d h e n c e m u s t h a v e

    p a t h w i d t h g r e a t e r t h a n t . S i n c e t h e G r o w T o k e n T r e e f u n c t i o n o n l y a t t a c h e s p e n d a n t t o k e n s

    t o p a r e n t t o k e n s w e n e e d t o o n l y t o o b s e r v e t h a t t h e o p e r a t i o n i n s t e p 3 . 3 s u b d i v i d e s t h e

    e d g e b e t w e e n T a n d i t s p a r e n t . 2

    C o r o l l a r y 1 . G i v e n a g r a p h H o f o r d e r n a n d a n i n t e g e r t , t h e r e e x i s t s a O ( n ) t i m e

    a l g o r i t h m t h a t g i v e s e v i d e n c e t h a t t h e p a t h w i d t h o f H i s g r e a t e r t h a n t o r n d s a p a t h -

    d e c o m p o s i t i o n o f w i d t h a t m o s t O ( 2

    t

    ) .

    P r o o f . W e s h o w t h a t p r o g r a m P a t h D e c o m p o s i t i o n O r S m a l l F a t F a c t o r r u n s i n l i n e a r t i m e .

    F i r s t , i f H h a s m o r e t h a n t n e d g e s , t h e n t h e p a t h w i d t h o f H i s g r e a t e r t h a n t . B y t h e p r o o f

    o f T h e o r e m 1 , t h e p r o g r a m t e r m i n a t e s w i t h e i t h e r t h e e m b e d d e d b i n a r y t r e e a s e v i d e n c e , o r

    a p a t h - d e c o m p o s i t i o n o f w i d t h a t m o s t f ( t ) .

    N o t e t h a t t h e g u e s t t r e e B

    h ( t )

    h a s c o n s t a n t o r d e r f ( t ) , a n d s o t o k e n o p e r a t i o n s t h a t d o

    n o t i n v o l v e s c a n n i n g H a r e c o n s t a n t t i m e . I n f u n c t i o n G r o w T o k e n T r e e , t h e o n l y n o n - c o n s t a n t

    t i m e o p e r a t i o n i s t h e c h e c k f o r b l u e n e i g h b o r s i n s t e p 2 . W h i l e s c a n n i n g t h e a d j a c e n t e d g e s

    o f v e r t e x u a n y e d g e t o a r e d v e r t e x c a n b e r e m o v e d , i n c o n s t a n t t i m e . E d g e ( u ; v ) i s a l s o

    r e m o v e d w h e n s t e p 2 . 1 i s e x e c u t e d . T h e r e f o r e , a c r o s s a l l c a l l s t o G r o w T o k e n T r e e , e a c h e d g e

    o f H n e e d s t o b e c o n s i d e r e d a t m o s t o n c e , f o r a t o t a l o f O ( n ) s t e p s . I n p r o g r a m P a t h D e -

    c o m p o s i t i o n O r S m a l l F a t F a c t o r , a l l s t e p s e x c e p t f o r G r o w T o k e n T r e e a r e c o n s t a n t t i m e . T h e

    5

  • 7/28/2019 Alpro Waktu Linier

    6/9

    t o t a l n u m b e r o f i t e r a t i o n s t h r o u g h t h e l o o p i s b o u n d e d b y n , b y t h e t e r m i n a t i o n a r g u m e n t

    f o l l o w i n g t h e p r o g r a m . 2

    T h e n e x t r e s u l t s h o w s t h a t w e c a n i m p r o v e t h e p a t h w i d t h a l g o r i t h m b y r e s t r i c t i n g t h e

    g u e s t t r e e . T h i s a l l o w s u s t o u s e t h e s u b d i v i d e d t r e e o b s t r u c t i o n s g i v e n i n F i g u r e 2 .

    C o r o l l a r y 2 . A n y s u b t r e e o f t h e b i n a r y t r e e B

    h ( t )

    t h a t h a s p a t h w i d t h g r e a t e r t h a n t m a y

    b e u s e d i n t h e a l g o r i t h m f o r T h e o r e m 1 .

    P r o o f . T h e f o l l o w i n g s i m p l e m o d i c a t i o n s a l l o w t h e a l g o r i t h m t o o p e r a t e w i t h a s u b t r e e .

    T h e s u b t r e e i s s p e c i e d b y a s e t o f a g g e d t o k e n s i n B

    h ( t )

    . A t w o r s t , t h e a l g o r i t h m c a n

    p o t e n t i a l l y e m b e d a l l o f B

    h ( t )

    .

    I n s t e p 2 o f G r o w T o k e n T r e e , t h e a l g o r i t h m o n l y l o o k s f o r a a g g e d u n t o k e n e d c h i l d T b

    t o p l a c e , s i n c e u n a g g e d t o k e n s n e e d n o t b e p l a c e d . T h e s t o p p i n g c o n d i t i o n i n s t e p 3 o f

    P a t h D e c o m p o s i t i o n O r S m a l l F a t F a c t o r i s c h a n g e d t o \ a l l a g g e d t o k e n s o f B

    h ( t )

    a r e p l a c e d o r

    : : : , " s o t h a t t e r m i n a t i o n o c c u r s a s s o o n a s t h e s u b t r e e h a s b e e n e m b e d d e d . T h e r e l a b e l i n g

    i n s t e p 3 . 3 c a n p l a c e u n a g g e d t o k e n s o n v e r t i c e s o f H s i n c e a l l t h e r o o t e d s u b t r e e s o f a x e d

    h e i g h t a r e n o t i s o m o r p h i c . I f t h a t h a p p e n s , w e e x p a n d o u r g u e s t t r e e w i t h t h o s e n e w t o k e n s .

    ( I t i s e a s y t o s e e t h a t t h e n e w g u e s t i s s t i l l a t r e e . ) T h e s e t o k e n s c a n t h e n g e t r e l a b e l e d b y

    f u t u r e e d g e s u b d i v i s i o n s t h a t o c c u r a b o v e t h e t o k e n i n t h e h o s t t r e e . T h u s , d u p l i c a t i o n o f

    t o k e n l a b e l s w i l l n o t h a p p e n , a n d t h e f ( t ) w i d t h b o u n d i s p r e s e r v e d . 2

    E x a m p l e . U s i n g K

    1 ; 3

    a s t h e g u e s t t r e e o f p a t h w i d t h 2 t h e f o l l o w i n g p r o g r a m t r a c e

    t e r m i n a t e s w i t h a l l v e r t i c e s c o l o r e d r e d ( g r a y ) y i e l d i n g a p a t h - d e c o m p o s i t i o n o f w i d t h 5 .

    a

    b

    c d

    e

    f g

    h

    i

    0

    1

    10

    10110

    a

    b

    c d

    e

    f g

    h

    i

    0

    1

    101

    a

    b

    c d

    e

    f g

    h

    i

    0

    1

    10

    101 a

    b

    c d

    e

    f g

    h

    i

    0

    1

    10

    11

    P[0] = {a,b,c,d,e} P[1] = ( P[0] \ {c} ) {g,f}

    P[2] = P[1] \ {f}

    P[3] = ( P[2] \ {d} ) {h} P[4] = ( P[3] \ {e} ) {i}

    11

    I n t h e p r o o f o f C o r o l l a r y 2 o n e m a y w i s h t o n o t e x p a n d t h e g u e s t t r e e b y a g g i n g n e w

    t o k e n s . T h i s c a n b e d o n e a n d , i n f a c t , i s w h a t w e w o u l d d o i n p r a c t i c e . W i t h o u t l o s s o f

    6

  • 7/28/2019 Alpro Waktu Linier

    7/9

    g e n e r a l i t y , s u p p o s e t o k e n T 1 i s o n v e r t e x u 2 H a n d h a s c h i l d r e n t h a t c a n n o t b e p l a c e d

    o n H , a n d T 1 h a s o n e u n a g g e d s i b l i n g t o k e n T 0 o n v 2 H . I f w e i g n o r e t h e a g g i n g

    o f n e w v e r t i c e s i n t h e c u r r e n t a l g o r i t h m , t h e t o k e n T 1 w o u l d b e r e m o v e d a n d t h e p a r e n t

    T ( w h i c h h a s o n l y o n e l e g i t i m a t e c h i l d ) w o u l d b e p l a c e d o n v e r t e x u . W h a t h a p p e n s t o a n y

    b l u e v e r t i c e s o f a d j a c e n t t o o n l y v e r t e x u ( o r i t s u n a g g e d s u b t r e e ) ? T h e a n s w e r i s t h a t t h e y

    a r e l o s t a n d t h e a l g o r i t h m w o u l d n o t t e r m i n a t e u n l e s s i t c o u l d e m b e d t h e g u e s t t r e e i n t h e

    r e m a i n i n g p o r t i o n o f H . W e c a n x t h i s p r o b l e m b y c h e c k i n g f o r u n a g g e d s i b l i n g s b e f o r e

    s t e p 3 . 3 a n d t o s h i f t t h e t o k e n T 1 f r o m u t o v . S e e s t e p 3 : 3

    0

    b e l o w .

    3 : 3

    0

    i f T = P b h a d a n u n a g g e d s i b l i n g t h e n

    r e p l a c e a l l t o k e n s P b S w i t h P n o t ( b ) S

    e l s e i f T h a d o n e t o k e n e d c h i l d t h e n

    r e p l a c e a l l t o k e n s T b S w i t h T S

    e n d i f

    4 F u r t h e r D i r e c t i o n s

    I n t h e c a s e t h a t t h e p a t h w i d t h o f a n i n p u t g r a p h G i s a t m o s t k , o u r a l g o r i t h m y i e l d s a

    p a t h - d e c o m p o s i t i o n t h a t c a n h a v e a w i d t h e x p o n e n t i a l i n k , b u t t h a t i s e q u a l i n a n y c a s e t o

    t h e m a x i m u m n u m b e r o f t o k e n s p l a c e d o n t h e g r a p h a t a n y g i v e n t i m e , m i n u s 1 . I t w o u l d b e

    i n t e r e s t i n g t o k n o w i f t h i s e x p o n e n t i a l b a d b e h a v i o r i s \ n o r m a l " o r w h e t h e r t h e a l g o r i t h m

    t e n d s t o u s e a s m a l l e r n u m b e r o f t o k e n s i n p r a c t i c e . S i n c e t h e p e b b l i n g p r o c e e d s a c c o r d i n g t o

    a g r e e d y s t r a t e g y w i t h m u c h e x i b i l i t y , t h e r e m a y b e p l a c e m e n t h e u r i s t i c s t h a t c a n i m p r o v e

    i t s p e r f o r m a n c e o n \ t y p i c a l " i n s t a n c e s .

    R e f e r e n c e s

    A r n 8 5 ] S . A r n b o r g . E c i e n t a l g o r i t h m s f o r c o m b i n a t o r i a l p r o b l e m s o n g r a p h s w i t h

    b o u n d e d d e c o m p o s a b i l i t y | a s u r v e y . B I T 2 5 ( 1 9 8 5 ) , 2 { 2 3 .

    A L S 9 1 ] S . A r n b o r g , J . L a g e r g r e n a n d D . S e e s e . E a s y p r o b l e m s f o r t r e e - d e c o m p o s a b l e

    g r a p h s . J . A l g o r i t h m s 1 2 ( 1 9 9 1 ) , 3 0 8 { 3 4 0 .

    A P 8 9 ] S . A r n b o r g a n d A . P r o s k u r o w s k i . L i n e a r a l g o r i t h m s f o r N P - h a r d p r o b l e m s r e s t r i c t e d

    t o p a r t i a l k - t r e e s . D i s c . A p p l . M a t h . 2 3 ( 1 9 8 9 ) , 1 1 { 2 4 .

    B F W 9 2 ] H . L . B o d l a e n d e r , M . R . F e l l o w s a n d T . J . W a r n o w . T w o s t r i k e s a g a i n s t p e r f e c t

    p h y l o g e n y . I n P r o c e e d i n g s 1 9 t h I n t e r n a t i o n a l C o l l o q u i u m o n A u t o m a t a , L a n g u a g e s

    a n d P r o g r a m m i n g , p a g e s 2 7 3 { 2 8 3 . S p r i n g e r V e r l a g , L e c t u r e N o t e s i n C o m p u t e r

    S c i e n c e , v o l . 6 2 3 , 1 9 9 2 .

    B o d 8 8 a ] H . L . B o d l a e n d e r . D y n a m i c p r o g r a m m i n g a l g o r i t h m s o n g r a p h s w i t h b o u n d e d t r e e -

    w i d t h . I n P r o c e e d i n g s o f t h e 1 5 t h I n t e r n a t i o n a l C o l l o q u i u m o n A u t o m a t a , L a n g u a g e s

    7

  • 7/28/2019 Alpro Waktu Linier

    8/9

    a n d P r o g r a m m i n g , p a g e s 1 0 5 { 1 1 9 . S p r i n g e r V e r l a g , L e c t u r e N o t e s i n C o m p u t e r

    S c i e n c e , v o l . 3 1 7 , 1 9 8 8 .

    B o d 8 8 b ] H . L . B o d l a e n d e r . S o m e c l a s s e s o f g r a p h s w i t h b o u n d e d t r e e w i d t h . B u l l e t i n o f t h e

    E A T C S 3 6 ( 1 9 8 8 ) , 1 1 6 { 1 2 6 .

    B o d 9 2 ] H . L . B o d l e a n d e r . A t o u r i s t g u i d e t h r o u g h t r e e w i d t h . T e c h n i c a l R e p o r t R U U - C S -

    9 2 - 1 2 , D e p t . C o m p u t e r S c i e n c e , U n i v . U t r e c h t , T h e N e t h e r l a n d s , M a r c h 1 9 9 2 .

    B o d 9 3 ] H . L . B o d l a e n d e r . A l i n e a r t i m e a l g o r i t h m f o r n d i n g t r e e - d e c o m p o s i t i o n s o f s m a l l

    t r e e w i d t h . I n P r o c e e d i n g s o f t h e 2 5 t h A C M S y m p o s i u m o n T h e o r y o f C o m p u t i n g ,

    p a g e s 2 2 6 { 2 3 4 , 1 9 9 3 .

    B K 9 1 ] H . L . B o d l a e n d e r a n d T . K l o k s . B e t t e r a l g o r i t h m s f o r t h e p a t h w i d t h a n d t r e e w i d t h

    o f g r a p h s . I n P r o c e e d i n g s o f t h e 1 8 t h I n t e r n a t i o n a l C o l l o q u i u m o n A u t o m a t a , L a n -

    g u a g e s a n d P r o g r a m m i n g , p a g e s 5 4 4 { 5 5 5 . S p r i n g e r V e r l a g , L e c t u r e N o t e s i n C o m -

    p u t e r S c i e n c e , v o l . 5 1 0 , 1 9 9 1 .

    B P T 9 2 ] R . B . B o r i e , R . G . P a r k e r a n d C . A . T o v e y . A u t o m a t i c g e n e r a t i o n o f l i n e a r - t i m e

    a l g o r i t h m s f r o m p r e d i c a t e c a l c u l u s d e s c r i p t i o n s o f p r o b l e m s o n r e c u r s i v e l y c o n -

    s t r u c t e d g r a p h f a m i l i e s . A l g o r i t h m i c a 7 ( 1 9 9 2 ) , 5 5 5 { 5 8 2 .

    C M 9 3 ] B . C o u r c e l l e a n d M . M o s b a h . M o n a d i c s e c o n d - o r d e r e v a l u a t i o n s o n t r e e - d e c o m p o s -

    a b l e g r a p h s . T h e o r . C o m p . S c . 1 0 9 ( 1 9 9 3 ) , 4 9 { 8 2 .

    E S T 8 7 ] J . E l l i s , I . H . S u d b o r o u g h , a n d J . T u r n e r . G r a p h s e p a r a t i o n a n d s e a r c h n u m b e r .

    R e p o r t D C S - 6 6 - I R , D e p t . o f C o m p u t e r S c i e n c e , U n i v e r s i t y o f V i c t o r i a , A u g u s t

    1 9 8 7 . T o a p p e a r i n I n f o r m a t i o n a n d C o m p u t a t i o n , 1 9 9 4 .

    F H W 9 3 ] M . R . F e l l o w s , M . T . H a l l e t t a n d H . T . W a r e h a m . D N A p h y s i c a l m a p p i n g : t h r e e

    w a y s d i c u l t . I n P r o c c e d i n g s o f t h e F i r s t E u r o p e a n S y m p o s i u m o n A l g o r i t h m s ,

    p a g e s 1 5 7 { 1 6 8 . S p r i n g e r V e r l a g , L e c t u r e N o t e s i n C o m p u t e r S c i e n c e , v o l . 7 2 6 , 1 9 9 3 .

    F L 9 2 ] M . R . F e l l o w s a n d M . A . L a n g s t o n . O n w e l l - p a r t i a l - o r d e r t h e o r y a n d i t s a p p l i c a t i o n

    t o c o m b i n a t o r i a l p r o b l e m s o f V L S I d e s i g n . S I A M J o u r n a l o n D i s c r e t e M a t h e m a t i c s

    5 ( 1 9 9 2 ) , 1 1 7 { 1 2 6 .

    F L 8 9 a ] M . R . F e l l o w s a n d M . A . L a n g s t o n . O n s e a r c h , d e c i s i o n a n d t h e e c i e n c y

    o f p o l y n o m i a l - t i m e a l g o r i t h m s . P r o c . S y m p o s i u m o n t h e T h e o r y o f C o m p u t i n g

    ( S T O C ) , A C M P r e s s ( 1 9 8 9 ) , 5 0 1 { 5 1 2 .

    K l 9 3 ] T . K l o k s . T r e e w i d t h . P h D t h e s i s , U t r e c h t U n i v e r s i t y , U t r e c h t , t h e N e t h e r l a n d s ,

    1 9 9 3 .

    K T 9 2 ] A . K o r n a i a n d Z . T u z a . N a r r o w n e s s , p a t h w i d t h , a n d t h e i r a p p l i c a t i o n i n n a t u r a l

    l a n g u a g e p r o c e s s i n g . D i s c r e t e A p p l i e d M a t h e m a t i c s , 3 6 ( 1 9 9 2 ) , p p . 8 7 { 9 2 .

    L a 9 0 ] J . L a g e r g r e n . E c i e n t p a r a l l e l a l g o r i t h m s f o r t r e e - d e c o m p o s i t i o n a n d r e l a t e d p r o b -

    l e m s . I n P r o c e e d i n g s o f t h e 3 1 s t S y m p o s i u m o n F o u n d a t i o n s o f C o m p u t e r S c i e n c e ,

    p a g e s 1 7 3 { 1 8 2 , 1 9 9 0 .

    M o h 9 0 ] R . H . M o h r i n g . G r a p h p r o b l e m s r e l a t e d t o g a t e m a t r i x l a y o u t a n d P L A f o l d i n g .

    I n E . M a y r , H . N o l t e m e i e r a n d M . S y s l o , e d i t o r s , C o m p u t a t i o n a l G r a p h T h e o r y ,

    c o m p u t i n g S u p p l . 7 , p a g e s 1 7 { 5 1 . S p r i n g e r V e r l a g , 1 9 9 0 .

    8

  • 7/28/2019 Alpro Waktu Linier

    9/9

    R e 9 2 ] B R e e d . F i n d i n g a p p r o x i m a t e s e p a r a t o r s a n d c o m p u t i n g t r e e - w i d t h q u i c k l y . I n P r o -

    c e e d i n g s o f t h e 2 4 t h A n n u a l S y m p o s i u m o n T h e o r y o f C o m p u t i n g , p a g e s 2 2 1 { 2 2 8 ,

    1 9 9 2 .

    R S 8 3 ] N . R o b e r t s o n a n d P . D . S e y m o u r . G r a p h M i n o r s . I . E x c l u d i n g a f o r e s t . J o u r n a l o f

    C o m b i n a t o r i a l T h e o r y , S e r i e s B , 3 5 ( 1 ) : 3 9 { 6 1 , 1 9 8 3 .

    R S 8 6 a ] N . R o b e r t s o n a n d P . D . S e y m o u r . G r a p h m i n o r s I I : a l g o r i t h m i c a s p e c t s o f t r e e w i d t h .

    J . A l g o r i t h m s 7 ( 1 9 8 6 ) , 3 0 9 { 3 2 2 .

    R S 9 0 ] N . R o b e r t s o n a n d P . D . S e y m o u r . G r a p h m i n o r s I V : t r e e - w i d t h a n d w e l l - q u a s i -

    o r d e r i n g . J . C o m b . T h e o r y S e r i e s B 4 8 ( 1 9 9 0 ) , 2 2 7 { 2 5 4 .

    R S 9 1 ] N . R o b e r t s o n a n d P . D . S e y m o u r . G r a p h m i n o r s X : o b s t r u c t i o n s t o t r e e - d e c o m p o s -

    i t i o n . J . C o m b . T h e o r y S e r i e s B 5 2 ( 1 9 9 1 ) , 1 5 3 { 1 9 0 .

    R S 8 6 b ] N . R o b e r t s o n a n d P . D . S e y m o u r . G r a p h m i n o r s X I I I : t h e d i s j o i n t p a t h s p r o b l e m .

    M a n u s c r i p t , 1 9 8 6 .

    R S ] N . R o b e r t s o n a n d P . D . S e y m o u r . G r a p h m i n o r s X V I : W a g n e r ' s c o n j e c t u r e . J .

    C o m b . T h . S e r . B , t o a p p e a r .

    W i 8 7 ] T . V . W i m e r . L i n e a r a l g o r i t h m s o n k - t e r m i n a l g r a p h s . P h . D . d i s s e r t a t i o n , D e p t . o f

    C o m p u t e r S c i e n c e , C l e m s o n U n i v e r s i t y , A u g u s t 1 9 8 7 .

    W H L 8 5 ] T . V . W i m e r , S . T . H e d e t n i e m i a n d R . L a s k a r . A m e t h o d o l o g y f o r c o n s t r u c t i n g

    l i n e a r g r a p h a l g o r i t h m s . C o n g r e s s u s N u m e r a n t i u m 5 0 ( 1 9 8 5 ) , 4 3 { 6 0 .

    9