Fast C-K-R Partitions of Sparse Graphs
We present fast algorithms for constructing probabilistic embeddings and approximate distance oracles in sparse graphs. The main ingredient is a fast algorithm for sampling the probabilistic partitions of Calinescu, Karloff, and Rabani in sparse grap…
Authors: Manor Mendel, Chaya Schwob
F ast C-K-R P artitions of Sparse Graphs ∗ Manor Mendel Computer Science Division The Op en Univ ersity of Israel mendelma@gm ail.com Cha ya Sc h w ob Computer Science Division The Op en Univ ersit y of Israel cschwob@nds .com Abstract W e present fast algorithms for constructing probabilistic em b ed dings and approximate distance oracles in sparse graphs. The main ingredient is a fast algorithm for sampling the probabilistic partitions of Calinescu, Karloff, and Rabani in sparse graphs. 1 In tro d uction Metric de c ompos itions aim to partition the p oints of a metric s pace into blo c ks such that close-by points tend to be pla ced in the sa me blo ck while distant pairs of po in ts in different blocks. F or most metric spa ces, no straightforward int erpretation of these g oals exists. One successful compromise is the notio n o f pr ob abilistic p artition. A ∆- bo unded probabilistic partition is a probability distribution o ver partitions o f the metric space, such that in every par tition in the distribution, the diameters of the blocks are at most ∆, while “close-by” pairs o f p oint s ar e in the same blo c k with “hig h” (or at least “no n- negligible”) probability . Probabilis tic partitions first appear ed, to the b est of our kno w le dge, 1 in a pap er of Linial and Saks [19], and publicized in the work of Bartal [3] on proba- bilistic embeddings. Calinescu, Ka rloff and Rabani [10] in tro duced the following probabilistic pa r tition of metric spaces which we describ e a s an alg orithm that samples a pa rtition from the pr obabilit y distribution. W e call the probabilistic partition P sa mpled by Algor ithm 1 , ∆ -b ounde d CKR p artition . Na ¨ ıve implementations of Algor ithm 1 take Ω( n 2 ) time for n - po in t metric spaces. It seems hard to brea k the Ω( n 2 ) ba r rier on the running time in general finite metric spaces. How ever, in many situations, the metric spaces we deal with come from the shortest-pa th metr ic on relatively sparse graphs. In thos e c ases we can do better, as the following theorem s ho ws. ∗ M. Mendel wa s partially supported by an ISF gran t no. 221/07, a BSF grant no. 2006009, and a gift from Cis co researc h cen ter. Thi s work is part of the M. Sc. the sis of C. Sch wob prepared in the Computer Science D i vision of the Open Universit y of Israel. 1 Closely related notions of partitions app eared bef or e, e.g. in [17]. 1 Algorithm 1 CKR-Partition Input: A finite metric space ( X , ρ ), scale ∆ > 0 Output: Partition P of X π ≔ r andom p ermu tation of X R ≔ random num b er in ∆ 4 , ∆ 2 for i = 1 to | X | do C i ≔ { y ∈ X : ρ ( y , x π ( i ) ) ≤ R } \ S i − 1 j =1 C j return P ≔ C 1 , . . . , C | X | \ {∅} Theorem 1. S upp ose we ar e given a p ositive numb er ∆ > 0 and an undir e cte d gr aph with p ositive e dge weights G = ( X, E , ω ) . S upp ose G has n vertic es and m e dges, and let ρ denote the shortest- p ath metric in G . One c an sample a ∆ -b ounde d CKR p artition of ( X , ρ ) in exp e cte d O ( m log n + n log 2 n ) time. The sa mpling will b e accomplished b y Algorithm 2 (Section 3 ). CKR pa rtitions have found many algor ithmic (as well as mathematical) ap- plications, and we men tion only few of them here. They were in tro duced as part of a n approximation algor ithm to the 0-extension problem [10, 1 2]. F a k charoen- phol, Rao a nd T alwar [1 3] used them to o btain an as ymptotically tight prob- abilistic em bedding into trees, which w e call FR T-embedding. Probabilis tic embeddings are used in man y of the best known approximation and online algo- rithms as a r eduction s tep fro m ge neral metrics into tree metrics. Mendel and Naor [2 1] show ed that FR T-em b edding poss esses a stronger embedding prop- erty , whic h they called “ma xim um gradient e mbedding ”. Recently , R¨ ack e [2 3] used FR T-embeddings to obtain hierarchical decomp ositions for conges tion min- imization in net w orks, and used them to giv e an O (log n ) approximation algo- rithm for the minimum bisection pro blem and an O (log n ) comp etitive o nline algorithm for the o blivious ro uting pro blem. Kr authgamer e t. a l [16] used CKR- partitions to give a new pro of of Bo urgain’s em be dding theorem. Mendel a nd Naor [22] used them to obtain a n a symptotically tight metric Ramsey theorem and approximate dis ta nce o racles. The improv ed r unning time of the sampling of CKR partitions may improv e the r unning time of man y o f their applications. In order to keep the pap e r shor t we work out the details o f o nly tw o (related) applications o f C K R partitions: FR T-embeddings, and approximate distance o r acles based on CKR- partitions. Probabilistic em b edding into ultrametrics [2, 3]. An ultra metric ν on X is a metric which satisfies ν ( x, z ) ≤ max { ν ( x, y ) , ν ( y , z ) } , for every x, y , z ∈ X . A probabilistic embedding o f a metric space ( X , ρ ) into ultrametrics with distor tio n D is a probability distribution Π ov er ultramerics ν on X such that 1. F or every x, y ∈ X , Pr Π [ ν ( x, y ) ≥ ρ ( x, y )] = 1 . 2. F or every x, y ∈ X , E Π [ ν ( x, y )] ≤ D · ρ ( x, y ). 2 FR T-embedding is a probabilistic em bedding int o ultrametrics with distor- tion O (lo g n ) for every n - point metric spa ce [13]. This b ound is asy mptotically tight for certain classe s of finite metric spa ces, s uc h as graphs of high girth[3], grids [2], and ex pa nders [18]. Appro xim ate distance oracles. An approximate distance or a cle is a data s tructure with “ compact” ( o ( n 2 )) stor- age tha t answers (appr oximate) dista nc e queries in a given n -p oint metric space in consta n t time. A simple counting ar g umen t over a ll bi-partite graphs shows that exact, and even 2 . 99 appr oximation is imp o ssible when the storage is o ( n 2 ). The histo r y of this pro ble m is nicely summarized in [2 5]. In par ticular, Thorup and Zwick [25] g a ve an asymptotically tight trade-o ff betw een the a pproxima- tion and the s torage 2 : F or ev ery k ∈ N , they constr ucted (2 k − 1)-approximate distance o racle requiring O ( k n 1+1 /k ) s to rage, and answering queries in O ( k ) time. Recently Mendel and Nao r [22] presented different approximate distance oracles, based on CKR partitions. While those oracles do not give optimal approximation/stora ge trade- off, 3 they answer distance queries in an abs olute constant time, regardless of the approximation parameter. Theorem 2. L et G = ( X , E , ω ) b e an n -vertex weighte d gr aph with m e dges, and let ρ b e the shortest-p ath metric on X . Then 1. It is p ossible to sample fr om FR T-emb e dding of ( X, ρ ) in O ( m log 3 n ) ex- p e cte d time. 2. It is p ossible to c onst ruct in O ( mn 1 /k log 3 n ) exp e cte d time an O ( k ) -appr oximate distanc e or acle for ( X , ρ ) b ase d on CKR p artitions whose stor age is O ( n 1+1 /k ) . F or approximate distance oracles, it is a lso poss ible to improve the na ¨ ıv e construction time even when the metric is g iv en as distance matrix, by first constructing a spanner of the metric with o ( n 2 ) edges, and then use the fa s t CKR partitions fo r sparse gra phs on that spanner. Theorem 3. F or n -p oint metric sp ac es given as distanc e matrix, it is p ossible to c onstru ct O ( k ) -appr oximate di stanc e or acle b ase d on CKR p artitions whose stor age is O ( n 1+1 /k ) , in O ( n 2 ) exp e cte d time. W e remark that a differen t pr obabilistic partition, dev elop ed by Bartal [4, 5 ] and Abraham et. al. [1], hav e pr oper ties similar to (and even stro nger than) CKR partitions. How ever, we do not see an easy way to quic kly obtain a sa mple from this distribution whe n the gra ph is sparse. 2 The low er b ound on the appro xim ation assumes a conjecture of Erd¨ os ab out the num b er of edges p ossible in graph with a giv en num b er of vertices and a given gir th, see [25]. 3 As rep orted in [22], oracles of size O ( n 1+1 /k ) support appro ximation factor of 128 k in the queri es. While the constan t 128 can b e r educed by optimizing the parameters in the construction, it is unlikely to get below 8. 3 F urt her Results The second na med author presents in [24] an efficient PRAM a lgorithm for sam- pling CKR partitions and constr ucting approximate distance or acles in weigh ted graphs. The running time of the algorithm is p olylo g( n ) and the tota l work is O ( m p olylog( n )). Outline of the paper . After setting up in Section 2 the notation and r eviewing the prop erties of C K R partitions, we prov e Theor em 1 in Section 3. In many applica tio ns (and in particular , probabilistic embeddings a nd ap- proximate distance ora cles), probabilistic partitions a re a pplied hiera rchically , using an exp onentially decreas ing series of scales. This na ¨ ıvly implies a n added O (log Φ) factor in the running time, where Φ is the spr ead 4 of the metric. There is a standard technique that con verts this log Φ factor into a log n fac- tor. How ever, we are not aw are of a concrete implemen tatio n that satisfies the efficiency requirements needed in this pa per. W e therefore sketc h the details of this technical step in Section 4 . The sp ecific applica tions examined in this pap er, Theorem 2 and Theo rem 3, are discussed in Section 5. 2 Preliminaries F or simplicity of the presentation, the model o f computation w e a ssume is a unit-cost, real-word RAM ma c hine. In this mo del words can ho ld real num b ers and arithmetic, compar is on, and trunca tion op era tio ns take unit time. Our algorithms, how ever, do not take adv antage of the unrealistic p ow er of this mo del, and can also b e pre s en ted in a more realistic computational mo dels suc h as the unit cost floating-p oint word RAM mo del (cf. [1 5, Sec. 2.2 ]). The diameter of a finite subset Y ⊆ ( X , ρ ) is defined as diam( Y ) = max { ρ ( x, y ) : x, y ∈ Y } . F or simplicity of the presentation, we assume that the given finite metric ( X , ρ ) has minim um non-zer o distanc e 1, and diameter diam( X ) = Φ. The (closed) ball a round x at radius r is defined as B ρ ( x, r ) = { y ∈ X : ρ ( x, y ) ≤ r } . When ρ is clear fro m the context we ma y omit it fro m the notation. Given a partition P o f X , and x ∈ X , we denote by P ( x ) the block of P whic h contains x . ∆-b o unded CKR partitions have a n ob v ious upp er bo und o f ∆ on the diam- eter of the blo cks in the partition. The following is the padding prop erty they enjoy . Lemma 2.1 ([13, 22]) . L et P b e a ∆ -b ounde d CKR p artition of the metric ( X, ρ ) . Then, for every x ∈ X , and t ≤ ∆ / 8 , Pr P ∼P [ B ( x, t ) ⊆ P ( x )] ≥ | B X ( x, ∆ / 8) | | B X ( x, ∆) | 16 t ∆ . (1) 4 The s pread is the ratio b et w een the diameter and the smallest non-zero distance in the metric 4 In this pap er we define hierarchical partition of a metric space ( X , ρ ) as a sequence of ⌈ lo g 8 Φ ⌉ + 2 partitions P − 1 , P 0 , . . . , P ⌈ log 8 Φ ⌉ such that P i is a partition of X at scale 8 i , and P i is a refinemen t of P j when i ≤ j , i.e., for every x ∈ X , P i ( x ) ⊆ P j ( x ). Given a seq uence ( Q j ) j ≥− 1 of partitions, wher e Q j is 8 j -b ounded partition of X , the common refinement o f ( Q j ) j is a hierar c hical partition ( P j ) j ≥− 1 in which P j = { T ℓ ≥ j C ℓ : C ℓ ∈ Q ℓ } By sa mpling stochastically indep enden t CKR pa rtitions at the different scales and then taking their common refinement, we obtain the following re- sult. Lemma 2.2 ([22]) . Fix a finite metric sp ac e ( X , ρ ) . Th en ther e ex ists (effi- ciently sample able) pr ob ability distribution H over hier ar chic al p artitions such that for every x ∈ X , and every 0 < β < 1 / 8 , Pr ( P − 1 ,...,P ⌈ log 8 Φ ⌉ ) ∼H ∀ k ≥ − 1 , B ( x, β 8 k ) ⊆ P k ( x ) ≥ | X | − 16 β . A finite ultr a metric ( X , ν ) can b e repre s en ted by a tree as follows. Definition 4. An ultra metric tree ( T , Γ) is a metric space who se element s a r e the leaves of a ro oted finite tree T . Asso ciated with every vertex u ∈ T is a lab el Γ ( u ) ≥ 0 such that Γ ( u ) = 0 iff u is a leaf o f T . If a vertex u is a child of a vertex v then Γ ( u ) ≤ Γ ( v ) . The dis tance betw een tw o leaves x, y ∈ T is defined as Γ ( lca ( x, y )), wher e l ca ( x, y ) is the least common ances tor of x and y in T. Every finite ultrametr ic can b e repre sen ted by an ultra metric tree, a nd vice versa: the metric on ultrametric tree is a finite ultra metric. Hier archical parti- tion { P k } ⌈ lg φ ⌉ k = − 1 of ( X , ρ ) naturally corresp onds to an ultr ametric ν on X where ν ( x, y ) = 8 min { j : P j ( x )= P j ( y ) } . Let G = ( X , E , ω ) b e an undirected po sitiv ely weigh ted graph. Let ρ : X × X → [0 , ∞ ) be the shortest- path metric o n G . W e denote by n = | X | the num b er of vertices, and by m = | E | the num ber o f edges . W e assume an adjacency list r epresentation of g r aphs. The single s ource shortest paths in w eighted undirected gr aphs problem [USSSP] is used as a subr outine in our alg o rithm. G iven a weighted graph with n vertices and m edges , Dijkstra’s classica l USSSP a lg orithm [11] with source w maintains for each vertex v an upper b ound on the dista nce b etw een w and v , δ ( v ). If δ ( v ) has not been assig ned yet, it is interpreted as infi- nite. Initially , we just set δ ( w ) = 0 , and we hav e no visited vertices. At each iteration, we select an unvisited vertex u with the sma llest finite δ ( u ), visit it, and relax all its edges. That is , for ea c h incident edge ( u, v ) ∈ E , we set δ ( v ) ← min { δ ( v ) , δ ( u ) + ω ( u, v ) } . W e co n tinue until no v ertex is left un- visited. Using Fibona cci heaps [14] o r Borda l’s pr io rit y queues [9], Dij kstra’s algorithm is implemen ted in O ( m + n lg n ) time. 5 3 F ast CKR partitions Given an undirected p ositively weigh ted g r aph G = ( X , E , ω ) with n vertices and m edg e s whose shortest path metric is deno ted by ρ , and ∆ > 0, we show how to implement Algorithm 1 in O m lg n + n log 2 n exp ected time. First, we sample a ra ndom per m utation π , which can b e gene r ated in linear time using s ev eral metho ds, e.g., Kn uth Shu ffle (se e [8]). Next, we sa mple R uniformly 5 in the range ∆ 4 , ∆ 2 . W e then use a v ariant o f Dijkstra’s algorithm fo r computing the blo cks. The a lgorithm per forms | X | iterations. In the i -th iter ation, all vertices in B ρ x π ( i ) , R not yet ass igned to some blo ck ar e put in C i . In order to g ain the improv ed running time o f Theorem 1, we c ha nge Dijkstra ’s algorithm to return the distance of a po in t v from π ( i ) only if this distance is smaller then the distance o f v from π ( j ) for a ll j < i . T echnically , this is done as follows. Co nsider the i -th iteration a nd let δ ( v ) be the v a riable that holds the Dijkstra ’s alg orithm’s current estimate o n the distance betw een π ( i ) and v . In Dijkstra’s algor ithm δ ( v ) is usually initialized to ∞ and then g radually decr e a ses un til u is extracted from the prior it y queue, at whic h point δ ( v ) = ρ ( π ( i ) , v ). In the v a riant of Dijkstra’s algorithm used in Algor ithm 2, δ ( · ) are not reinitialized when the v alue of i is changed. This means that now at the end of the ( i − 1)-th iteratio n, δ ( v ) = min j ρ ( π ( i ) , v ), and ρ ( π ( i ) , v ) ≤ R . Let π ( i ) = v 0 , v 1 , . . . , v ℓ = v b e a sho rtest-path b et w een π ( i ) and v . W e claim that for ev e ry t ∈ { 1 , . . . , ℓ } , min j ≤ i − 1 ρ ( π ( j ) , v t ) > ρ ( π ( i ) , v t ), since otherwise we had min j ≤ i − 1 ρ ( π ( j ) , v ) ≤ min j ≤ i − 1 ρ ( π ( j ) , v t ) + ρ ( v t , v ) ≤ ρ ( π ( i ) , v t ) + ρ ( v t , v ) = ρ ( π ( i ) , v ) . 5 A closer lo ok on the analysis of the CKR partitions (see [22]) reveals that it is sufficien t to sample R from discrete dis tr i bution having r esolution of ∆ /c log n , and the refore this s tep can b e carri ed out in a “reali stic” computationa l model such as the unit cost floating-point wo rd RAM mo del. 6 Algorithm 2 Graph-CKR-Partition Input: Graph G = ( X, E , ω ), scale ∆ > 0 Output: Partition P of X 1: Genera te r andom p ermutation π of X 2: Sample a random R ∈ ∆ 4 , ∆ 2 3: for all v ∈ X do 4: δ ( v ) ≔ ∞ 5: P ( v ) ≔ 0 6: for i ≔ 1 to | X | do // Perform mo di fie d Dijkstr a’s alg starting fr om π ( i ) 7: δ ( π ( i )) ≔ 0 8: Q ≔ ∅ / / Q is a priority queue wi th δ b eing the key 9: w ≔ π ( i ) 10: while δ ( w ) ≤ R do // w i s visite d now 11: if P ( w ) = 0 then 12: P ( w ) ≔ i 13: for all u : ( u, w ) ∈ E do 14: if δ ( u ) > δ ( w ) + ω ( u, w ) then // R elax e dges adjac ent to w 15: δ ( u ) ≔ δ ( w ) + ω ( u, w ) 16: if u / ∈ Q then 17: Insert u in to Q 18: Extract w ∈ Q with minimal δ ( w ) 19: return P Hence all the edges along the path π ( i ) = v 0 , . . . , v ℓ = v will be relax ed in the i -th iteration, a nd so in the end of the i -th iteration, δ ( v ) = ρ ( π ( i ) , v ). Pr o of of The or em 1. W e firs t prov e the correctness of Algo rithm 2, i.e., that P ( v ) = min { i : ρ ( π ( i ) , v ) ≤ R } for ev er y v ∈ V . Let i 0 = min { i : ρ ( π ( i ) , v ) ≤ R } . This mea ns that min j R ≥ ρ ( π ( i 0 ) , v ). By Lemma 3.1 a t the beg inning of the i 0 -th itera tion, δ ( v ) = ∞ , and hence P ( v ) = 0 a nd by the end of the ( i 0 )-th iteration, δ ( v ) = ρ ( π ( i 0 ) , v ), and necessa rily P ( v ) = i 0 . Note that once P ( v ) is set to a non-zer o v alue, its v alue w ill not change. W e next b ound the r unning time. w e will show that e very vertex is in- serted in to the queue O (log n ) times in exp ectation, a nd e very edge ( u, v ) of G undergo es O (log n ) relaxatio ns in exp ectation. Consider the non-increas ing sequence a i = min j ≤ i ρ ( π ( j ) , v ). In the i -th iteratio n, δ ( v ) decrease s if and only if a i − 1 > a i . Note that a i − 1 > a i means that ρ ( π ( i ) , v ) is the minimum among { ρ ( π ( j ) , v ) | j ≤ i } , and the probability (ov er π ) for this to happen is at most 1 /i . By linea r it y of the exp ectation, the expec ted num ber of rounds of the i -lo op where δ ( v ) decreases (and hence v is inser ted into the queue) is at most n X i =1 1 i ≤ 1 + ln n. F urthermore, by a nother application of the linearity o f expecta tion, the exp ected 7 nu mber of edge r elaxations is at most O X v ∈ V ln n · deg ( v ) = O ( m log n ) . Using Fib onacci heaps [14] o r Bro dal’s prior it y que ue s [9], the total r unning time of Algorithm 2 is O ( r + s lo g n ), where r is the num b er o f relaxa tions, and s is the num ber of “insert” and “extract minimum” o p era tio ns. In our cases E [ r ] = O ( m log n ), and E [ s ] = O ( n log n ). Therefore the total exp ected r unning time of Algor ithm 2 is O ( m lo g n + n log 2 n ). 4 Hierarc hical P artitions In this section we explain how to disp ense with the O (log Φ) factor in the na ¨ ıve implemen tation of the hier archical partitions, and repla ce it with O ( lo g n ). The metho d b eing used is standard. Similar arguments app eared previously , e.g. , in [3, 1 5, 22, 21]. How ever, the context here is slightly different, and the desig- nated time b ound is O m lo g 3 n , which is faster than the implementations we are aw are of. While the a rgument is relatively s traightforw a rd, a full description of it is tedious to w r ite and re ad. Instead we only sketc h the implementation here. A complete description, including algorithmic implementation, app ears in [24]. In a na ¨ ıv e implementation, the num b er o f scales in which we sample CKR partitions is Θ (lg Φ ). This leads to O (( n log 2 n + m log n ) log Φ) b ound on the exp ected r unning time. Here we develop an implemen tation having O m lo g 3 n exp ected r unning time. W e define for each scale an a ppropriate quo tien t o f the input graph. W e then sho w that CKR partitions of those substitutive gra ph metrics reta in the pr oper ties of CK R partitions on original metric. Using those quotients, not all scales nee d to b e pro cessed, and the total size of the quotient graphs in a ll pr oc e s sed scales is O ( m lg n ). F or y , y ′ ⊆ X , le t ρ ( y , y ′ ) = min { ρ ( x, x ′ ) | x ∈ y , x ′ ∈ y ′ } . Giv en a partition Y o f the spac e ( X , ρ ) we define the quotient metric ν on Y as ν ( y , y ′ ) = min n l X j =1 ρ ( y j − 1 , y j ) : y 0 , . . . , y l ∈ Y , y 0 = y , y l = y ′ o . Definition 5. A space ( Y , ν ) is ca lled ∆ -b ou n de d quotient o f an n -p oint metric space ( X , ρ ) if Y is a ∆-b ounded par tition of X , ν is a quotient metric on Y , and for every x ∈ X , B ρ ( x, ∆ /n ) ⊆ Y ( x ). Note that a ∆-b o unded quotient of n -p oint metric spa c e exists: define a relation x ∼ x ′ if ρ ( x, x ′ ) ≤ ∆ /n , and take the transitive closur e. The quo tien t subsets ar e the equiv alence classes, a nd by the tr iangle inequality , the diameter of those equiv a le nce cla sses is at most ∆. The follo wing lemma follows ea sily fro m Lemma 2.1, see the pro of of [20, Lemma 5]. 8 Lemma 4. 1 . Fix ∆ > 0 , and let ( Y , ν ) b e a ∆ 2 -b ounde d quotient of ( X , ρ ) . L et σ : X → Y b e t he natu r al pr oje ction, assigning e ach vertex x ∈ X to its cluster Y ( x ) . L et L b e a (∆ / 2) -b ounde d CKR p artition of Y . L et P b e the pul lb ack of L under σ , i.e. , P = σ − 1 ( A ) A ∈ L . Then P is a ∆ -b ounde d p artition of X su ch that for every 0 < t ≤ ∆ / 16 and every x ∈ X , Pr [ B ρ ( x, t ) ⊆ P ( x )] ≥ | B ρ ( x, ∆ / 16) | | B ρ ( x, ∆) | 32 t ∆ . (3) and furthermor e, if t ≤ ∆ / 2 n , then Pr [ B ρ ( x, t ) ⊆ P ( x )] = 1 . (4) W e define G | ∆ as the subgraph of G with edg es of weight at most ∆ and no isolated vertices. Definition 6. Giv en a weigh ted gr aph G = ( X , E , ω ) and ∆ > 0. Define the graph G | ∆ = ( X | ∆ , E | ∆ , ω | ∆ ) as fo llows. E | ∆ = { ( u, v ) ∈ E : u 6 = v , and ω ( u, v ) ≤ ∆ } , X | ∆ = { u ∈ X : ∃ v ∈ X , ( u , v ) ∈ E | ∆ } , and ω | ∆ = ω | E | ∆ . Lemma 4.2. Given a weighte d gr aph G = ( X, E , ω ) , and ∆ > 0 . L et L b e a ∆ -b ounde d CKR p artition of X | ∆ , u sing the metric induc e d by G | ∆ . Then P = L ∪ { { v } : v ∈ X \ ( X | ∆ ) } is a ∆ -b ou n de d CKR p artition of X , using the metric induc e d by G . Pr o of. Le t ρ be the shortes t-path metric on G . Observe tha t when computing a ∆-b o unded CKR partition of ( X , ρ ) no edge of weigh t larger than ∆ is “used” by the Dijkstra’s a lgorithm for computing the balls, and therefore discar ding them do es not change the b ehavior of the alg orithm. Also, for eac h v ∈ X \ X | ∆ , B ρ ( v , ∆) = { v } , i.e. , in any ∆-bounded CKR pa rtition of X , v will app ear in a singleton subset. Lemma 4.2 and Lemma 4.1 form the basis for disp ensing with the dep endence on the spr ead in the co nstruction time. W e next sketc h the scheme w e use . Denote the input gr aph G = ( X , E , ω ), | X | = n , | E | = m , and let ρ b e the graph metric on G . W e first construct an ultrametric ν on V , represented by an ultrametric tr e e H = ( T , Γ) suc h that for every u, v ∈ V , ρ ( u, v ) ≤ ν ( u, v ) ≤ nρ ( u, v ). H can be constructed in O ( m + n log n ) time us ing minim um spanning tr ee proce dure, see [15, Section 3.2 ]. F or a given ∆ ≥ 0 , and a le a f v ∈ T , denote b y σ ∆ ( v ) the highest ancestor u of v for which Γ ( u ) ≤ ∆ 2 n . Using the level-ancestor data structure (cf. [7]) the tree T can be prepro cessed in O ( n ) time such that queries for σ ∆ ( v ) (given ∆, and v ) are answered in O (log n ) time. See [15, Sectio n 3 .5] for a simila r suppo rting data structur e. 9 Given ∆ > 0 , define the weigh ted g raph G (∆) as follows. G (∆) = X (∆) , E (∆) , ω (∆) where, X (∆) = { σ ∆ ( v ) : v ∈ X } , E (∆) = { ( σ ∆ ( u ) , σ ∆ ( v )) : ( u, v ) ∈ E , σ ∆ ( u ) 6 = σ ∆ ( v ) } , ω (∆) ( u, v ) = min { ω ( w, z ) : σ ∆ ( w ) = u, σ ∆ ( z ) = v } . Let ρ (∆) be the shortest-path metric on G (∆) . Then, directly fro m the definitions, X (∆) , ρ (∆) is a ∆ 2 -b ounded quotient o f ( X, ρ ). F or a n in teger j ≥ − 1 deno te G j = ( V j , E j , ω j ) wher e G j = G (8 j ) | 8 j / 2 . The following lemma gives an upp er bound on the total size of the graphs G j . Lemma 4. 3 . X j ≥− 1 ( | V j | + | E j | ) = O ( m lg n ) . Pr o of. Fix ( u, v ) ∈ E a nd j ≥ − 1 such that ( σ 8 j ( u ) , σ 8 j ( v )) ∈ E (8 j ) . By the definition o f E (8 j ) , σ 8 j ( u ) 6 = σ 8 j ( v ). By the definition o f ω (8 j ) , ω ( u, v ) ≥ ω (8 j ) ( u, v ) ≥ 8 j 2 n . Also , ( σ 8 j ( u ) , σ 8 j ( v )) ∈ E j if and only if ω (8 j ) ( σ 8 j ( u ) , σ 8 j ( v )) ≤ 8 j 2 . So by the triang le inequalit y ω ( u, v ) ≤ ω (8 j ) ( σ 8 j ( u ) , σ 8 j ( v )) + 8 j , and hence ω ( u, v ) ≤ 1 . 5 · 8 j . That is, each edge of G is represented in G j only when ω ( u, v ) ∈ h 8 j 2 n , 1 . 5 · 8 j i . A total o f O (log n ) scales. By definition, G j contains only non-iso lated vertices, so ∀ j , | V j | ≤ 2 | E j | . Let Pro cessed = { j ≥ − 1 : V j 6 = ∅} . Lemma 4.4. The set of gr aphs ( G j ) j ∈ Pro cessed c an b e c onstructe d in O ( m log 2 n ) exp e cte d time. 6 Sketch of a pr o of. Fir st we sor t the edges in E = { e 1 , . . . e m } in non increas - ing o rder. Ke ep a “s liding window” [ i L ( t ) , i R ( t )], i L ( t ) , i R ( t ) ∈ { 1 , . . . , m } , t ∈ { 1 , . . . , | Pro cessed |} , as follows: Let j 1 = ⌈ log 8 Φ ⌉ . i L (1) = 1, i R (1) = max { i : ω ( e i ) ≥ 8 j 1 / 2 n } . Assuming j t − 1 is alr eady defined, define j t = max { j < j t − 1 : ∃ i, 8 j ≥ ω ( e i ) ≥ 8 j / 2 n } , i L ( t ) = min { i : ω ( e i ) ≤ 8 j t } , and i R ( t ) = max { i : ω ( e i ) ≥ 8 j t / 2 n } . Note that { j t } t = Pro cessed , and the definition gives O ( m ) time alg orithm for co mputing the sequences ( j t ) t , ( i L ( t )) t , and ( i R ( t )) t . Constructing G j t can now b e done in O (( i R ( t ) − i L ( t ) + 1) log n ) time, by o bs erving that the s et of vertices is V j t = { σ 8 j t ( u i ) , σ 8 j t ( v i ) : i ∈ { i L ( t ) , . . . , i R ( t ) } , ( u i , v i ) = e i } , and similarly the set of edg es is E j t = { ( σ 8 j t ( u i ) , σ 8 j t ( v i )) : i ∈ { i L ( t ) , . . . , i R ( t ) } , ( u i , v i ) = e i } . Another log n factor in the construction time comes from the O (log n ) time needed for each query of the form “ σ ∆ ( u )”. Since i R ( t ) − i L ( t ) + 1 = | E j t | , b y Lemma 4.3, P t ( i R ( t ) − i L ( t ) + 1) = O ( m log n ). 6 With a bit more care the running time ca n be i m pro v ed to O ( m log n ). This improv ement, ho w ev er, will not i m pro v e the total construct ion time of the hierar chical partition. 10 Next, we sample (8 j t / 2)-b ounded CKR pa rtition L j t for each G j t . B y Lemma 4.1, ( L j t ) t (implicitly) repr esen ts CKR partitions of G in al l scales . Using Theorem 1 and Lemma 4.3 computing ( L j t ) t is done in O ( m log 3 n ) ex- pec ted time. Hierarchical par titions hav e a n O ( n ) storag e repr esen tation. It is similar to an efficient ultrametric tree repres en tation, such as the nettre e in [15]. Using a ro oted tree P whose leaves co rresp ond to the p oints of X , ea c h internal vertex u has at least tw o children, and is lab eled with a (loga rithm of ) scale, s ( u ). The 8 j -b ounded partition P j is now defined a s follows: F or x ∈ X , P j ( x ) is the highest ancesto r u of x in P such that s ( u ) ≤ j . Since the tre e P do es not hav e vertices of degree 2 , except maybe the ro ot, its size is O ( n ). W e a re left to des cribe how to co mpute the the common refinement of the pullbacks of ( L j t ) t as a hiera rch ical pa rtition represented in the tree structure P o f the pre v ious par agraph. This is done b y top-down fas hion as follows: In the initialization step, P is created a s a ro oted star who se ro ot, r is lab eled by 8 j 1 , and its leav es cor resp ond to { σ 8 j 1 ( u ) : u ∈ X } . Next, inductively assume that P is a hie r archical par tition of { σ 8 j t − 1 ( u ) : u ∈ X } corres ponding to { L j s : s ≤ t − 1 } . W e refine P to include L j t as follows: • Replace the lea ves of P : Each σ 8 j t − 1 ( u ) is r eplaced by { σ 8 j t ( v ) : v ∈ X, σ 8 j t ( v ) is a des cendan t of σ 8 j t − 1 ( u ) } . This step is done in O ( | V j t | ) time b y simply starting from an “o ld leaf” σ 8 j t − 1 ( u ) as a vertex in T a nd descending in T to level 8 j t / 2 n . • Next, incor por ate L j t int o the hierarchical partition in a straig h tforward wa y: Scan the le aves of P , which are in V j t group ed by their par en ts. Fixing such a par e n t u who se ch ildren v 1 , . . . , v ℓ are all leav es, we par titio n v 1 , . . . , v ℓ to subsets { { v 1 , . . . , v ℓ } ∩ C : C ∈ L j t } . F or every such subset of size 2 or mo r e we define a new parent w (whic h will b e a c hild o f u ) with the la bel 8 j t . Hence, the t -th iteration in the algor ithm ab ov e is exe c uted in O ( | V j t | ) time, so the to tal time for co nstructing the commo n refinemen t is O ( m log n ). 5 Applications Pr o of of the first p art of The or em 2. As observed in Section 2 , hiera rchical par- titions cor resp ond to ultr a metrics. As shown in [13], when the partition in ev ery scale is a CKR partition, the resulting dis tribution ov er ultrametr ics is a prob- abilistic embedding with O (log n ) distortion. 7 The algorithm describ ed in Sec- tion 4 sa mples a hiera rchical par tition (and hence a n ultrametric) in O ( m log 3 n ) exp ected time. 7 T echnica lly , in [13 ] the hierarc hical partition w as buil t differently: instead of taking a CKR partition of the whole space in every scale, and then the common refinemen t, at eac h scale they took many CKR partitions, one for each blo c k of the partition of the previous scale. This 11 Pr o of of the se c ond p art of The or em 2. A p oin t x ∈ X is calle d β -padded in hierarchical partition H = ( P − 1 , . . . , P log Φ ), if for every j , B ( x, β 8 j ) ⊂ P j ( x ). The main part of constructing O ( β − 1 )-approximate dista nce oracle based on CKR partitions works as follows [22]: Set X 0 = X , and iteratively on i = 0 , 1 , . . . do: Compute a hier archical CKR partition H i of X i , and o btain an ultrametric H i from H i . Let Y i be a s et of β -padded po in ts in H i that is fo und in Lemma 2.2. Set X i +1 ≔ X i \ Y i , i ≔ i + 1 and repea t until X i = ∅ . The set of ultrametrics ( H i ) i , tog ether with so me supporting data-structur es constitute the approximate distance ora cle. By Lemma 2.2, E | Y i | ≥ | X i | 1 − 32 β , the num b er of iteratio ns until X i = ∅ is in exp ectation a t mos t O ( β − 1 n O ( β ) ), and hence the total storage is as claimed. There are tw o is sues in the construction of ( H i ) i that we ha ve not cov ered yet: First, the task is to sample a hier archical par tition of X i which is only a subset o f the vertices in the g raph G = ( X, E , ω ). This is rather easy to ha ndle by adapting the algorithms in Section 3 and Section 4 to work with subsets of the vertices. The second issue is the computation of β -padded p oints. The β -pa dded po in ts of a (single) ∆-b ounded pa rtition P of a weighted gr aph G = ( V , E , ω ) can b e computed as follows: Add a new vertex s 0 . F or every edge ( u, v ) ∈ E such that P ( u ) 6 = P ( v ), add an edge ( s 0 , u ) w ho se weigh t is ω ( u , v ). Ex ecute Dijkstra’s shortest path algorithm from s 0 , and delete all vertices a t distance at most β ∆ from s 0 . This ca n b e implemented in O ( m + n log n ) time. Note that in the hierarchical partition if a p oint is not in V j then it is padded at scale 8 j . Hence in or der to compute a β padded p oint s e t in hier archical partition, for every t , we cross o ut the p oints which ar e not 2 β -padded in L j t . The rema ined po in ts are β - padded in the pullbacks of ( L j t ) t (as follows from Lemma 4.1 ) and hence also in the hiera rc hical pa rtition. When implemen ted carefully , this ca n be done on every graph G j in O ( | E j | + | V j | lo g n ), and by Lemma 4.3, in a to tal O ( m log 2 n ) time. A t - spanner of a weigh ted graph G = ( V , E , ω ), is a subset of the edg es E ′ ⊂ E such that the sho r test-path metric on ( V , E ′ , ω | E ′ ) is at most t times the shor test-path metric on G . W e need the following result. Theorem 7 ([6 ]) . L et G = ( V , E , w ) b e a weigh te d gr aph with n vertic es and m e dges, and let k ≥ 1 b e an inte ger. A (2 k − 1) -sp anner of with O k n 1+1 /k e dges c an b e c ompute d in O ( k m ) exp e cte d time. Pr o of of The or em 3. By Theorem 7, given an n -p oint metric space ( X, ρ ), a 5- spanner H of ( X, ρ ) with O ( n 4 / 3 ) edges can b e constructed in O ( n 2 ) time. W e next apply the second part o f Theo rem 2 whose r unning time is o ( n 2 ). tec hnicality is inconsequ en tial for probabilistic em beddings. Ho wev er, f or the construction of appro ximate distance oracles, the approac h of [13] do es not seem to work s i nce it do es not ha v e stocha stically indep enden t partitions in the differen t scales. See also [22]. 12 References [1] Ittai Abraham, Y air Bar tal, and Ofer Neiman. Adv ance s in metric embed- ding theory . In J o n M. Klein b erg , editor, STOC , pag es 27 1–286. A CM, 2006. [2] Noga Alon, Ric ha rd M. Karp, David Peleg, and Doug la s W est. A g raph- theoretic ga me and its application to the k -ser v er problem. SIAM J. Com- put. , 24 (1):78–100 , 1995. [3] Y air Barta l. Proba bilis tic approximations of metric space and its algo r ith- mic a pplication. In Pr o c. 37th Ann. IEEE Symp. F oun dations of Computer Scienc e (FOCS’96 ) , pages 183– 193. E lsevier Scienc e P ublishers B. V., Am- sterdam, The Netherlands, The Netherla nds, 1 996. [4] Y air Ba rtal. Graph decomp osition lemmas and their role in metr ic em- bedding metho ds. In Susanne Alber s and T omasz Radzik, editors, ESA , volume 3221 of L e ctu r e Notes in Computer Scienc e , pages 89–9 7. Spr ing er, 2004. [5] Y air Bartal. Embedding finite metric spaces in low dimension. T echnical rep ort, Hebrew Univ er sit y o f Jerusalem, 200 5. [6] Surender Baswana and Sandeep Sen. A simple and linea r time random- ized algo r ithm fo r computing sparse spanners in weighted gr aphs. R andom Struct. Algo rithms , 3 0(4):532– 5 63, 2007. [7] Michael A. Bender a nd Mart ´ ın F arach-Colton. The level ancesto r problem simplified. The or. Comput. Sci. , 321 (1):5–12, 200 4. [8] David Berma n and M. S. K lamkin. A reverse car d shuffle. SIA M Re view , 18(3):491 –492, 197 6. [9] Gerth Stø lting Bro dal. W or st-case efficient prio rit y que ue s . In SO D A ’96: Pr o c e e dings of t he seventh annual ACM -SIAM symp osium on Discr et e al- gorithms , pages 52– 5 8, P hiladelphia, P A, USA, 1996. So ciet y for Industrial and Applied Mathematics. [10] Gruia Calinescu, How ar d Kar loff, and Y uv al Rabani. Approximation al- gorithms fo r the 0-extensio n problem. In Pr o c. 12th Ann. AC M-SIAM Symp. Discr ete Algorithms (SODA’0 1) , pages 8 –16. SIAM, Philadelphia, P A, USA, 2001. [11] E. W. Dijkstra . A no te on t wo problems in c o nnexion w ith gr aphs. Num er. Math. , 1:26 9–271, 19 59. [12] Jittat F akcharoenphol, Chr is Harrels o n, Satis h Rao, and Kunal T alwar. An improv ed approximation algo rithm for the 0-extensio n problem. In Pr o c. 14th Ann. ACM-SIAM Symp. D iscr ete Algo rithms (SODA’03) , pages 257 – 265. ACM, New Y ork, NY, USA, 2003. 13 [13] Jittat F akc ha ro enphol, Satish Rao, and K unal T alwar. A tight bo und on approximating arbitra r y metrics by tre e metrics. J. Comput. System Sci. , 69(3):485 –497, 200 4. [14] Michael L. F redma n and Rob ert Endr e T arjan. Fibona cci heaps a nd their uses in improved net w ork optimiza tio n alg orithms. J. ACM , 34(3 ):596–615 , 1987. [15] Sariel Ha r-Peled and Manor Mendel. F ast constr uction of nets in low di- mensional metrics, and their a pplications. SIAM J. Comput. , 35 :1148–1 184, 2006. [16] Rob ert K rauthgamer, James R. Lee, Manor Mendel, and Assaf Naor. Mea- sured descent: A new embedding metho d for finite metrics. In Pr o c. 45th Ann. IEEE Symp. F oundations of Computer Scienc e (FOCS’04) , pages 434–4 43. IEEE Co mputer So ciety , W ashing to n, DC, USA, 2004. [17] T om Leighton and Satish Rao. Multicommodity max - flo w min-cut the- orems and their use in designing approximation a lg orithms. J. ACM , 46(6):787 –832, 199 9. [18] Nathan Linial, E r an London, a nd Y uri Rabinovic h. The g eometry of gra phs and some of its algo r ithmic a pplications. Combinatoric a , 15(2):215– 245, 1995. [19] Nathan Linial and Michael Saks. Low diameter gra ph decomp ositions. Combinatoric a , 13(4):4 41–454 , 1993. [20] Manor Mendel and Assaf Naor . Maximum gra dien t em beddings and mo no- tone clustering , 200 6. preliminar y version of [2 1]. Accepted to Combina- torica. ar Xiv:cs/ 0606109 . [21] Manor Mendel and Assaf Naor . Maximum gra dien t em beddings and mo no- tone clustering. In Pr o c. Appr oximation, R andomizatio n, and Combi- natorial O ptimization. Algorithms and T e chniques, 10th Int. Workshop (APPRO X’07) and 11th Int. Workshop (RAN DOM’07) , pages 242 – 256. Springer, Ber lin, Ger man y , 200 7. [22] Manor Mendel a nd Assaf Nao r . Ramsey partitions and proximit y data structures. J. Eur op e an Math. So c. , 9 (2 ):253–275 , 2007. [23] Harald R¨ ac ke. Optimal hierar chical deco mpositions for congestion mini- mization in net works. In Pr o c. 40th Ann. ACM Symp. The ory of c omputing (STOC’08) , pag e s 2 55–264 . A CM, New Y ork, NY, USA, 2008. [24] Chay a Sc h w ob. Ramsey partitions based approximate distance oracles. Master’s thesis, The Open Univer- sity of Israel, Ra’anana, Israel, 2008. av ailable at http:/ /sites. google.com/site/mendelma/Home/students/RamseyPartitionsBasedADO_Final.pdf?a t t r e d i r e c t s = 0 . 14 [25] Mikkel Thor up a nd Uri Zwick. Appr oximate distance oracles. J . A CM , 52(1):1–2 4, 2005 . 15
Original Paper
Loading high-quality paper...
Comments & Academic Discussion
Loading comments...
Leave a Comment