• No results found

Dynamic algorithms for chordal and interval graphs

N/A
N/A
Protected

Academic year: 2021

Share "Dynamic algorithms for chordal and interval graphs"

Copied!
129
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

INFORMATION TO USERS

This m anuscript h as been reproduced from the microfilm m aster. UMl films the text directly from the original or copy submitted. Thus, so m e thesis and dissertation copies are in typewriter face, while others may be from any type of com puter printer.

T he quality o f th is rep ro d u ctio n is d e p e n d e n t upon th e q u ality o f th e co p y su b m itte d . Broken or indistinct print, colored or poor quality illustrations and photographs, print bleed through, substandard margins, and improper alignment can adversely affect reproduction.

In the unlikely event that the author did not send UMl a com plete m anuscript and there are missing pages, th e se will be noted. Also, if unauthorized copyright material had to be removed, a note will indicate the deletion.

Oversize materials (e.g., m aps, drawings, charts) are reproduced by sectioning the original, beginning at the upper left-hand com er and continuing from left to right in equal sections with small overlaps.

Photographs included in the original manuscript have b een reproduced xerographically in this copy. Higher quality 6" x 9" black and white photographic prints are available for any photographs or illustrations appearing in this copy for an additional charge. Contact UMl directly to order.

ProQ uest Information and Learning

300 North Zeeb Road, Ann Arbor, Ml 48106-1346 USA 800-521-0600

(2)
(3)

Dynamic Algorithms for Chordal and Interval Graphs

by-Louis W a lte r Ibarra

B.S.. Jo h n s Hopkins University. 1988 M.S., University of \ l r g i n i a . 1990

A D issertation S u b m it te d in P a rtia l Fulfillment of t h e

R e q u ire m en ts for th e Degree of D O C T O R O F P H IL O S O P H Y in th e D e p a r tm e n t of C o m p u te r Science We accept this d iss e rta tio n as conform ing

to th e req u ired s ta n d a r d

Dr. Valerie King, Supervisor (D ept, of C o m p u t e r Science)

— Dr. J o h n Ellis. D e p a r tm e n ta l M e m b e r (D e p t, of C o m p u t e r Science)

. Michael rellows. D snA rtm ental Memh

D r. Michael rellows. D snA rtm ental M e m b e r (D ept, of C o m p u t e r Science)

Dr. J in g m ia n g . O u ts id e M e m b e r (D ept, of M a th e m a tic s )

Dr. Pavol Hell. E x t e r n a l/ E x a m in e r (School of C o m p u tin g Science. Sim on Fraser U niversity)

0 Louis W a lter Ibarra, 2001 University o f V ictoria

Al l rights reserved. This dissertation m a y not be reproduced in whole or in part, by photocopying or other means, without the permission o f the author.

(4)

A B S T R A C T

We present t h e first d y n a m ic a lg o r ith m t h a t m a in ta in s a clique t re e r e p r e s e n ta tio n of a chordal g r a p h a n d s u p p o rts th e following operations: (1) query w h e t h e r de le ting or inserting a n a r b i t r a r y edge preserves chordality. (2) delete or insert a n a r b i t r a r y edge, provided it preserves chordality. We give two im p le m e n ta tio n s . In th e first, e ach o p e ra tio n runs in 0 ( n ) tim e, w here n is the n u m b e r of vertices. In t h e second, a n insertion query runs in 0 ( lo g ^ n) t im e , an insertion in 0 { n ) tim e, a d e le tio n query in 0 ( n ) tim e, a n d a dele tio n in 0 ( n log n) time.

We also in tro d u c e t h e c liq u e -s e p a ra to r graph r e p re s e n ta tio n of a c h o rd a l g raph, which provides significantly m ore in fo rm a tio n a b o u t t h e g r a p h 's s t r u c t u r e t h a n th e well-known clique tree r e p r e s e n ta tio n . We present fu n d a m e n ta l p ro p e r tie s o^ the c lique-separator g r a p h a n d a d d itio n a l properties when th e in p u t g r a p h is interval. We th e n in tro d u c e th e t r a i n tre e r ep re s en ta tio n of interval g rap h s a n d use it to decide w h e th e r th e re is a c e rtain linear ord erin g of the g r a p h 's m a x im a l cliques. T h is yields a fully d y n a m ic a lg o rith m to recognize interval g rap h s in O ( n l o g n ) t i m e per edge insertion or deletion. T h e c liq u e -s e p a ra to r graph m a y lead to d y n a m ic a lg o r ith m s for every pro p er subclass of c hordal g rap h s, an d the tra in tre e m a y lead to fast d y n a m ic a lg o rith m s for problem s on interval graphs.

E xam iners:

Dr. Valerie King, S up e rv iso r (D e p t, o f C o m p u te r Science)

(5)

Ill

Dr. M ichael Fellows. D e p a r tm e n ta l M e m b e r (D e p t, of C o m p u t e r Science)

Dr. J in g H u a n g . O u ts id e \ I ^ b e r (D e pt, of .M athem atics)

Dr. Pavol Hell. E x te rn a l E xam iner (School of C o m p u tin g Science. Sim on Fraser University)

(6)

A b str a ct ii

C o n ten ts iv

L ist o f figures vii

1 In tro d u ctio n 1 1.1 D ynam ic g r a p h a l g o r i t h m s ... I 1.2 C hordal g r a p h s ... 3 1.3 Interval graphs ... 9 1.4 O t h e r classes ... 11 1.5 R e s u l t s ... 12

2 A d y n a m ic alg o rith m for chordal graphs 14 2.1 I n t r o d u c t i o n ... 14

2.2 Clique t r e e s ... 15

2.3 T h e d y n a m ic a lg o r ith m for chordal g r a p h s ... IS 2.3.1 D e l e t e - Q u e r y ... IS 2.3.2 D e l e t e ... 19

2.3.3 I n s e r t - Q u e r y ... 22

2.3.4 Insert ... 24

(7)

2.4 F irs t i m p l e m e n t a t i o n ... 26

2.4.1 C o n n e c te d c o m p o n e n t s ... 27

2.5 Second i m p l e m e n t a t i o n ... 27

2.5.1 C o m p u t in g th e w e i g h t s ... 28

2.6 C onclusions a n d open p r o b l e m s ... 29

3 A d y n a m ic a lg o rith m for interval graphs 31 3.1 I n t r o d u c t i o n ... 31

3.2 T h e c liq u e -se p a ra to r graph of a chordal g r a p h ... 33

3.2.1 T h e clique -se pa ra tor g r a p h ... 34

3.2.2 D e f i n i t i o n s ... 37

3.2.3 T h e M ain T h e o r e m ... 38

3.3 T h e c liq u e -s e p a ra to r graph of an interval g ra p h ... 45

3.3.1 Relevance of ^ ... 45 3.3.2 S t r u c t u r e and size ol Ç ... 46 3.4 T h e t r a in t r e e ... 50 3.4.1 P Q - t r e e s ... 50 3.4.2 T rain t r e e s ... 50 3.4.3 P r o p e rtie s of tra in t r e e s ... 54

3.4.4 P re v ie w of the tra in tree a l g o r i t h m ... 60

3.4.5 T h e O rd e rin g L e m m a ... 61 3.5 Deciding w h e th e r a g ra p h is interval ... 64 3.5.1 O verview ... 64 3.5.2 T h e t r a i n tree a l g o r i t h m ... 65 3.5.3 C o rrec tn ess a n d c o m p l e x i t y ... 71 3.5.4 C o m p u t in g a clique p a t h ... 81 3.6 U p d a t e s ... 82

(8)

3.6.1 Insert ... S2

3.6.2 Insert c o r r e c t n e s s ... 90

3.6.3 D e l e t e ... 92

3.6.4 Delete c o r r e c t n e s s ... 102

3.7 C o m p u t in g the cliq u e -se p a ra to r g r a p h ... 108

3.8 Conclusions a n d f u tu r e w o r k ... 110

(9)

List o f Figures

1.1...g r a p h ... 4

2.1 . \ chordal g r a p h G ... 16

2.2 clique t re e T of t h e grap h in Figure 1.1... 17

2.3 Deleting {u. ü} from A 'j... 19

2.4 Before dele tin g {u. e } ... 20

2..5 Deleting {u...t'}... 21

2.6 Clique tre e T ... 24

2.7 Inserting {u. I’} ... 2-i 2.8 .Adding n o d e z t o T ... 26 3.1 .A g r a p h ... 34 3.2 .A chordal g r a p h G ... 3-5 3.3 T h e c liq u e -s e p a ra to r g r a p h Ç of G. T h e su p e rs c rip ts in d ic a te th e se t's size... 35 3.4 G ... 39 3.5 Ç ... 41

3.6 Ç{a.'2) is not th e c liq u e -s e p a ra to r g ra p h of G[V’( ^ (< t,2 ))] ... 43

3.7 A b o x ... 46

3.8 A s e p a r a to r n o d e 5 w ith t h re e in te rn a l n e ig h b o rs... 48

3.9 A P Q - t r e e ... 50

(10)

3.10 An interval g rap h , its clique -se pa ra tor g ra p h , a n d its tra in tree. . . . .53

3.11 P ro o f of L e m m a 3.9... 55

3.12 P ro o f of L e m m a 3.10... 56

3.13 P ro o f of L e m m a 3.11... 58

3.14 T h e tra in tre e a lg o rith m a pplied to Figure 3.3... 66

3.15 Case P ... 69 3.16 Ccise Q ... 69 3.17 S e m i M e e t s i S . T ) ... 70 3.18 5 = k \ n /\2 an d 5 divides R'l. K o ... 83 3.19 Proof of L e m m a 3.20.4... 85 3.20 Insertion e x a m p le s ... 88 3.21 T h e I n s e r t a lg o r i th m ... 90 3.22 M axim al clique K ... 92 3.23 P roof of p a r t 2 ... 94 3.24 P roof of p a r t 3... 95 3.25 K is a leaf... 98 3.26 Deletion e x a m p le s ... 99 3.27 K is not a l e a f . ... 101 3.28 D eleting 5 ... 103 3.29 More e x a m p le s ... 104

(11)

Chapter 1

Introduction

1.1

D yn am ic graph algorithm s

A d y n a m i c graph algorithm m a in ta in s a solution to a graph problem as the g rap h undergoes a series of sm all changes, such as single edge deletions or insertions. For e very c hange, th e a lg o rith m u p d a te s th e solution faster t h a n re c o m p u tin g th e solution from sc ra tch , i.e.. w ith no previously c o m p u te d inform ation. For e x a m p le , t h e World W id e Web is a d y n a m ic g r a p h whose vertices an d edges represent netw ork nodes a n d links t h a t u n p re d ic ta b ly m ay gain or lose capability cis e q u ip m e n t fails, new e q u ip m e n t is in tro d u c e d , or t h e netw ork becomes congested. Typically, a d y n a m ic g r a p h a lg o rith m has a preprocessing step to c o m p u te a solution, w ith som e auxiliary info rm a tio n , for th e initial g rap h . For exa m p le, our d y n a m ic g ra p h a lg o rith m in C h a p t e r 3 builds a d a t a s t r u c t u r e for t h e initial g r a p h in O (n^) t im e a n d th e n u p d a te s it in O ( n l o g n ) tim e p e r edge insertion or deletion, whereas c o m p u tin g t h e solution from s c ra tch (w ith o u t previously c o m p u te d inform ation) requires 0 ( m -r n) tim e, w here m a n d n are respectively t h e n u m b e r of edges a n d vertices in t h e g raph.

A d y n a m ic g r a p h a lg o rith m s u p p o rts two operations: query, a qu e stio n a b o u t th e s olution being m a in ta in e d , e.g.. 'W re vertices u. v connected?" or "Is th e g ra p h b ip a r­

(12)

p ro b le m s on w eig h te d g rap h s also s u p p o rt u p d a te s t h a t change an edge weight. Some a lg o r ith m s s u p p o r t u p d a te s t h a t delete or insert a vertex, e.g.. [CH78. KS99. SP75]. .•\n i nsert ions- only or deletions-onlij d y n a m ic g r a p h a lg o rith m respectively allows o nly e dge insertions or only edge deletions. .\ f ull y d y n a m ic g r a p h a lg o rith m allows b o t h insertions a n d deletions. W ith som e problem s, m a in ta in in g a solution is easier w h e n only in se rtio n s or only deletions are allowed. For e x a m p le, a sim ple and fast in se rtions-only a lg o rith m can be readily o b ta in e d for c o n n e c tiv ity using disjoint-set u n ion [Tar75]. whereas fast fully d y n a m ic a lg o rith m s a re considerably m ore involved [HK99. H T98. HdT98].

Fully d y n a m i c a lg o rith m s have been developed for n u m ero u s problem s on u n d i­ re c te d g ra p h s , in cluding con n e ctiv ity [EGIN97. Fre85. HK 99. HT98. H dT 98j. bicon­ n e c tiv ity [EGIN97. HK95. Rau94]. 2-edge c o n n e c tiv ity [Fre97. HK99j. bipartireness [EG IX 97. H K 99. HK97]. m in im u m spa n n in g trees [CH78. EG IN 97. Fre85. HK97. H d T 9 8 . SP7Ô]. a n d p la n a rity [BT96. EG IS96. ILR93]. T h e r e are also a lgorithm s for p ro b le m s on plan e g rap h s [EGIS96. EIT'*'92. Fre85. HRS94. Rau94]. Som e of these re su lts a re d e s c rib e d in survey papers [EGI98. FK99].

Hell. S h a m ir , a n d S h a ra n [HSS99] developed a fully d y n a m ic a lg o rith m to rec­ o gnize p r o p e r in te rv al g rap h s t h a t m a in ta in s a re p r e s e n ta tio n of th e p ro p er interval g r a p h . T h e ir a lg o r ith m allows u p d a te s t h a t result in a p ro p er interval graph and s u p p o r t s queries to decide w h e th e r a n edge u p d a te is allowed. In this thesis, we will p res e n t a nalogous a lg o rith m s for chordal g rap h s a n d interval g rap h s, which are classes t h a t c o n ta in t h e p ro p e r interval g rap h class.

(13)

1.2

C hordal graphs

Let G = ( V’(G ), ^ ( G ) ) = (V. £ ) be a n u n d ire c te d g rap h w ith o u t loops or m u ltip le edges a n d let n = |L'| a n d m = | £ | . We w rite H Ç G \î H is a su b g ra p h of G and

H C G \{ H IS a pro p er s u b g ra p h of G. T h e s u b g ra p h of G induced by i Ç \ is

G[G] = ( £ . £ [ £ ] ) . w here E[U] = { { u . c } e E \ u . v e i ' } . Given 5 C V. let G - 5’

d e n o te G[V’ — 5 |. Let G — { u , v} d e n o te (V, E — {{-r.i/}}) a n d let G -f {x, y} d e n o te (V; E U { { x . y } } ) .

A g r a p h G is chordal (or triangulated) if every cycle of length 4 or m o re has a

chord, which is an edge joining two nonconsecutive vertices of th e cycle. Equivalently.

G is chordal if no in duced s u b g ra p h of G is a cycle of length g r e a te r t h a n 3. Since e very induced s u b g ra p h of a chordal g r a p h is chordal, some a u th o rs describe being ch o rd a l as a hereditary property, e.g.. [GolSOj. . \ g rap h G is perfect if for every induced s u b g ra p h H of G. t h e c h ro m a tic n u m b e r of H is equal to th e clique n u m b e r of H. A g r a p h G is th e intersection graph of a family of sets IF = { 5 i S\ } if T is the v e rte x set of G a n d {5,. 5^} is a n edge of G e x a ctly when i ^ j an d S’, n Sj = 0. E\ ery ch o rd a l g ra p h is perfect [GolSO] a n d every chordal g ra p h is the intersection g ra p h of a fam ily of subtrees of a tre e [Bun74. Gav74b. Wal72. Wal7S]. where th e s u b tre e s are view ed as sets. G olum bic [GolSO] a n d M cK ee a n d M cM orris [.\IM99] discuss chordal g ra p h s in th e c ontext of perfect g rap h s a n d intersection graphs, respectively.

T h e r e are linear t im e a lg o rith m s to recognize chordal graphs [RTL76. T\*S4] a n d to solve various problem s on chordal g rap h s t h a t are N P -c o m p le te on general graphs: C L IQ U E . C H R O M .\ T I C N U M B E R . I N D E P E N D E N T S E T . a n d P A R T I T I O N IN T O C L IQ U E S [Gav72|. C h o rd a l g rap h s have a p p lic atio n s in biology, d a ta b a s e s , sta tis tic s , facility location problem s, a n d especially in sparse m a t r ix c o m p u ta tio n [BP93. GolSO. MM99].

(14)

satisfying t h e p r o p e r ty such t h a t V C I . a n d ma xi ma l if th e r e is no L ' Q f satisfying th e p r o p e r ty such t h a t L ' D L'. A clique of G is a set of pairw ise a d ja c e n t vertices of

G. .An i ndependent set of G is a set of pairwise n o n a d ja c e n t vertices of G.

Let 5 C V’. If two vertices a re connected in G a n d not con n e cte d in G — S. th en 5 is a separator of G. If u. v G V are conn e cte d in G a n d not c o n n e cte d in G — S . th e n 5 is a uv-separator of G. If u . v G V a n d S is a m in im a l u e -s e p a ra to r, th en 5 is a m i n i m a l vertex separator o f G. If I j. l i C V a n d 5 is a u e -se p a ra to r of G for every u G V’l a n d e G l i . t h e n 5 separates V ÿ .li. In Figure 1.1, { u . x . y } . { v . x . y } are m a x im a l cliques, { x .y } . {y} are m inim al vertex s e p a ra to rs , an d { y } is a m inim al se p a ra to r.

Figure 1.1: .A graph.

We will discuss th e c h a ra c te riz a tio n s of chordal g ra p h s t h a t are th e most well known a n d m ost useful for o u r purposes. O th e r, less useful, c h a ra c te riz a tio n s of chordal g ra p h s include [Duc84. ShiS4. BCD'"'90. B.J96].

.A g r a p h G is chordal if a n d only if any of t h e following s t a t e m e n ts holds. 1. E v e ry m in im a l v e rte x s e p a r a to r of G is a clique [Dir61].

2. G has a perfect e lim in a tio n ordering [FG65].

3. G hcis a clique tre e [Bun74. G av74b. Wal72. Wal78j. C h a ra cteriza tio n 1

Using this c h a ra c te r iz a tio n , we can give a n a lg o rith m t h a t decides w h e th e r a graph is chordal: for e very p a ir u, u of vertices, find every m in i m a l u c -se p a ra to r an d test

(15)

w h e th e r it is a clique. Since th ere a re 0 ( n ’ ) vertex pairs a n d each test requires 0 ( r r ) tim e , not including t h e t im e t o find t h e s e p ara to rs, this is a very inefficient a lg o rith m when c o m p a re d to th e linear tim e a lgorithm s we will s u b seq u e n tly describe. T his c h a ra c te riz a tio n is im p o r ta n t , however, for th e clique -se pa ra tor g ra p h we define in C h a p t e r 3.

C h a ra cteriza tio n 2

.\ ve rte x v is simplicial if Adj(L') is a clique, where Adj{ v] is th e set of neighbors of

V. For e x a m p le, the c o m p lete g ra p h on n vertices has n simplicial vertices an d a p a th

has e x a c tly 2 simplicial vertices. .A. perfect elimination ordering ( P E O l of G is an ord erin g of its vertices ( (.q. ... /•„) such t h a t for each c,. t h e set A d j { i \ ) n {c. | i <

j } is a clique. Equivalently, each c, is a sim plicial vertex in th e s u b g ra p h induced by

{ c , Un}. For exa m p le, th e g ra p h in Figure 1.1 has perfect e lim in a tio n orderings [ a . c. X. y . ~) an d (z. u. x . y . v ) . which shows t h a t t h e P E O m ay not be unique.

Every chordal grap h has a sim plicial vertex [Dir6I]. This fact leads to a short proof [FG65] t h a t a g r a p h G is chordal if a n d only if G has a PE O : (=>) Let c be any sim plicial vertex of G. Since chordality is h ereditary, th e n G — v is chordal. By i n d u ctio n . G — c has a P E O . which when a p p e n d e d to v yields a P E O of G. (<= ) Let C be a cycle of length 4 or more. Let c, be t h e v e rte x of C w ith sm allest index in t h e P E O . Since i\ is sim plicial in t h e su b g ra p h in duced by { c ,... t \ } . th e n c's two neighbors in C are con n e cte d by an edge, which is a chord of C.

Fulkerson a n d Gross [FG65] gave th e first a lg o rith m to c o m p u te a P E O : r e p e a t ­ edly find a n d delete an y sim plicial vertex until no vertices rem ain. T h e a lg o r ith m 's correctness follows from t h e proof t h a t a g r a p h is chordal if a n d only if it has a P E O . Since a sim plicial v ertex can be found in 0 { n ^ ) tim e , this a lg o rith m runs in 0 ( n ‘‘ ) tim e. T h e r e is an a lg o rith m to recognize chordal graphs in • ] tim e using fast m a t r i x m u ltip lic a tio n [Gav74a]. b u t it is supe rse d e d by a lg o rith m s t h a t c o m p u te a

(16)

a lg o rith m b a sed on a g r a p h search called Lexicographic BFS (L E X -B F S ):

N u m b e r t h e vertices from n to 1 in decreasing order, as follows. .\ v e rte x 's label is t h e list of its n u m b e r e d neighbors in decreasing order. Initially all labels a re e m pty. N u m b e r t h e v e rte x w ith th e largest label in lexicographic order, w ith ties b ro k en arb itra rily , an d rep e a t.

Every ord erin g p r o d u ce d by L E X -B F S could be p roduced by B r e a d th - F irs t Search. Rose. T a rja n . a n d Lueker show t h a t if a g ra p h is chordal, th e n every ord erin g produced by L E X -B F S is a P E O . T h e y im p le m e n t L EX -B FS in linear tim e a n d give a linear tim e a lg o rith m to test w h e th e r a given vertex ordering is a P E O . T h u s, this a lg o rith m recognizes chordal graphs in 0 ( m -|- n) tim e. T arjan a n d Y annakakis [T ^’S4] later gave a n o th e r linear tim e a lg o rith m using a sim pler g ra p h search called M a x im u m C a r d in a lity Search (M C S):

N u m b e r t h e vertices from n to 1 in decreasing order, as follows. N u m b e r th e v e rte x w ith t h e m o st n u m b e r e d neighbors, with ties broken a rb itra rily , a n d r ep e a t.

T a rja n a n d Y annakakis show t h a t if a grap h is chordal, th e n every ord erin g pro­ du c e d by M CS is a P E O . L sing a h e a p . M CS runs in 0 (ttilog n-|-n log n ) tim e. T arjan

a n d Y annakakis im p le m e n t M CS to ru n in 0 ( m -h n) tim e a n d th ey use t h e a lg o rith m from L E X -B F S to test w h e th e r a given v ertex ordering is a P E O . T h u s, this a lg o rith m also recognizes chordal g r a p h s in 0 ( m -|- n) tim e.

M CS can pro d u ce orderings t h a t c a n n o t be p roduced by L E X -B F S a n d vice versa, a n d th e r e a re P E O s t h a t a re c a n n o t be pro d u ce d by MCS or L E X -B F S . Shier [ShiS4] gives a n a lg o rith m t h a t c a n p r o d u ce a n y P E O . alth o u g h it does not ru n in linear tim e. P a n d a [Pan96] shows t h a t D e p t h - F ir s t Search guided by M CS ( th e n e x t v e rte x t o visit

(17)

is th e ne ig h b o r of th e c u rre n t vertex w ith th e m o st n u m b e re d neighbors ) c o m p u te s a P E O o f a c h o rd a l g r a p h in linear tim e , as does B r e a d th - F i r s t Search guided by MCS.

-A. P E O is req u ired for t h e linear t im e a lg o rith m s for C L IQ U E . CHRO.M.ATIC N U M B E R . I N D E P E N D E N T S E T . a n d P .A R T IT IO N IN T O C L IQ U E S on chordal g ra p h s [Gav72]. .A P E O is also im p o r ta n t for several a lg o rith m s t h a t recognize interval g r a p h s , which we will discuss in th e next section.

C h a ra cteriza tio n 3

B u n e m a n [Bun74]. Gavril [Gav74b]. a n d W a lte r [Wal72. Wal78j in d e p e n d e n tly discovered t h a t a g ra p h is chordal if a n d only if it is th e intersection g rap h of a family of s u b tre e s of a tree. In p a rtic u la r, th e y showed t h a t a g ra p h G is chordal if a n d only if G has a clique tree, which is a tree T on t h e m a x im a l cliques of G w ith th e clique

i ntersection property, for any two m a x im a l cliques K . l \ ' . th e set /v H k'' is co n ta in ed

in every m a x im a l clique on th e A'-A ' p a th in T.

Let KIg be th e set of m a x im a l cliques of G a n d let I'l be th e set of m a x im a l cliques of G c o n ta in in g v e rte x v. It is s tra ig h tfo rw a rd to show th a t th e clique in te r­ section p r o p e r ty is equivalent to th e induced subtree property: for any v e rte x r . the su b g ra p h o f T in d u c e d by ICc{e!) is a tree. Let be th e s u b tr e e of T in d u ce d by

ICg(^')- Since ( u . e} is an edge of G if a n d only if u. v a re b o th co n ta in ed in a m ax im a l

clique of G. t h e n {u. e} is an edge of G if a n d only if T.j, a n d T^. intersect. T h u s. G is t h e in te rse c tio n g r a p h of t h e fam ily of s u b tre e s {T^. | v € V’}.

T h e weighted clique intersection graph Wg o f G is th e weighted g r a p h on th e m a x i m a l cliques o f G where {A'. A''} is a n edge if a n d only if A' i~l K ' == 0. a n d each edge { K . A''} has weight | A' fl A''|. Wg is c o n n e c te d if a n d only if G is connected. B e r n s te in a n d G o o d m a n [BG81] showed t h a t for a n y c onne cte d graph G. a tre e on

Kg is a m a x im u m -w e ig h t s p a n n in g tre e of Wg if a n d only if it has th e induced su b tre e p ro p erty .

(18)

• r is a clique tre e of G.

• T has th e clique inte rse c tion property.

• T has t h e induced s u b tr e e property.

• r is a m a x im u m -w e ig h t s p a n n in g tre e of W'c (if G is connected).

Ho a n d Lee [HLS9] a n d L u n d q u ist [Lun90] in d e p e n d e n tly discovered th e following p r o p e r ty of clique trees, which we will use extensively, especially in th e interval graph alg o rith m s in C h a p t e r 3.

T h eo rem 1.1 Let G be a connected chordal graph with clique tree T.

1. .4 set S is a m i n i m a l vertex separator o f G i f a nd only i f S = A H A ' f o r s ome

{A'. A"} ^ E ( T ) .

2. f f S = A n A ' f o r {A'. A '} € E { T ) . then S separates K — S and A ' — .S'.

Fulkerson a n d Gross [FG65] showed t h a t a chordal g ra p h w ith n vertices has at m o st n m a x im a l cliques. By T h e o r e m 1.1.1. a chordal g r a p h w ith n vertices has at m ost n —1 m in im a l ve rte x s e p ara to rs. .Also, if 5 satisfies th e prem ise of T h e o r e m 1.1.2. th e n 5 is a m in im a l u e -s e p a ra to r for an y u Q K — S a n d v € A ' — 5' because every v ertex of 5 is a d ja c e n t to every vertex of A’ — 5 a n d A ' — 5 . which m eans 5 is a m in im a l vertex se p a ra to r.

B u n e m a n . G avril, a n d W a lte r showed how to c o n s tr u c t a clique tree of a chordal g ra p h in p olynom ial tim e , for e x a m p le . G a v ril's a lg o rith m runs in 0(n'*) tim e. Subse­ quently, o th ers developed linear t im e a lg o rith m s to c o m p u te a clique tre e of a chordal g r a p h , as well as its m a x im a i cliques a n d m in im a l v e rte x s e p ara to rs. T a rja n a n d A'an- nakakis [TY84] im plicitly gave t h e first linear t im e a lg o r ith m in t h e c o n te x t of acyclic

(19)

h y p e rg ra p h s for relational d a ta b a s e s . Lewis. P e y to n , a n d P o th e n [LPP89] gave the first explicit linear t im e a lg o rith m in t h e c o n te x t of sparse m a tr ix c o m p u ta tio n . Blair a n d P e y to n [BP93] gave a sim p ler a lg o rith m in a g ra p h th eo ry con te x t. Each of these linear t im e a lg o rith m s uses MCS.

T h e t e x t by G o lu m b ic [GolSO] describes th e P E O a n d t h e clique tre e , but does not include m ore recent clique tre e results like T h e o r e m 1.1. T h e excellent p rim e r by Blair a n d P e y to n [BP93] em ph a size s t h e clique tre e an d its a pplications in sparse m a tr ix c o m p u ta tio n . .\ lt h o u g h b o th c h a ra c te riz a tio n s have been very useful in developing a lg o rith m s for chordal graphs, b o th m ay not be e qually useful in developing d y n a m ic a lg o rith m s for chordal grap h s. Since th e P E O is c o m p u te d with a g ra p h search such as Lex-BFS or M CS, a single edge u p d a te could yield a very different P E O . T here are pro p e rtie s t h a t im ply a given ordering is a P E O . for e x a m p le P r o p e rty P in [T\'S-lj. b u t again, a single edge u p d a te could yield a very different ordering. T hus, the P E O a p p e a rs to be difficult to m a in ta in u n d e r edge u p d a te s . In c o n tra s t, in C h a p te r 2. we prese n t a sim ple a lg o rith m t h a t m a in ta in s a chordal g r a p h 's clique tre e in 0 [ n ) tim e p e r u p d a te .

1.3

Interval graphs

-A. g r a p h is interval if it is th e intersection g r a p h of a set of intervals on th e real line. T h e r e a re as m a n y c h a ra c te riz a tio n s of interval graphs as th e re are of chordal graphs. We will briefly discuss t h e m ost well known c h a ra c te riz a tio n s , for which we require th re e definitions. .An asteroidal triple is a set of th re e vertices such t h a t between any two of t h e vertices, th e r e is a p a t h t h a t does not c ontain a neighbor of t h e third vertex. .An asteroidal trip le is a n in d e p e n d e n t set. T h e c o m p le m e n t of a g r a p h G = (V. E) is t h e g r a p h G = ( V . Ë ) . where {u. u} E Ê if a n d only if {u. c} ^ E. .A grap h is

(20)

t h a t if (u. v), (u. w) a re d ire c te d edges, th e n (u, w) is a directed edge.

g r a p h G is interval if a n d only if a n y of t h e following s ta t e m e n ts holds.

1. G is chordal a n d G has no a s te ro id a l trip le [LB62].

2. G is chordal a n d G is a c o m p a r a b ility g ra p h [GH64].

3. T h e r e is a linear ordering of t h e m a x im a l cliques of G such t h a t t h e m a x im a l cliques c ontaining an y given v e rte x are consecutive in th e ordering [GH64].

T h e linear ordering in th e th ir d c h a ra c te r iz a tio n is a clique tree of G t h a t is a p a th , which is a clique path of G. It follows t h a t a grap h is interval if a n d only if it is th e inte rse c tion graph of a family of s u b p a th s of a p a th . Therefore, th e interval graph class is a subclass of t h e chordal g r a p h class. It is a proper subclass, as shown by t h e n e t. which is th e g r a p h form ed by a tt a c h i n g an edge to each corner of a triangle to form a g r a p h w ith 6 vertices. Since not every clique tree of an interval g r a p h is a clique p a th , a clique tre e a lg o rith m m a y not p r o d u ce a clique p a th when a p p lie d to an interval graph.

Interval graphs often m odel pro b le m s involving a linear order. C onsequently, interval g rap h s have even m ore a p p lic a tio n s t h a n chordal graphs, including a p p li­ c a tio n s in archeology, biology, genetics, psychology, an d scheduling [GolSO. .\lM99j. F u r th e r m o r e , m ost well known .\ P - c o m p le t e problem s can be solved in polynom ial t im e on interval graphs, including H .W I IL T O N IA N C I R C U I T . DO.\IIN.A.TI.N‘G S E T . a n d G R . \ P H IS O M O R P H IS M [JohSô]. B o d la e n d er [BodS9] showed t h a t .ACHRO­ M A T IC N U M B E R is N P -c o m p le te for interval g rap h s, which is one of t h e few known N P -c o m p le ten e ss results for interval g ra p h s [JohSô].

T h e r e are n um erous algorithm s to recognize interval graphs, including th e fol­ lowing linear t im e a lg o rith m s. B o o th a n d Lueker [BL76] gave t h e first (linear tim e) a lg o r ith m a n d in tro d u c e d t h e P Q - tr e e . w hich repre sents a set of p e rm u ta tio n s . T h e ir

(21)

u

a lg o rith m c o m p u te s t h e m a x im a l cliques a n d th en uses a c o m p lic a te d set of tem p la te s to c o n s tru c t a P Q - t r e e t h a t rep re sen ts t h e set o f valid orderings of t h e m a x im a l cliques. K o rte an d M ohring [KM89] gave an a lg o rith m t h a t c o n s tru c ts a n M P Q -tre e . which is a sim p ler version of t h e P Q -tre e . T his c o n stru c tio n uses a L E X -B F S ordering and d e p e n d s on L E X -B F S pro p ertie s t h a t MCS does not have. H abib. Paul, and V'iennol [HMPVOO] gave an a lg o r ith m t h a t c o m p u te s a clique tree a n d t h e n uses a LEX -B FS ord erin g to m a n i p u la t e t h e clique tre e into a clique p a th . Subsequently, o th ers have developed a lg o rith m s t h a t do not c o m p u te a linear ord erin g of t h e m a x im a l cliques: Hsu a n d M a [HM99] gave a n a lg o r ith m t h a t uses a s u b s titu tio n d e com position c o m ­ p u te d w ith L ex-B FS. a n d CorneiL O lariu. a n d S te w a rt [COS98] gave a pa rticu la rly sim ple a lg o rith m t h a t uses four sweeps of Lex-BFS. w ith ties broken in a p a rticu la r way.

1.4

O ther classes

We describe one subclass o f interval graphs. . \ g ra p h is proper interval (or unit

interval) if it is t h e inte rsec tion g ra p h of a set of intervals on th e real line such

t h a t no interval is properly c o n ta in e d in a n o th e r. T h e subclass is proper, as shown by t h e claw

(/v'1.3).

which is t h e g r a p h consisting of one ve rte x a d ja c e n t to three n o n a d ja c e n t vertices. T h e r e a re linear t im e a lgorithm s to recognize pro p er interval g ra p h s derived from th e B o o th a n d Lueker a lg o rith m a n d th e K o rte a n d M ohring a lg o rith m . T h e r e a re also sim p ler linear t im e a lg o rith m s t h a t do not use P Q -tre e s or M P Q - tre e s , in clu d in g a lg o rith m s by Corneil. K im . X a t a r a ja n . O la riu . a n d Sprague [CKX'*‘95], Deng, Hell, a n d H u a n g [DHH96]. a n d de Figueiredo. M eidanis. a n d de Mello [dFM dM 95]. Hell. S h a m ir , a n d S h a ra n [HSS99] gave a fully d y n a m ic algorithm to recognize a n d rep re sen t p r o p e r interval graphs in O ( l o g n ) t im e per edge insertion or deletion.

(22)

W e d e scrib e one m ore subclass of ch o rd a l graphs. graph is .•split if its v ertex set can. be p a rtitio n e d into a clique I\ a n d a n in d e p e n d e n t set / . with no re stric tio n on edges be tw e en vertices in K a n d vertices in / . g r a p h G is split if a n d only if

G a n d its c o m p lem en t G are ch o rd a l [FH77]. Split g ra p h s a n d interval graphs are

in c o m p a ra b le classes.

J o h n s o n [JohS5] discusses th e s e a n d o th e r g r a p h classes w ith "broad a lg o rith ­ m ic significance", including undirected path graphs, directed path graphs, an d strongly

chordal graphs. T h e G olum bic [GolSO] t e x t an d t h e M cKee and McMorris m ono­

g r a p h [MM99] discuss m any of t h e s a m e classes in th e c ontext of perfect graphs a n d in te rse c tio n graphs, respectively.

1.5

R esu lts

In th is thesis, we present th e first d y n a m ic a lg o rith m s t h a t recognize chordal graphs a n d interval graphs. B oth a lgorithm s m a i n ta i n a g r a p h re p re sen ta tio n w ith 0{ n ) size. In C h a p t e r 2. we present th e d y n a m ic a lg o r ith m t h a t recognizes a chordal g rap h by m a i n ta i n in g its clique tree. T h e a lg o r ith m allows u p d a te s t h a t result in a chordal g r a p h a n d s u p p o rts queries to decide w h e th e r an edge u p d a te is allowed. In a very s im p le im p le m e n ta tio n , each o p e ra tio n runs in 0 ( n ) tim e , a n d in a m ore c o m p lic a ted im p l e m e n ta t io n , one o p e ra tio n ru n s in O ( lo g ^ n ) tim e , a n o th e r in O ( n l o g n ) tim e , a n d t h e o th e r s in 0 ( n ) tim e.

In C h a p t e r 3. we in tro d u c e t h e clique-separator graph r ep re s en ta tio n of a chordal g r a p h , which is a g ra p h on its m a x i m a l cliques a n d m in im a l vertex se p ara to rs. We prove f u n d a m e n ta l properties of t h e c liq u e -s e p a ra to r g r a p h a n d a d d itio n a l pro p ertie s w hen t h e i n p u t g rap h is inter\"al. W e t h e n in tro d u c e t h e train tree re p re s e n ta tio n of in te rv a l g rap h s a n d use it to d e cide w h e th e r t h e r e is a clique p a t h on th e g r a p h 's m a x i m a l cliques. This yields t h e d y n a m ic a lg o r ith m to recognize interval g rap h s in

(23)

13 log n) tim e per edge in se rtio n or deletion. T h e a lg o rith m allows u p d a te s t h a t resu lt in an interval g r a p h a n d s u p p o rts queries to decide w h e th e r an edge u p d a t e is allowed. T h e c liq u e -s e p a ra to r g r a p h a n d t h e t r a in tree are rep re s e n ta tio n s t h a t provide significantly m o re in fo rm a tio n a b o u t th e g r a p h 's s tr u c tu r e th a n t h e clique t re e repre senta tion.

(24)

A dynam ic algorithm for chordal

graphs

2.1

In tro d u ctio n

We present th e first d y n a m ic alg o rith m t h a t m a in ta in s a clique tre e rep re s en ta tio n of a c hordal g r a p h G a n d s u p p o rts th e following o pe ra tions:

• D c l e t e - Q u e r y i u . v) r e tu rn s "yes" if G — {u. c} is c hordal a n d "no" otherwise.

• D e l e t e ( u . v ) d eletes {u, u} from G. provided G — { u .c } is chordal.

• I n s e r t - Q u e r y ( u . v ) r e tu r n s "yes" if G '+ { u . v } is c hordal a n d "no" otherwise.

• / n s e r t { u . v] in se rts [u . i’} into G. provided G + {u. c} is chordal.

T h e a lg o r ith m also m a in ta in s solutions to th e proble m s C L I Q U E a n d C H R O - M.A.TIC N U M B E R . We give two im p le m e n ta tio n s . In t h e first, each o p e ra tio n runs in 0 { n ) tim e . T h is i m p le m e n ta tio n is very sim ple a n d uses no c o m p le x d a t a s t r u c ­ tu re s. In t h e second. D e l e t e - Q u e r y runs in 0 ( n ) tim e . D e l e t e in O ( n l o g n ) . I n s e r t -

Q u e r y in G ( l o g ^ n ) tim e , a n d I n s e r t in 0 ( n ) tim e. B o th im p le m e n ta tio n s im prove

(25)

15

t h e 0 { m + n) tim e o b ta in e d by ru n n in g a s ta tic a lgorithm (e.g. iRTL76]) for each o p e ra tio n . .A.11 of the bo u n d s in this p a p e r are worst-case, unless specified otherw ise.

O ptionally, the a lg o rith m can m a i n ta i n t h e connected c om pone nts of G. It s u p ­ p o rts th e q u e ry " .\r e vertices u . v c o n n e cte d ?" in 0 ( 1 ) tim e w ith 0 { n ) t im e per u p d a te . If this query is not needed, its E T - tre e d a ta s tr u c tu r e [HK99] is easily o m i t ­ ted. T h e c onnected c o m p o n e n ts of a n a r b i t r a r y grap h can be m a in ta in e d w ith 0{ 1 ) t im e per qu e ry a n d 0 ( y / n ) t im e p e r u p d a te using topology trees [FreSo] c om bined w ith spa rsih ca tio n [EGIN97]. b u t t h e resulting d a t a s tr u c tu r e is m uch m ore c o m p li­ c a te d t h a n E T - trees.

O u r d y n a m ic a lg o rith m has been used to im prove a result for m inim al filled graphs. Informally, a filled g r a p h of G is G w ith edges a d d e d to m ak e it chordal. See [BHTOl] or [RTL76] for formal definitions. G iven an a r b itr a r y graph G and a filled g rap h G ^ o f G. th e problem is to rem ove fill edges from G’"*" to o b ta in a m inim al filled g ra p h of

G t h a t is also a su b g ra p h of G'*’. T h e a lg o rith m in [BHTOl] solves this pro b le m in 0 { f { m + f ) ) tim e, where m = \ E{ G) \ a n d / = |£ ’(G''^)| — m . which is th e n u m b e r of

fill edges in G"*". Using th e first im p le m e n ta tio n of our algorithm . Heggernes and Telle have im proved th e ru n n in g tim e to 0 ( n f + m) tim e [Hegj. M inim al filled g rap h s are d esirable in sparse m a tr ix c o m p u t a ti o n , as well as o th e r areas of c o m p u t e r science. Since f is 0 { n ) for m a n y p rac tic a l m a tr ic e s [BHTOl]. 0 { n f + m) c o m p a res favorably w ith th e best known r u n n in g t im e for c o m p u tin g any m in im a l filled g r a p h o f G. which is 0 { n m ) [RTL76].

2.2

C lique trees

By T h e o r e m 1.1.1. a clique tre e of G has nodes a n d edges th a t c orrespond to th e m a x im a l cliques a n d m in im a l v e rte x se p ara to rs of G. respectively. Figure 2.1 shows a c h o rd a l g ra p h G a n d F ig u re 2.2 shows a clique tre e of G. T h e set 5 = A = {c. d]

(26)

is a m in im a l u u -se p a ra to r for every u t Ax — 5 = {a. 6} a n d c € I\y — S = {g}. Also, rep lacin g th e edge { K y , A’u,,} w ith {A’x. A',x} gives a different clique tre e for G. w hich shows t h a t a g r a p h ’s clique tre e m ay not b e un iq u e. We will refer to th e vertices of

G an d th e nodes o f T an d will usually use s . t . u . v as v ertex nam es a n d œ . x . y . : as

node n am es. In th is c h a p te r only, node z E T c o rresp o n d s to m ax im a l clique A \ of

G an d a n edge { x . y } E T has w eight w { x . y ) .

b

a

c

I 9

F igure 2.1: .A. chordal g ra p h G.

M ost discussions o f ch o rd a l g rap h s, such as [B P93. L PPS9]. assu m e a connected g ra p h , since d isc o n n e c te d g ra p h s are ty p ic a lly h a n d le d by a p p ly in g th e re su lts to each c o n n e cte d c o m p o n e n t. To m a in ta in th e g r a p h ’s clique tre e in a unified way in our d y n a m ic a lg o rith m , we e x te n d th e definitions as follows. Let G be a disco n n ected ch o rd al g ra p h a n d let T [ . T2 Tk be clique tre e s of G”s co n n e cte d c o m p o n en ts.

k > I. Let X a n d y be nodes of different r , ’s. so th a t A'x a n d I\y are c o n ta in ed in

different co m p o n e n ts of G. Since A'x H A'y = 0 a n d { z .y } is not an edge of l l ’c . we call { x . y } a d u m m y edge w ith w eight w { x . y ) = 0. W e jo in T i . T j Tt w ith a r b itr a r y d u m m y edges to form a tre e T. w hich satisfies th e in d u ced s u b tre e an d clique in te rse c tio n p ro p e rtie s. We e x te n d W q by a d d in g all d u m m y edges to it. so th a t r is a m axi m um -w eight sp a n n in g tre e of W q . T h u s. T satisfies all th re e clique tre e p ro p e rtie s. W e will use clique tree to refer to T a n d strict clique tree to refer to th e Ti's. w hich a re th e su b tre e s of T co rresp o n d in g to th e c o n n e cte d c o m p o n e n ts of G.

(27)

2

K.W

(28)

2.3

T h e d yn am ic algorith m for chordal graphs

T h ro u g h o u t, G d en o tes th e c u rre n t ch o rd al g rap h and T d en o tes th e c u rre n t clique tre e of G.

2.3.1 D elete-Q uery

We show how to decide w h e th e r G — {u. c} is chordal for {u. c} 6 E.

L em m a 2.1 ([RTL76]) Let G be a chordal graph with edge { u .c } . Then either

G — {u. I’} (S chordal or G — {u . u} has a chordless cycle o f length -/•

L em m a 2.2 ([G JSW 84]) .4 graph H has no chordless cycle o f length 4 i f and only if f o r all distinct vertices s . t with { s .f} ^ E ( H ) . H + { s . t } has exactly one m a xi m al clique containing { s . f }.

By L em m as 2 an d 3. G — { u .c } is ch o rd al if and only if for all d istin c t vertices s. t w ith { a .f} ^ E { G — {u. u}). G — {u. I'} 4- { s . t } has e x a ctly one m ax im a l clique c o n ta in in g {s. (}. T h u s, a necessary co n d itio n for G — { u .c } to be ch o rd al is: G has e x a c tly one m ax im a l c liq u e c o n ta in in g { u .c } . In fac t, th is is also a sufficient co n d itio n . .Although sufficiency does not follow im m ed ia te ly from L em m a 3. its p ro o f is very sim ila r to L em m a 3 ’s p ro o f in [G JSW 84].

T h eo rem 2.3 Let G be a chordal graph with edge {u. c}. Then G — {u. c} zs chordal i f a nd only i f G has exactly one m ax i m a l clique containing u and v.

P r o o f (=>) By L em m as 2 a n d 3. (<=) S uppose G — { u .c } is not ch o rd al. By L em m a 2. G — {u. u} htis a chordless cycle of len g th 4. say ( u . s . v . t ) . Since {u. c} is a n edge of G a n d { s .f} is n o t an edge o f G. th e n { u .u .s } a n d { u .c .f } a re tw o cliques of G th a t cajin o t be c o n ta in e d in th e sam e m ax im a l clique o f G. T h u s. [ u . c} is co n ta in ed in a t least tw o d is tin c t m a x im a l cliques of G. □

(29)

19

D e l e t e - Q u e r y ( u . c)

For ev ery n ode x of T . te s t w h e th e r { u .e } Ç A’x- If th ere is e x a c ily one such node, r e tu r n "yes", an d oth erw ise, re tu rn "no".

E n d Del ete-Query

2.3.2

D elete

We n ex t show how to u p d a te T for G — { u .c } , given th a t T has a un iq u e node x such th a t { u . c } Ç A'^. Let A'“ = A’x — {c}. A’_^' = A'x — {«}. In G — { u .c } . every clique A 'y,y x is m ax im al b u t A'x has sp lit in to th e cliques A'". A'^. w hich m ay not be m a x im a l. (See F igure 2.3.)

u

V

F igure 2.3; D eleting {u. c} from A'x.

We d ecid e w h e th e r A'“ .A'^’ a re m ax im a l in G — { u .c } as follows. P a rtitio n th e set -V(x) of x 's neighbors into

A'u = {y € -V(x) I u € A'y} = {z E N { x ) I V e K ; } .Vw = { w € :V(x) I U. l> ^ A'u,}

(See F ig u re 2.4.) Let k = |A'x|. Since T is a clique tre e , th e n for a n y y E .V (x).

w { x . y ) < k - I.

(30)

iV„

N„

F ig u re 2.4: Before d e le tin g {u. r }.

/\ “ is not m ax im a l in G — {u. u} if an d o nly if 3 y e T . y ^ x . A'“ C k'y

if an d only if 3 y € .\’u. /v'“ C Ky (by th e clique in te rse c tio n p ro p erty ) if an d only if 3 y € .\'u. A'^ fl A'y = A'“

if an d only if 3 y G Au. w{x. y) = k — I

S im ilarly. A'j: is not m ax im a l if and o nly if 3c 6 u:{x. :) = k — I. D e l et e{ u. v)

1. F ind th e un iq u e node z of T such th a t {u. c} Ç A'^. If th e re is m ore th a n one such node, reject th e d e le tio n . O th erw ise, for every y E .\ (x ). test w h e th e r a € A'y or V € A'y a n d w h e th e r w ( x . y ) = k - I.

2. (W e m odify T as if A'“ a n d A'^ w ere m ax im a l an d th e n m odify T ag ain if th ey a re n o t. It is stra ig h tfo rw a rd to re w rite th e o p e ra tio n so th a t T is m odified once.)

R eplace node x w ith new nodes x i a n d x , rep resen tin g A'“ a n d Aj). respectively, a n d a d d edge { x i.x o } w ith u ;(x i. X]) = k — '2. In th e following, each new e d g e ’s weight is th e (rep laced ) old ed g e 's w eight. If (/ E .V^. rep lace { x .y } w ith { x [.y } . For each z E -V^., rep lace { x .- } w ith { x j .c } . For each w E -V,r- rep lace {x. w ith { x i.tc } (or { x ;, w}). O b serve th a t T has th e in d u ced su b tre e pro p erty . (See F ig u re 2.5.)

3. If A'“ a n d A'J a re b o th m eixim al in G — ( u . i ’}. sto p . If A'“ is not m ax im al b e cau se A’“ C A'y, for som e y, E A'^. c o n tra c t { x i.y ,} a n d rep lace x i w ith yi. T his

(31)

21

k-2

N.

w

F ig u re 2.5: D eleting { u .r } .

m a in ta in s th e in d u ce d s u b tre e p ro p erty , even if “ C for m o re th a n one y,- E . \ \ . S im ilarly, if is n o t m a x im a l becau se A'^' C A\, for som e r, E . \ \ . c o n tra c t { x j . r , } a n d rep la ce w ith z,. T h u s, x has been replaced w ith 0. 1. or 2 nodes.

In e v e ry case, th e edge a d d e d betw een x t a n d x , is not c o n tra c te d an d th is edge's e n d p o in ts (w hich m ay have changed) c o n ta in u a n d v. We will su b seq u e n tly use this o b se rv a tio n .

E n d Delete

De l e t e { u . v) u p d a te s T so th a t th e re is a b ije c tio n betw een th e nodes of T and

th e m a x im a l cliques o f G — {u. v}. F u rth e rm o re . T has th e induced s u b tre e p ro p e rty an d th e w eight of a n y edge { y . z } E T is |Ay Pi A \|. H ence. T is a clique tre e for

G — { u . e }.

W e c a n rea d ily d ecide w h e th e r { u .c } is a cut edge o f G. i.e.. w h e th e r d ele tin g { u .i ’} d isc o n n e c ts a c o n n e cte d co m p o n en t of G . as follows. If {u. c} is a cu t edge, it m u st b e a m a x im a l clique. If {u. c} is not a cu t edge, th e n G has a cycle co n ta in in g

{u. (.'} a n d th e sh o rte s t such cycle has le n g th 3 or else G is not ch o rd al, w hich im plies {u . I’} is n o t a m a x im a l clique. T h u s, [u, c} is a c u t edge of G if an d only if {u. c} is

(32)

2.3.3 Insert-Query

VVe show how to d ecid e w h e th e r G '+ { u . i’} is chordal for {u. c} ^ E . W e will im p lic itly use th e fact th a t if a n d a re th e su b tre e s of T induced by AJc(“ ) a n d ICcie). resp ectiv ely , th e n a n d T^, do not in te rse c t (because no clique co n ta in s {u. c}). T h e o r e m 2 .4 Let G be a chordal graph without edge { u .r } . Then G -f {u .t-} chordal i f a nd only i f G has a clique tree T with u G A'^. c G h'y f o r s o me {x. y} G E { T ) .

P r o o f (=>) Since G' = G + { u .c } is ch o rd a l, th en G' has a clique tre e T'. By th e o b se rv a tio n a t th e e n d of D e l e t e ( u . v). if { u .u } is d e le ted from G ' . th e a lg o rith m p ro d u ce s a clique tre e T of G w ith u G A'^. e G A'y for som e { x . y } G E ( T ) . ( •=) If { j . y } is a d u m m y edge of T . th e n u a n d v a re in different co n n ected c o m p o n e n ts of

G a n d G + [u. i,'} is c e rta in ly ch o rd a l. O th e rw ise , u an d v are in th e sa m e c o n n e cte d co m p o n e n t G". w hich has a s tr ic t clique tre e T". We ap p ly T h e o rem I to G" a n d

T " . Let I = K i n A'y 7^ 0. S ince [u. c} is n o t an edge, th en u 0 A'y. c G E f a n d th u s

u G A'r — / . u G A'y — / . (See F ig u re 2.7.) B y T heorem I. / i s a u c -s e p a ra to r.

To show th a t G + {u. c} is c h o rd a l, it sufBces to show th a t G" + ( u . c} is ch o rd al. Let C be any cycle in G" + [ a . e} w ith le n g th 4 or m ore such th a t C co n ta in s {(/. r} . Let P = C — ( u . {.’}. so t h a t P is a u - v p a th of length 3 or m ore. Since / i s a ur- s e p a ra to r. P m u st c o n ta in a v e rte x s G / . T h e n e ith e r ( s . u} or {.s. c} is a c h o rd of C . H ence. G" + {u. c} is ch o rd a l. □

Suppose G has a clique tre e T t h a t d o es not satisfy th e c o n d itio n in T h e o re m 5. T h e following th e o re m show s t h a t if G htis a n o th e r clique tre e T ' th a t does satisfy th e co n d itio n , th e n T ' differs fro m T by o n e edge.

T h e o r e m 2 .5 Let G be a chordal graph without edge ( u . l '} . Let T be a clique tree

(33)

23

There exists a clique tree T ' o f G with u t K i ' . c € k ’y' and {x '. (/'} € E { T ' ) i f and only i f the m i n i m u m weight edge e on the x - y path in T satisfies w(e) = œ ( x . y ) .

P r o o f (4=) S ince T " = T — e + { x . y } a n d T have th e sam e w eight, th e n T " is a clique tree o f G. M oreover, u Ç. K f . v € Ay an d { x .y } € E ( T " ) . (=>) We first consider T. Let Tu a n d T^ b e th e su b tre e s of T respectively in d u ced by A2c(u) a n d fCci c). T h en x . x ' 6 Tu a n d y . y ' 6 Ty. (See F igure 2.6.) By a ssu m p tio n , we have ( x '.y '} %' T. F u rth e rm o re , x . y a re on th e x '- y ' p a th P' in T. w hich im plies th e x - y p a th P in T is c o n ta in e d in P ' . By th e clique in tersectio n p ro p erty . AT' H A'y/ Ç AT H A’y an d so u'(x. y) > w ( x ' . y ' ) . Sim ilarly, for any edge f E P. w { f ) > w ( x . y } > w i x ' . y ' ) .

We now c o n sid er T'. Let V}. W be th e n ode sets of th e tre e s of T ' — { x '.y '} . w here

x' 6 V’l a n d y ' € Vi. C o n sid er th e cut [V'l.Vi] of VV'g. Since P' -f { x '.y '} is a cycle c o n ta in in g an edge crossing [Vq. Vi] (nam ely, { x '.y '} ) . it m ust c o n ta in an edge e E. P' crossing [V}. Vi]. S ince { x '.y '} € T'. th e n e ^ T'. T h en wi e) < u’( x '.y ') . or else

T ' — { x '.y '} -i- e is a tre e w ith g re a te r w eight th a n T'. a c o n tra d ic tio n .

We claim th a t e P' — P. Every edge in P ' — P is c o n ta in ed in e ith e r I ’l P j

or V'(Tu). M oreover, x ' E Tu a n d y' E T^ im plies V'(Tu) Ç V} a n d V l P j Ç \ j . B ut e crosses [Vq.Vi]. w hich m eans e ^ P' — P. T h erefo re, e E P- T h en /r(e) > tc (x .y ) > w ( x ' . y ' ) . Since u’(e) < w { x ' . y ' ) . th en a ’(e) = w { x . y ) = ic ( x '.y ') . T h u s, e is a m in im u m w eight edge on P and «.’(e) = w ( x . y ) . □

T h e o re m 6 holds even if {u. e} jo in s different co n n e cte d c o m p o n e n ts of G. In th is case, { x .y } is a d u m m y edge jo in in g different s tric t clique tre e s . T h e n th e m in im u m w eight ed g e e on th e x - y p a th in T m u st also be a d u m m y edge an d so

if{e) = w ( x . y ) = 0. T h e n T — e -r { x .y } is a clique tre e satisfy in g th e co n d itio n in

(34)

T

Ta or Ta

F igure 2.6: C lique tre e T.

l n s e r t - Q u e r y ( u . v)

F in d th e closest nodes x . y ^ T such th a t u € A 'r -<•’ € A’y. If {-r.y} € T . re tu rn "yes". O therw ise, find th e m in im u m w eight edge e on th e x - y p a th in T . If

w[e) = w { x . y ) , re tu rn "yes", and if w{e) > t c ( x . y ) . re tu rn "no". (W e c a n n o t have iv(e) < u ' ( x , y ) because T is a clique tree .)

E n d I nse rt -Qu er y

2.3.4

Insert

W e n ex t show how to u p d a te T for G 4- { u .f } . given th a t u € A’- . e € A’y a n d { i . y} 6 E { T ) . Let / = A 'r H A'y. T h e n A ' = / U { u. e} is a clique in G 4- {u. c}. (See

F ig u re 2.7.)

W e claim th a t A is m a x im a l in G 4- {u. y}. O th erw ise, th e re is a v e rte x of V — A a d ja c e n t to ev ery v ertex in A , w hich m ea n s u a n d u are connected in G — I. B ut by

(35)

25

F ig u re 2.7: In se rtin g { u .u } .

T h e o rem I, / is a u n -se p a ra to r of G. a c o n tra d ic tio n . T h u s. K is a m a x im a l clique

in G -f { u .n } . Since K is n o t a clique in G. we m u st add a new node z to T w ith

K ; = K . F u rth e rm o re , if K,^ C for som e u' € T . th e n K,^ is not m ax im a l in G -i- { u . v } a n d we m u st rem ove n ode w from T.

F irs t, we co n sid e r w h e th e r h \ , is m ax im a l in G -f {u. n} for som e iv ^ x . y. S uppose A'u.. C A’;. S ince AT, does n o t c o n ta in th e edge {u. n}. e ith e r AT C f U {u} Ç A - or AT C / U {n} Ç A’y. a c o n tra d ic tio n . T h u s, A’^, is a m ax im a l clique in G -j- {u. n} for every w ^ x . y .

Second, we c o n sid er w h e th e r AT. Ay are m ax im a l in G -f { u .n } . Since r <t A’^. th e n A x C A’; if a n d only if A'x = / U {u} if and only if |A ’x| = | f | -i- 1. Sim ilarly.

A'y C A '; if a n d o nly if A'y = / U {c} if an d only if |A 'y| = | / | -I- 1. T h u s, we decide

w h e th e r A'x or A'y is m a x im a l in G -t-{u. u } by co m p arin g |A 'r |. | A 'y |. and | / | = œ i x . y ) . I n s e r t { u . v)

1. F in d th e closest nodes x . y € T such th a t u € A'x-c € A'y. If { x .y } t T. go to S te p 2. O th e rw ise , find th e m in im u m weight edge e on th e x - y p a th in T. If u;(e) = w { x . y ) . rep lace e w ith { x .y } in T. an d if u’(e) > w ( x . y ) . reject th e in sertio n .

2. (W e m odify T aa if AT a n d A'y were m ax im a l a n d th e n m odify T again if th ey are n o t.)

R eplace edge { x .y } in T w ith new node z rep re sen tin g AT = / U {u. c} a n d add edges { x .z } ,{ y ,z } , each w ith w eight \I\ -h 1. (See F ig u re 2.8.) D e te rm in e w h e th e r A'x, A'y axe m a x im a l in G -f { u .u } by co m p arin g |A'x|. |A'y|. a n d u '( x .y ). If A'x an d

(36)

K y are b o th m ax im a l, sto p . O th e rw ise , if /v’x is not m a x im a l, c o n tra c t { r .z } and

re p la c e x w ith c: if A'y is not m ax im a l, c o n tra c t { y , z} a n d rep lace y w ith z. T h u s, x a n d y have b een rep la ce d w ith 1. 2, or 3 nodes.

E n d Insert

X z y

--- • --- •

I / I + i 1 / 1 + /

F igure 2.8: .\d d in g node z to T.

I n s e r t { u , v) u p d a te s T so th a t th e re is a b ije c tio n betw een th e nodes of T and

th e m a x im a l cliques of G + {u. u}. F u rth e rm o re . T has th e in d u ced su b tre e p ro p e rty a n d th e correct edge w eights. H ence. T is a clique tre e for G + {u. i-}.

N ote th a t ( u . c} jo in s different c o n n e cte d c o m p o n e n ts of G if a n d only if { x . y } is a d u m m y edge of T . i.e.. w { x . y ) = 0. In th is case. I \ \ = [u. r} .

2.4

F irst im p lem en ta tio n

In th is sim p le im p le m e n ta tio n , we re p re se n t each m a x im a l clique w ith a c h a ra c te ristic v e c to r, i.e.. an a rra y of n b its. T h e n m e m b e rsh ip te s tin g requires 0 ( 1 ) tim e.

T h e preprocessing ste p ru n s in 0 ( m -|-n ) tim e , as follows. C o m p u te th e m ax im a l cliques of G a n d b u ild a clique tre e T o f G [B P 9 3 |. Label each edge {x. (/} E T w ith its w eight w ( x . y ) a n d each node x € T w ith a p o in te r to th e c h a ra c te ris tic vecto r for A 'x.

VVe im p lem en t D e l e t e - Q u e r y a n d I n s e r t - Q u e r y by search in g T . Since T has at m o st n nodes, each o p e ra tio n ru n s in 0 {n) tim e .

VVe im p lem e n t D e l e t e by se arc h in g T to find n o d e x a n d th e n e x a m in in g x 's neigh­ b o rs. Since th e re are 0 ( n ) changes to T . D e l e t e ru n s in 0 { n ) tim e . VVe im p lem en t

I n s e r t by search in g T to find x a n d y. VVe m u st th e n c o m p u te z 's c h a ra c te ristic

(37)

a n d y's vectors a n d a d d u . u to it. O th erw ise, we copy x or y 's vecto r an d a d d th e a p p ro p ria te vertices {u or v or b o th ) to it. Since each v ecto r has len g th n. I n s e r t requires 0 (n) tim e.

2.4.1 Connected com ponents

W e can rea d ily m a in ta in th e c o n n e cte d co m p o n e n ts of G' by using a degree-d E T -tre e [HK99] to rep resen t a sp a n n in g tre e for each c o m p o n e n t, w here d = n '.O < e < 1. D eciding w h e th e r tw o v ertices are in th e sam e E T -tre e requires G ( l ) tim e , so each " .\r e vertices u . c c o n n e c te d ? ’’ q u e ry runs in 0 ( 1 ) tim e. T h e d e scrip tio n s of De lete a n d In se rt show how to decide w h e th e r d e le tin g an edge d isco n n ects a co m p o n en t a n d w h e th e r in se rtin g an edge co n n ects two c o m p o n en ts. Since s p littin g or jo in in g th e E T -trees requires 0 ( n " ) tim e , each u p d a te runs in 0 { n ) tim e.

T h e only difficulty occurs w hen an edge { u .u } to be d eleted is co n ta in ed in its c o m p o n e n t’s sp a n n in g tre e T^p b u t it is not a c u t edge of its c o m p o n e n t. T h e n d eletin g

{u. I’} sp lits Tap in to th e tree s Tj),. resp ectiv ely c o n ta in in g u. c an d we m ust find a

replacement edge, w hich is an edge o f th e c o m p o n en t th a t co nnects Tj), an d T’jp. Let

A’x be th e u n iq u e m a x im a l clique c o n ta in in g {u, i } before th e d eletio n . X ote j A’x! > - becau se ( u . e} is n o t a c u t edge. S ince any v e rte x f € A’x — {u. r} is a d ja c e n t to b o th

u an d V. th e n t is in th e sa m e co m p o n e n t as u. v an d so t 6 T,p. If t € Tj),. th en {/. r} is a rep la ce m e n t edge, a n d i f f € rjj,, th e n (f, u} is a rep la ce m e n t edge. We jo in Tj), a n d r,p w ith th e re p la c e m e n t edge, re sto rin g th e c o m p o n e n t’s sp a n n in g tree.

2.5

Second im p lem en ta tio n

In th is im p le m e n ta tio n , we rep re sen t each m ax im a l clique w ith a c h a ra c te ris tic vecto r a n d th e clique tre e T w ith a S le a to r-T a rja n d y n a m ic tre e [ST83]. For ev ery v ertex

(38)

[ n s e r t - Q u e r y { u . v) as follows.

Let u G a n d u G AL. R eroot th e d y n a m ic tre e for T a t w. Use b in ary search on th e p a th in T from z to th e root to find th e closest nodes x . y E. T such th a t

u G A'x. L’ E A'y. If { x . y } G T . re tu rn "yes". O th erw ise, find th e m in im u m weight

edge e on th e x - y p a th in T by rero o tin g at x a n d finding th e m in im u m w eight edge from y to th e ro o t. If w(e) = w { x . y ) . re tu rn "y e s": if iv{e) > w ( x . y ) . re tu rn "no".

E ach of th e following d y n a m ic tre e o p e ra tio n s requires O (lo g n ) tim e: rerooting th e tre e , finding th e ith node on a p a th to th e ro o t, finding th e m in im u m weight edge on a p a th to th e ro o t, s p littin g th e tre e by d e le tin g an edge or jo in in g two tre e s w ith an edge. T h u s. I n s e r t - Q u e r y requires 0 ( lo g ‘ n] tim e . Since Del ete m akes

0 { n ) changes to T . it now requ ires 0 [ n log n) tim e. T h e o p e ra tio n s De Je te - Que r y and I n s e r t still req u ire 0 ( n ) tim e . T herefore, we have reduced th e tim e for I n s e r t - Q u e r y

to 0 (lo g " n) a t th e e x p e n se of increasing th e tim e for D e l et e to 0 { n log ii).

2.5.1

C om puting the weights

In th e first im p le m e n ta tio n of I n s e r t - Q u e r y . we c o m p u te d w { x . y ) = |A ' x U A 'y} in

0 ( n ) tim e by c o m p a rin g th e c h a ra c te ristic vectors for A 'x a n d A 'y . In th e second im p le m e n ta tio n , we c o m p u te a ' ( x . y ) in 0 (1) tim e by m a in ta in in g a n .< n m a trix lU w ith fU (x .y ) = w ( x . y ) . T h e preprocessing tim e is d o m in a te d by th e O (n^) tim e to b u ild W . We u p d a te W in 0 { n ) tim e a fte r I n s e r t or De l et e, as follows.

.After I n s e r t ( u . v ) a d d s node : to T an d c re a te s z's c h a ra c te ris tic vector. A L =

I U { u .u } . we m u st c o m p u te W '(u’.z ) for all œ E T: th e o th e r e n tries in lU are

u n ch an g ed . W e have f U I x .z ) = lU (y .z ) = | / | + 1. (See F ig u re 2.8.) Let w ^ x. y. z. W e show how to c o m p u te W '(tu.z) from W { w . x ) a n d lU(u.’.y ) .

S uppose A'x is not m a x im a l in G '+ { u .i;} . T h e n A'x = / U { u } a n d h \ = A'xU {u}. T h e refo re, if v E A'u,, th e n W { w . z ) = W '(u t.x ) + 1. a n d o th erw ise. lU (u -.z ) =

Referenties

GERELATEERDE DOCUMENTEN

(Top): The schematic of a navigated A-mode ultrasound probe for bone registration; (bottom): our proposed ultrasound based motion tracking system by increasing the number of

Therefore, in the current study we compared the BRIEF-A questionnaire with neurocognitive outcome as measured by the Amsterdam Neuropsychological Tasks (ANT; De Sonneville, 2014),

Secondly, SSGA’s press releases in the previous years were calls on action for the index manager’s investee companies to focus on long-term value and to increase the number of

For the fixed effects and the first difference model, the number of other programs per welfare benefit recipient indicates a negative and significant (at the 5

33 Het EPD bestaat uit een aantal toepassingen die ten behoeve van de landelijke uitwisseling van medische gegevens zijn aangesloten op een landelijke

Maar ook werd kunst gezien als helper van de natuur, omdat de natuur vaak imperfect is en geperfectioneerd moet worden.. Natuur en kunst bestaan simultaan, naast elkaar, maar

Naar aanleiding van de zestigste verjaardag van de Gentse geleerde Werner Waterschoot heb- ben collega’s en vrienden van de Vakgroep Nederlandse Literatuur van de Universiteit Gent

In de academische wereld wordt veel onderzoek gedaan naar de samenhang tussen innovatie, internationale handel en economische groei. Uit eerder onderzoek van CBS werd al duidelijk