Parameterized Low-distortion Embeddings - Graph metrics into lines and trees
We revisit the issue of low-distortion embedding of metric spaces into the line, and more generally, into the shortest path metric of trees, from the parameterized complexity perspective.Let $M=M(G)$ be the shortest path metric of an edge weighted gr…
Authors: Michael Fellows, Fedor Fomin, Daniel Lokshtanov
P arameterized Lo w-disto rtion Em b eddings - Graph metrics i n to lines and trees Mic hael F ello ws ∗ F edor V. F omin † Daniel Loksh tanov † Elena Losievsk a ja ‡ F rances Rosamond ∗ Sak et Saura bh † Abstract W e revisit the issue of low-distortion em b e dding o f metric spaces in to the line, and more generally , int o the shor test path metric of trees, from the parameterized complexity pe rsp ec- tive. Let M = M ( G ) b e the shortest path metric of a n edge weigh ted gr aph G = ( V , E ) on n vertices. W e describe algorithms for the problem of finding a low distor tion non-co ntracting embedding of M int o line and tree metrics . • W e give a n O ( nd 4 (2 d + 1) 2 d ) time algorithm that for a n unweighte d graph metric M and integer d either co nstructs an embedding o f M into the line with dis tortion at most d , o r concludes that no such embedding exists. W e find the res ult surpris ing, b ecause the consider ed problem bear s a strong resemblance to the notorious ly hard Ban dwidth Minimiza tio n problem whic h does not admit any FPT algorithm unless a n unlik ely collapse of par ameterized complexity classes o ccurs . The running time of our alg orithm is a significant improvemen t over the b est previous algorithm of B˘ adoiu et al. [SODA 2005] tha t has a r unning time of O ( n 4 d +2 d O (1) ). • W e show t ha t our algorithm can a lso be applied to co nstruct small distor tion e mbedding s of weighte d gra ph metrics. The r unning time of our alg orithm is O ( n ( dW ) 4 (2 d + 1) 2 dW ) where W is the largest edge w eight of the input graph. T o complement this result, we show that the exp o nent ia l dep endence on the maximum edge weigh t is unav oidable . In particular, we show that deciding whether a weighted g raph metric M ( G ) with max im um weigh t W < | V ( G ) | can b e embedded in to the line with distortion at most d is NP- Complete for every fixed rational d ≥ 2. This rules out any po s sibility of an algor ithm with r unning time O (( nW ) h ( d ) ) wher e h is a function of d a lone. • W e g eneralize the result on embedding in to the line by pr oving that for an y tree T with maximum degree ∆, em b edding of M into a shortest path metric o f T is FPT, parameterize d by (∆ , d ). This result can also b e viewed as a ge neralization (alb eit with a worse running time) of the prev io us FPT algor ithm due to Kenyon, Rabani and Sinclair [STOC 2004] that was limited to the situation where | G | = | T | . ∗ Universit y of Newcastle, New castle, A ustralia. { michael.fellows, frances.rosamond } @newcastle.edu.au † Department of Informatics, Universit y of Bergen, Bergen, Norwa y . { fedor.fomin,dan iello,saket } @ii.uib.no ‡ Dept. of Computer Science, Un ivers ity of Iceland, Iceland. elenal@ hi.is 1 In tro d uction Giv en an un directed graph G = ( V , E ) together with a w eigh t fu nction w that assigns a p ositiv e w eight w ( uv ) to ev ery edge uv ∈ E , a natural metric asso ciated with G is M ( G ) = ( V , D G ) w here the distance function D G 1 is the w eighte d sh ortest path distance b et w een u and v for eac h pair of v ertices u, v ∈ V . W e call M ( G ) as the (w eigh ted) gr aph metric of G . If w ( uv ) = 1 for ev ery edge uv ∈ E , we sa y that M ( G ) = ( V , D G ) is an unweighte d gr aph metric . F or a su b set S of V ( G ), w e sa y that M [ S ] = ( S, D ′′ ) (where D ′′ is D restricted to S 2 ) is the submetric of M ( G ) induced by S . Giv en a graph metric M and another metric space M ′ with distance functions D and D ′ , a m ap p ing f : M → M ′ is called an emb e dding of M into M ′ . The mapping f has c ontr action c f and exp ansion e f if for eve r y p air of p oin ts p , q in M , D ( p, q ) ≤ D ′ ( f ( p ) , f ( q )) · c f and D ( p, q ) · e f ≥ D ′ ( f ( p ) , f ( q )) resp ectiv ely . W e sa y that f is non-c ontr acting if c f is at most 1. A non-cont r acting mapping f has distortion d if e f is at most d . Em b edding a graph metric in to a simp le metric space lik e the real line has pr o v ed to b e a useful to ol in designing algorithms in v arious fields. A long list of app lications giv en in [8] in- cludes app r o ximation algorithms for grap h and net work problems, su c h as sparsest cut, minim um bandwidth , lo w-diameter decomp osition and optimal group steiner trees, and online algorithms for m etrical ta s k systems and file migration problems. These ap p lications often requir e algo- rithms for fi nding lo w distortion em b eddings, and the study of the algo rith m ic issues of metric em b eddings has recently b egun to dev elop [1, 2, 3, 11]. F or example, B˘ adoiu et al. [1, 3] de- scrib e appro ximation algorithms and hardness results for em b ed d ing general metrics in to the line and tree metrics resp ectiv ely . In particular they show that the m inim u m distortion for a line embed ding is hard to appro ximate up to a factor p olynomial in n ev en for weig hted trees with p olynomial sp read (the ratio of maxim um/minimum w eights). Hall and P apadimitriou [9] studied the hardness of appr o ximation f or bijectiv e em b eddings. Indep endent ly fr om the algo- rithmic viewp oint, the pr oblem of finding a lo w-distortion em b edding b etw een metric sp aces is a fundamental m athematical problem [10, 12] that has b een stu died inte n siv ely . In many app lications one needs the distortion of the required em b edd ing to b e relativ ely small. He n ce it is n atural to study the algorithmic issues related to small distortion embedd ings within the framewo r k of parameterized complexit y [6, 7, 13]. T his paradigm asso ciates a natural secondary measuremen t to the pr oblem and studies the algo r ithmic b eha vior of the problem in terms of the asso ciated measurement, called the p ar ameter . In th is pap er we consider a n atural parameter, the distortion d , and consider the feasibilit y of havi n g an algorithm of time complexit y g ( d ) · n O (1) for the pr ob lem of em b edd in g weigh ted graph metrics in to the line with d istortion at most d . What wo u ld one exp ect ab out the complexity of emb edding an unweighte d graph m etric into the line, parameterized by the distortion d ? A t a glance, the problem seems to closely resemble the Ban dwidth Minimiza tion p roblem. In the Ban dwidth Minimiza tion problem one is giv en a graph G = ( V , E ) and aske d to find a bijectiv e mapp ing f : V → { 1 , . . . , n } , f or which the bandwidth , i.e. b = max ( u,v ) ∈ E | f ( u ) − f ( v ) | , is min imized. This problem is kno wn to b e W [ t ]- hard for all t ≥ 1 [4, 5], when p arameterized by b . Unless an unlik ely collapse of parameterized complexit y classes o ccurs, this rules out an y p ossibilit y of having an algorithm with runnin g time g ( b ) · n O (1) for Bandwidth Minimiza tion and thus the algorithm of Saxe [14] running in time O (4 b n b +1 ) is essen tially th e b est p ossible. P r evious to this pap er, the b est algorithm (b y B˘ adoiu et al. [2]) to decide whether an unw eigh ted graph metric can b e embedd ed in to the line with d istortion at most d has a running time where d app ears in the exp onent of n , that is O ( n 4 d +2 · d O (1) ). B˘ adoiu et al. [2] ment ion that for exac t algorithms, this pr oblem s eems to ha ve m an y similarities with the Bandwidth Minimiza tion problem. T hey remark that “... our exact algorithm for computing the distortion is based on the analogous result for the band width 1 W e also denote the distance fun ction D G by D if the graph in consideration is clear from the context. 1 problem by Saxe [14].”. Because of the apparent similarit y to the notoriously hard bandwidth problem, it is v ery surprisin g that, in fact, this fundament al problem of em b edd ing unw eigh ted graph metrics into the line turns out to b e fi x ed parameter tracta b le (FPT). Theorem 1.1. Given an unweighte d gr aph G = ( V , E ) we c an de cide whether M ( G ) c an b e emb e dde d into the r e al line with distortion at most d in time O ( n d 4 (2 d + 1) 2 d ) . The runn ing time of the algorithm is linear for ev ery fixed d an d clearly improv es the runnin g time of the previously kno wn algorithm. In fact, one can apply Th eorem 1.1 in ord er to c hec k whether the unw eigh ted graph metric ca n b e embedd ed in to the line with distortion at most lg n/ lg lg n in time p olynomial in n . Ha ving cop ed with the unw eigh ted case, w e r eturn to the stud y of lo w distortion em b eddings of w eight ed graph m etrics into the line. W e sho w that if the maxim um wei ght of an y edge is b ounded b y W , then we can mo dify th e algorithm presented in Theorem 1.1 to give an algorithm to d ecide whether M ( G ) can b e em b edded into the line with d istortion at most d in time O ( n ( dW ) 4 (2 d + 1) 2 dW ). Ho wev er th e weigh ts in a graph metric d o not need to b e s m all, and hence this algorithm is not sufficien t to giv e a g ( d ) · n O (1) time algo r ithm for the problem of em b eddin g weig hted graph metrics into the line. Can such an algorithm exist? Unfortunately , it turns out that our O ( n ( dW ) 4 (2 d + 1) 2 dW ) algorithm essentiall y is the b est one can h op e for. I n fact, our next r esult rules out not only an y p ossib ility of h a ving an algorithm with r unning time of the f orm g ( d ) · n O (1) , but also an y algorithm with run ning time ( nW ) h ( d ) , wh ere h only dep ends on d . Theorem 1.2. De ciding whether a weighte d gr aph metric M ( G ) with maximum weight W < | V ( G ) | c an b e emb e dd e d into the line with distortion at most d is NP-Complete for every fixe d r atio nal d ≥ 2 . Another direction for generalizi n g Theorem 1.1 is to lo ok for other s imple topologies or host metrics for whic h an analogous result to Theorem 1.1 holds. Keny on et al. [11] pro vided FPT algorithms for the bije ctive em b edding of un weigh ted graph metrics into the m etric of a tr ee with b ound ed maxim um degree ∆. Th e running time of their algorithm is n 2 · 2 ∆ α 3 where α is the maxim um of c f and e f . An im p ortan t p oint , observ ed in [2], is that constraining th e embedd ing to b e bijectiv e (not just injectiv e, as in our case) is cru cial for the correctness of the algorithms from [11]. W e complemen t the FPT r esu lt of Keny on, Rabani and Sinclair [11 ] by extend ing our results to give an algorithm for th e p roblem of emb ed ding unw eigh ted graph metrics into a metric generated by a tree with maxim um degree b oun ded by ∆, parameterized b y distortion d and ∆. Theorem 1.3. Given a gr aph G , a tr e e T with maximum de gr e e ∆ and an inte ger d we c an de cide whether G c an b e emb e dde d into T with distortion at most d in time n 2 · | V ( T ) | · 2 O ((5 d ) ∆ d +1 · d ) . Wh y stop at b ounded degree trees? Can our results b e extended to yield FPT algorithms for lo w distortion em b eddings in to other, more complicated top ologies? At a fi rst glance, this seems to b e the case. Ho wev er, ev en a simple c h ange in the top ology of the h ost metric can c hange the b eha vior of the problem, or eve n mak e the problem complete ly in tractable. F or em b edding in to the lin e it is enough to control the lo cal prop erties of the em b edd ing w hereas this is not sufficien t for em b edd ing in to b oun d ed degree trees. The tec hniques w e use to cop e with these difficulties do not look to b e extendable to the pr oblem of finding low distortio n embedd ings in to cycles, an in teresting open pr oblem that seems to exhibit ev en more non-lo calit y th an that of em b eddin g into b oun ded d egree trees. A more dramatic exa mp le is that of lo w d istortion em b eddings of u n weigh ted graph metrics in to wh eels (cycle with one additional vertex adjacen t to all the vertice s of a cycle). In fact, it turns out that deciding whether one can em b ed an unw eigh ted graph metric in to a wheel with distortion at most 2 is NP-complete, by a simple reduction fr om Ha m il to nian Cycl e problem. T hus, the p roblems of embed d ing an unw eigh ted graph metric int o cycles and trees of unb ounded d egree remain in teresting op en problems. 2 2 Algorithms for Em b edding Graph Metrics in to the Line 2.1 Un w eighted Graph Metrics in to the Line In this s ection we giv e an algorithm for embed ding unw eigh ted graph metrics into the line. W e sligh tly abuse the terminology here b y saying emb e dding of a gr aph G in s tead of em b edding of the un wei ghted graph metric M ( G ) of G . Before we pro ceed to the details of the algo r ith m w e need a few observ atio n s that allo w us to only consider a sp ecific kind of em b eddings. F or a non-con tracting embedd ing f of a graph G in to the line, we sa y that vertex u pushes v ertex v if D ( u, v ) = | f ( u ) − f ( v ) | . Observ a tion 2.1. [ ⋆ ] 2 If f ( u ) < f ( v ) < f ( w ) and u pushes w , then u pushes v and v pushes w . F or an emb ed ding f , let v 1 , v 2 , . . . , v n b e an ordering of the vertice s s uc h that f ( v 1 ) < f ( v 2 ) < . . . < f ( v n ). W e sa y that f is pushing if v i pushes v i +1 , for eac h 1 ≤ i ≤ n − 1. Observ a tion 2.2. [ ⋆ ] If G c an b e emb e dde d into the line with distortion d , then ther e is a pushing emb e dding of G into the line with distort ion d . F urthermor e, every pushing emb e dding of G into the line is non-c ontr acting. Observ a tion 2.3. L et f b e a pushing emb e dding of a c onne cte d gr aph G into the line with distortion at most d . Then D ( v i − 1 , v i ) ≤ d for every 1 ≤ i ≤ n . By Observ ation 2.2 , it is sufficient to work only w ith p ushing em b edd ings. Our algorithm is based on d ynamic programming o v er small in terv als of the line. The in tuition b ehind the algorithm is as follo ws. Let us consider a distortion d embedd ing of G in to the line and an in terv al of length 2 d + 1 of the line. First, observ e that no edge can ha ve on e end-p oint to the left of this in terv al and on e end-p oin t to the righ t. T his means that if there is a vertex u em b edded to the left of this int erv al and another v ertex v that has b een em b edd ed to the righ t, then the set of v ertices em b edded in to the interv al form an u, v -separator. Moreo v er, for eac h edge, its end-p oints can b e mapp ed at most d apart, and hence th er e is no edge with on e end-p oin t to the left of this in terv al and the other end-p oin t in the righ tmost part of this in terv al. Thus just by lo oking a t the vertic es mapp ed int o an inte r v al of length 2 d + 1, we deduce which of the remaining v ertices of G we r e mapp ed to the left and wh ic h w ere mapp ed to the right of this in terv al. Th is is a natural division of the problem in to in dep end en t su bproblems and th e solutions to these su bprob lems can b e used to find an em b edding of G . Next w e formalize th is intuitio n by defining p artial emb e ddings and sh o wing ho w they are glued on to eac h other to form a distortion d em b eddin g of the input graph. It is w ell kno w n (and it follo ws f r om O bserv ation 2.2) that there al wa ys exists an optimal em b edding with all the vertic es embedd ed in to inte ger c o or dinates of the line. Without loss of generalit y , in the rest of this section w e only consider pushing embedd ings of this t yp e. W e also assume th at our input graph G is c onne cte d . Definition 2.4. F or a gr aph G and a subse t S ⊆ V ( G ) , a partial em b eddin g of S is a function f : S → {− ( d + 1) , . . . , d + 1 } . We define S [ a,b ] f , − ( d + 1) ≤ a ≤ b ≤ d + 1 , to b e the set of al l vertic es of S which ar e mapp e d into { a, . . . , b } by f (let us r emark that this c an b e ∅ ). We also define S L f = S [ − ( d +1) , − 1] f and S R f = S [1 ,d +1] f . F or an inte ger x , − ( d + 1) ≤ x ≤ d + 1 , we put S x f = S [ x,x ] f . Final ly, we put L ( f ) ( R ( f ) ) to denote the union of the vertex sets of al l c onne cte d c omp onents of G \ S that have neig hb ors in S L f ( S R f ). 2 Proofs of results lab elled with [ ⋆ ] hav e b een mov ed to the app end ix due to sp ace restrictions. 3 Definition 2.5. A p art i al emb e dding f of a subset S ⊆ V ( G ) is c al le d feasible if (1) f is a non-c ontr acting distortion d emb e dding of S ; (2) L ( f ) ∩ R ( f ) = ∅ ; (3) E v ery neighb or of S 0 f is in S ; (4) if R ( f ) = ∅ , then S d +1 f is nonempty; (5) if L ( f ) = ∅ , then S − ( d +1) f is nonempty; (6) if f ( u ) + 1 < f ( v ) and S [ f ( u )+1 ,f ( v ) − 1] f = ∅ , then f ( v ) − f ( u ) = D ( u, v ) . (Basic al ly, u pushes v .) The prop erties 1, 2, and 3 of this defin ition will be used to sho w that ev ery distortion d em b edding of G in to the line can b e describ ed as a sequence of feasible partial em b eddings that ha ve b een glued ont o eac h other. Prop erties 4, 5 and 6 are h elpful to b ound the num b er of feasible partial emb eddings. Definition 2.6. L et f and g b e fe asible p artial emb e ddings of a gr aph G , with domains S f and S g , r esp e ctively. We say that g su cceeds f if (1) S [ − d,d +1] f = S [ − ( d +1) ,d ] g = S f ∩ S g ; (2) for every u ∈ S f ∩ S g , f ( u ) = g ( u ) + 1 ; (3) S d +1 g ⊆ R ( f ) ; (4) S − ( d +1) f ⊆ L ( g ) . The prop erties 1 and 2 describ e ho w one can glue a partial em b edding g that has b een sh ifted one to th e right on to another partial embed ding f . Prop erties 3 and 4 are emp lo ye d to enforce “in tuitiv e” b eha vior of the sets L ( f ), R ( f ), L ( g ) and R ( g ). That is, since g is glued on the right side of f , ev ery th ing to the righ t of g should app ear in the righ t side of f . Similarly , eve r ything to the left of f should b e to the left of g . Lemma 2.7. [ ⋆ ] F or e very p air of fe asible p artial emb e ddings f and g of subsets S f and S g of V ( G ) such that g suc c e e ds f , we have R ( f ) = R ( g ) ∪ S d +1 g and L ( g ) = L ( f ) ∪ S − ( d +1) f . Theorem 2.8. F or every inte ger d , a gr aph G has an emb e dding of distortion at most d if and only if ther e exists a se quenc e of f e asible p artial emb e ddings f 0 , f 1 , f 2 , . . . , f t such that for e ach 0 ≤ i ≤ t − 1 , f i +1 suc c e e ds f i , and L ( f 0 ) = R ( f t ) = ∅ . Pr o of. Let f b e a pushin g embedd ing of G w ith distortion d whic h maps all v ertices to inte gers greater than or equal to − ( d + 1) and m aps one ve r tex to − ( d + 1). Let t b e th e smallest in teger suc h that f ( v ) ≤ t + d + 1 for ev ery v ∈ V . F or ev ery 0 ≤ i ≤ t , let S i b e the set of vertic es that f maps to { i − ( d + 1) , . . . , i + d + 1 } . W e define f i : S i → {− ( d + 1) , . . . , d + 1 } to b e f i ( v ) = f ( v ) − i , v ∈ S i . Th en for ev ery i ≤ t − 1, f i is a feasible p artial em b edding, f i +1 succeeds f i , and L ( f 0 ) = R ( f t ) = ∅ . In the other dir ection, let f 0 , f 1 , f 2 , . . . , f t b e a sequence of feasible partial emb eddings such that for eac h i , f i +1 succeeds f i and L ( f 0 ) = R ( f t ) = ∅ . Let S i b e the domain of f i . First we sho w that for ev ery v ertex v there is an index i su c h that v ∈ S i . If v / ∈ S 0 , then v ∈ R ( f 0 ). Let k b e the largest integ er suc h that v ∈ R ( f k ). Because R ( f t ) = ∅ , w e ha ve that k < t . Thus, v ∈ R ( f k ) \ R ( f k +1 ). By Lemma 2.7, R ( f k ) \ R ( f k +1 ) ⊆ S d +1 f k +1 whic h implies that v ∈ S k +1 . W e claim that for ev ery v ∈ S i ∩ S j , f i ( v ) + i = f j ( v ) + j . I n deed, let k b e the smallest inte ger suc h that v ∈ S k . Let k ′ = min { t, f k ( v ) + k + d + 1 } . F or ev ery i and j , suc h that k ≤ i, j ≤ k ′ , w e ha ve f i ( v ) + i = f j ( v ) + j . F ur th ermore, if k ′ < t , then v ∈ L ( f k ′ +1 ) and th us b y Lemma 2.7, v ∈ L ( f k ′′ ) for ev ery k ′ < k ′′ ≤ t . Sin ce k is the smallest inte ger suc h that v ∈ S k , we hav e that if v ∈ S i ∩ S j , then f i ( v ) + i = f j ( v ) + j . F r om the previous t wo p aragraphs, w e conclude that there is a f unction f su c h that for ev ery v ∈ S i , f ( v ) = f i ( v ) + i . It remains to prov e that f is a distortion d em b edd ing of G in to the line. W e sa y that a pair of v ertices u and v are in c onflict if either | f ( u ) − f ( v ) | < D ( u, v ), or if | f ( u ) − f ( v ) | > d · D ( u, v ). Let u s note that if no p air of v ertices are in conflict, then f is a distortion d em b edd ing of G . W e pro ve that no tw o vertice s in S i ∪ L ( f i ) are in confl ict by induction on i . F or i = 0 this is tru e as f 0 is a feasible p artial emb ed ding. Assume no w that the statemen t is true for ev ery i < k . If S d +1 f k is empt y , then the statemen t trivially holds for k . Otherwise, for some v ertex v , S d +1 f k = { v } . T o complete the pro of, it is sufficien t to show that v is not in confl ict with an y 4 other v ertex u in S k ∪ L ( f k ). If u is in S k , u and v are not in conflict b ecause f k is a feasible partial embedd ing. If u is not in S k , then u is in L ( f k ) and ev ery shortest path from u to v in G m u st con tain a v ertex w ∈ S L k . Since f ( u ) ≤ f ( w ) ≤ f ( v ), w e hav e that | f ( v ) − f ( u ) | = f ( v ) − f ( w ) + f ( w ) − f ( u ) ≥ D ( v , w ) + D ( w , u ) = D ( v , u ). T herefore, | f ( v ) − f ( u ) | = f ( v ) − f ( w ) + f ( w ) − f ( u ) ≤ d · D ( v , w ) + d · D ( w, u ) = d · D ( v , u ). Thus no p air of v ertices in S i ∪ L ( f i ) are in conflict for ev ery i ≤ t . Ho w ever, for i = t , S i ∪ L ( f i ) = V ( G ) and we conclude that no pair of v ertices are in conflict. F or a v ertex v of a graph G and in teger r ≥ 0 w e denote the ball of radius r cen tered in v , whic h is the set of v ertices at d istance at m ost r in G , by B ( v , r ). The lo c al density of a graph G is δ = max v ∈ V ( G ) ,r> 0 | B ( v ,r ) − 1 | 2 r . W e will apply the follo wing w ell kno wn lo w er b ound on distortion. Lemma 2.9 ([1]) . [Lo cal Densit y] L et G b e a gr aph that c an b e emb e dde d into the line with distortion d . Then d is at le ast the lo c al density δ of G . Applying Lemma 2.9 we can b oun d the n u m b er of p ossible feasible partial em b eddings. Ob- serv e that eac h feasible partial em b ed d ing f can b e repr esen ted as a num b er 1 ≤ t ≤ d and a sequence of v ertices v 0 v 1 . . . v q suc h that t + P q i =1 D ( v i − 1 , v i ) ≤ 2 d + 1 and D ( v i − 1 , v i ) ≤ d for ev ery i ≥ 1. Th is is done b y simply sa ying th at the domain S of f is the set { v 0 , v 1 , . . . , v q } and that f ( v a ) = − ( d + 1) + t + P a i =1 D ( v i − 1 , v i ). Let N ( x ) b e the m axim um n umb er of sequences v 0 v 1 . . . v q suc h that P q i =1 D ( v i − 1 , v i ) = x , where maximum is tak en o v er all v 0 ∈ V ( G ). F or any negativ e num b er x , N ( x ) = 0. Lemma 2.10. F or x ∈ Z , N ( x ) ≤ (2 d + 1) x . Pr o of. W e prov e the Lemma by induction on x . F or x ≤ 0, the statemen t is trivially tru e. Supp ose that the inequalit y holds for ev ery x ′ < x . F or a v ertex v 0 , let S b e the set of all verte x sequen ces v 0 v 1 . . . v q starting with v 0 with the pr op ert y that P q i =1 D ( v i − 1 , v i ) = x . F or i ∈ { 1 , . . . , x } , let S i b e the set of sequen ces in S su c h that D ( v 0 , v 1 ) = i . Let C ( v 0 , i ) = | B ( v 0 , i ) \ B ( v 0 , i − 1) | . Then |S i | ≤ C ( v 0 , i ) · N ( x − i ) and |S | = P x i =1 |S i | ≤ P x i =1 C ( v 0 , i ) · N ( x − i ). By the ind uction assumption, P x i =1 C ( v 0 , i ) · N ( x − i ) ≤ P x i =1 C ( v 0 , i ) · (2 d + 1) x − i . F ur th ermore, b y Lemm a 2.9, we ha ve that P i j =1 C ( v 0 , i ) ≤ 2 di for ev ery i . Beca u se (2 d + 1) y is a con vex function of y , it follo w s that th e sum P x i =1 C ( v 0 , i ) · (2 d +1) x − i sub ject to the constraints P i j =1 C ( v 0 , j ) ≤ 2 di , 1 ≤ i ≤ x , is maximized when eac h of C ( v 0 , i ) = 2 d . In this case P x i =1 C ( v 0 , i ) · (2 d + 1) x − i ≤ 2 d · P x i =1 (2 d + 1) x − i whic h is a geometric sequ en ce with sum upp er b ounded b y 2 d · (2 d + 1) x · P ∞ i =1 (2 d + 1) − i = (2 d + 1) x . Since this holds for eac h c hoice of v 0 , the inequalit y holds also for x . Corollary 2.11. F or a gr aph G with lo c al density at most d the numb er of p ossible fe asible p ar tial emb e ddings of subsets of V ( G ) is at most O ( n (2 d + 1) 2 d ) . Pr o of. By discussions preceding Lemma 2.10, for eac h fi xed first v ertex v 0 and eac h v alue of t , there are at most N (2 d + 1 − t ) feasible partial embedd ings that map v 0 to − ( d + 1) + t Thus the n u m b er of feasible partial em b eddings is at most P d t =1 n N (2 d + 1 − t ). By Lemma 2.10, th is is at most n · P d t =1 (2 d + 1) 2 d +1 − t ≤ 3 2 n (2 d + 1) 2 d . No w w e are in the p osition to prov e Th eorem 1.1. Pr o of. [of T heorem 1.1] The algo r ithm pro ceeds as follo ws. First, c hec k wh ether G h as lo cal densit y δ b ounded by d . Chec king the lo cal densit y of G can b e done in time lin ear in n b ecause if | E ( G ) | ≥ n d w e can immediately answer “no” . If δ > d , ans wer “no”. Other w ise, we can test whether the conditions of theorem 2.8 apply . That is, w e construct a directed graph D where the v ertices are feasible partial em b eddings and there is an edge from a partial em b ed ding f x to a partial em b edd ing f y if f y succeeds f x . Ch ec king the conditions of Theorem 2.8, r educes 5 to chec king for the existence of a directed path starting in a feasible partial em b edding f 0 with L ( f 0 ) = ∅ and endin g in a f easible partial em b edd ing f t with R ( f t ) = ∅ . This can b e done in linear time in the size of D by run ning a depth first searc h in D . The num b er of vertices in D is at most O ( n (2 d + 1) 2 d ). Ev ery vertex of D has at m ost O ( d 2 ) edges going out of it, as a feasible partial em b edding f y succeeding another feasible partial em b edding f x is completely d etermined b y f x together with the v ertex that f y maps to d + 1 (or th e fact that f y do es not map anything there). Using prefix-tree-lik e data structur es one can test whether a give n partial em b ed d ing f x succeeds another in O ( d 2 ) time. T h e total run ning time is then b ounded by O ( nd 4 (2 d + 1) 2 d ). 2.2 W eigh t ed Graph Metrics in to the Line param et erized b y d and W In the previous section, w e ga ve an FPT algorithm for em b edding u n weigh ted graph m etrics into the lin e. Here, we generalize th is result to handle metrics generated by weig hted graphs. More precisely , let G = ( V , E ) b e a graph w ith w eigh t function w : E → Z + \ { 0 } and M = ( V ( G ) , D ) b e the w eight ed shortest path distance metric of G . No w w e giv e an outline of an algorithm for em b edding M in to the line, parameterized by the d istortion d and the maximum edge we ight W , that is, W = max e ∈ E { w ( e ) } . The d efinition of a pushing emb edding an d Ob serv ations 2.1 and 2.2 work out even w hen G is a we ighted graph . Once w e define the notion of p artial em b ed dings, other n otions lik e feasibilit y and succession are adapted in an obvious wa y . Giv en a graph G and a sub set S ⊆ V ( G ), a p artial emb e dding of S is a fu nction f : S → {− ( dW + 1) , . . . , ( dW + 1) } . W e can p ro ve results analogous to Lemma 2.7 and T h eorem 2.8 with the new definitions of p artial emb e ddings, fe asibility and suc c ession . Th u s, w e can give an algorithm f or this pr ob lem similar to the alg orithm p resent ed in Theorem 1.1 . The runtime of this alg orithm is d ominated by the n u m b er of different feasible p artial emb eddings. Let B w ( v , r ) denote the set of vertice s at weighte d distance at most r fr om v and δ w b e the analog ou s notion of weig hte d lo c al density of a graph G . I t is easy to see that if M can b e embedd ed in to the line with distortion at most d then d ≥ δ w . This result immediate ly upp er b ound s the num b er of feasible partial em b eddings by n · ( dW ) O ( dW ) . In what follo ws next w e sho w that the num b er of feasible partial em b eddings actually is b ound ed by n · (2 d + 1) 2 dW . Let N ( x ) b e as in Lemma 2.10. F or eac h fixed first v ertex v 0 in the partial emb edding, and eac h v alue of 1 ≤ t ≤ (2 dW + 1), there are at most N (2 dW + 1 − t ) feasible p artial em b eddings that m ap v 0 to − ( dW + 1) + t . T h u s the num b er of feasible partial emb eddings is at most P dW t =1 n · N (2 dW + 1 − t ). By Lemma 2.10, this is at most n · P dW t =1 (2 d + 1) 2 dW +1 − t ≤ 3 2 n (2 d + 1) 2 dW . Theorem 2.12. Given a weighte d gr aph G with maximum e dge weight W we c an de cide whether M ( G ) c an b e emb e dde d into the r e al line with distortion at most d in time O ( n ( dW ) 4 (2 d + 1) 2 dW ) . 3 Graph Metrics in to the Line is Hard for Fixed Rational d ≥ 2 W e complemen t Th eorem 2.12 by p r o ving that d eciding wh ether a giv en w eigh ted graph metric can b e em b edded in to the line with distortion at most d is NP-complete for ev ery fixed rational d ≥ 2. Ou r redu ction is from 3- Coloring , one of the classical N P -complete problems. On inp ut G = ( V , E ) to 3- Coloring w e sho w ho w to construct an edge weigh ted graph G ′ = ( V ′ , E ′ ). F or an edge uv ∈ E ′ , w ( uv ) will b e th e weigh t if the edge uv . The w eighte d shortest path metric M ( G ′ ) will then b e the inpu t to our emb ed ding problem. Let n = | V | , m = | E | and d = a b ≥ 2 for some in tegers a and b . Let e 1 , e 2 , . . . , e m b e an ordering of the edges of G , and c ho ose the in tegers g = 5 a − 1, r = 10 b , q = m (2 n + 1), L = 10 q b and t = abL + 1. W e start constructing G ′ b y making tw o cliques C 1 and C 2 of size t . Let C 1 = { c 1 , c 2 , . . . , c t } and C 2 = { c ′ 1 , c ′ 2 , . . . , c ′ t } . Let w ( c i c j ) = w ( c ′ i c ′ j ) = ⌈| i − j | /d ⌉ . No w, we make q − 1 sep ar ator vertic es and la b el them s 1 , . . . , s q − 1 . W e mak e q gadget s T 1 , . . . , T q enco ding the edges of G . F or ev ery edge e i = uv there are 2 n + 1 gadgets, namely T i + mp for ev ery 0 ≤ p < 2 n + 1. Eac h such gadget, sa y T i + mp , 6 L 3 r r r r g r 2 r 1 C 1 t C 2 t Figure 1: T he figure sho w s th e ov erall structur e of the construction. The n u m b ers app earing b et ween C 1 and C 2 indicate edge weig hts. consists of three v ertices, one v ertex corr esp onding to u , one verte x corresp on d ing to v and one v ertex corresp ond in g to e i . These thr ee v ertices form a triangle with edges of weig ht 1. F or ev ery j b et wee n 1 and q w e connect all v ertices of T j to s j − 1 and s j with edges of w eigh t g . Whenev er this implies that w e n eed to connect something to the non-existing vertic es s 0 and s q w e connect to c t and c ′ 1 resp ectiv ely . No w, for ev ery pair of vertices x ∈ T i and y ∈ T j that corresp ond to the same v ertex or edge of G we add an edge of w eight r | i − j | b et we en x and y . Finally , w e add an edge with w eigh t L b etw een c t and c ′ 1 . Th is concludes the construction of G ′ . Figure 1 sh o ws the general str ucture of the construction. The next lemma essen tially shows that if there is an edge uv ∈ E ′ then that is the sh ortest weig ht path b et w een u and v in G ′ . Lemma 3.1. [ ⋆ ] F or every e dge uv in E ′ , D G ′ ( u, v ) = w ( uv ) . Lemma 3.2. [ ⋆ ] If G is 3 -c olor able then ther e is an emb e dd ing f of M ( G ′ ) into the line with distortion at most d . Lemma 3.3. If ther e is an emb e dding f of M ( G ′ ) into the line with distortion at most d then G is 3 -c olor able. Pr o of. Without loss of generalit y , w e assume that f is a pushing em b edding (Observ ation 2.2). Let σ b e the ordering of the ve r tices of G imp osed by f . Now we describ e the structure of the ordering σ . T ow ards this, w e first pr ov e that σ orders the vertice s of the clique C 1 consecutiv ely . That is, if u and v are the leftmost and the righ tmost vertex of C 1 with resp ect to the ord ering σ , then there is no ve r tex w in V ′ \ C 1 suc h that f ( u ) < f ( w ) < f ( v ). W e kno w that | f ( u ) − f ( v ) | ≥ | C 1 | − 1. Ho wev er c 1 c t is the only edge in C 1 satisfying | f ( u ) − f ( v ) | ≤ w ( uv ) d . F urth ermore w ( c 1 c t ) d = | C 1 | − 1 and hen ce σ m ust ord er the ve r tices of C 1 consecutiv ely with c 1 and c t as its endp oin ts. Similarly σ m ust ord er the vertices of C 2 consecutiv ely w ith c ′ 1 and c ′ t as its endp oin ts. Also, without loss of generalit y we can assume that C 1 app ears b efore C 2 in our ordering, b ecause if C 2 app ears first w e can reve r se our ord ering. Now, if c t is th e leftmost v ertex of C 1 or c ′ 1 is the righ tmost v ertex of C 2 then th e edge c t c ′ 1 is stretc hed b y a factor more than d , as t > Ld . Th us, c t is the right m ost endp oin t of C 1 and c ′ 1 is the leftmost endp oin t of C 2 . No w, ev ery v ertex not in C 1 or C 2 has to app ear in b et ween C 1 and C 2 b ecause no edge with at least one endp oin t outsid e of C 1 ∪ C 2 is long enough to stretc h o ver the en tire expanse of C 1 or C 2 . Next, we pro v e that σ orders the v ertices as follo ws C 1 , T 1 , s 1 , T 2 , s 2 , T 3 , . . . , T q , C 2 . T o sh o w this, we introd uce the notion of gaps. A gap b et ween tw o v er tices u and v app earing consecutiv ely in σ is simply the in terv al [ f ( u ) , f ( v )] on the real line. W e sa y that a gap is incident to a v ertex u if the ve r tex u is one of the endp oin ts of the gap. The size of the gap is | f ( u ) − f ( v ) | . In the la y out, there are 4 q − 1 v ertices and 4 q gaps that app ear b et ween c t and c ′ 1 . In the follo wing discussion w e w ill treat c t and c ′ 1 as sep arator v ertices. Eac h gap that is inciden t to tw o separator v ertices, one separator v ertex and no separator ve r tex has size at least 2 g , g and 1 r esp ectiv ely . Let x 0 , x 1 and x 2 b e the n umb er of gaps inciden t to 0, 1 and 2 separator v ertices resp ectiv ely . 7 Then | f ( c t ) − f ( c ′ 1 ) | ≥ 2 g x 2 + g x 1 + x 0 and x 0 = 4 q − x 2 − x 1 . F urthermore eac h separator v ertex (except c t and c ′ 1 ) is incident to exactly t wo gaps, while c t and c ′ 1 are inciden t to exactly one gap eac h among the gaps b etw een c t and c ′ 1 . Therefore we h a v e that x 1 + 2 x 2 = 2 q . Substituting x 1 = 2 q − 2 x 2 , we get x 0 = 2 q + x 2 and | f ( c t ) − f ( c ′ 1 ) | ≥ 2 g q + x 0 . Hence, if x 2 > 0 w e hav e | f ( c t ) − f ( c ′ 1 ) | > 2 g q + 2 q = 2(5 a − 1) q + 2 q = 10 aq = 10 aqb/b = 10 q bd = 10 Ld = w ( c t c ′ 1 ) d , con tradicting that the expansion of f is at most d . Thus, x 2 = 0, x 1 = x 0 = 2 q and hence | f ( c t ) − f ( c ′ 1 ) | ≥ 2 g q + 2 q = w ( c t c ′ 1 ) d . Also, if an y gap not incident to an y separator v ertices has size more than 1, or if an y of the gaps incident to a separator v ertex h a ve size m ore than g then | f ( c t ) − f ( c ′ 1 ) | > 2 g q + 2 q = w ( c t c ′ 1 ) d , again cont r adicting that th e expansion of f is at most d . Finally note that g > d and h ence no edge with weig ht one can ev er b e str etc hed ov er a gap of size g . Since the only edges of we ight 1 in G ′ are within a gadget T i and ev ery edge inciden t to a separator vertex has we ight g th is implies that σ m ust ord er the vertic es in the aforemen tioned order C 1 , T 1 , s 1 , T 2 , s 2 , T 3 , . . . , T q , C 2 . This concludes the description of orderin g σ . F or a v ertex v in V , if there is a vertex v ′ in a gadget T i corresp ondin g to v , we lo ok at the p osition that v ′ is assigned by σ compared to the other v ertices of T i . If th e relativ e p osition of v ′ giv en by σ w ith r esp ect to other v ertices of T i is k ∈ { 1 , 2 , 3 } , then w e sa y that the c olor of v in the gadget T i is k and denote it by χ ( v , i ). In all of these cases w e sa y that v has a c olor in T j . W e p ro ve that for any i , j with i < j and v ertex v ∈ V suc h that v has a color in b oth T i and T j then χ ( v , j ) ≤ χ ( v , i ). Sup p ose this is not the ca se, and let u ′ and v ′ b e the v ertices corresp onding to v in gadgets T i and T j suc h that χ ( v , j ) > χ ( v , i ). Then w e kno w that | f ( v ′ ) − f ( u ′ ) | > (2 g + 2) | j − i | = (2(5 a − 1) + 2) | j − i | = 10 a | j − i | b/b = 10 b | j − i | d = r | j − i | d . Ho w ever since b oth u ′ and v ′ corresp ond to v there is an edge of weigh t r | j − i | b etw een u and v whic h is stretc h ed more than d by the em b edding. Thus w e obtain a con tradiction whic h allo ws us to conclude that χ ( v , j ) ≤ χ ( v , i ). Notice that since a v ertex (in a gadget) can ha v e one of thr ee differen t colors this implies that as w e scan the gadgets from T 1 to T q the color of a ve r tex can c hange at most t wice. Thus, th er e m ust b e some 0 ≤ p < 2 n + 1 such th at ev ery vertex of G has the same color in all the gadgets it app ears in among T 1+ mp to T m ( p +1) . Notice that every vertex and ev ery edge of G has a colo r in at least one of these ga d gets. W e can no w mak e a col orin g ψ of the vertice s of G . F or every v ertex v ∈ V , w e look at the gadget T i , 1 + mp ≤ i ≤ m ( p + 1), suc h that there is a v ertex corresp ondin g to v ∈ T i and assign ψ ( v ) = χ ( v , i ). All that remains to p ro ve is that ψ is a prop er coloring. F or ev ery edge uv ∈ E there is an i b et wee n 1 + mp and m ( p + 1) such that the edge uv has a color in T i . Th en b oth u and v ha v e colors in T i and their colors in T i m us t b e d ifferen t. Since ψ ( u ) is equal to u ’s color in T i and ψ ( v ) is equ al to v ’s color in T i this imp lies ψ ( u ) 6 = ψ ( v ) concluding the p ro of. T ogether with the construction of G ′ from G , Lemmas 3.2 and 3.3 imply Theorem 1.2. 4 Em b edd ing Graphs in to T rees of Bound ed Degree Giv en a graph G with shortest path metric D G and a tree T with maxim um degree ∆, havi n g shortest path m etric D T , w e giv e an algorithm that decides whether G can b e em b edd ed into T with distortion at most d in time n 2 · | V ( T ) | · 2 O ((5 d ) ∆ d +1 · d ) . W e assume that the tree T is ro oted, and we w ill refer to the ro ot of T as r ( T ). F or a v ertex v in the tree, T v is the subtr ee of T ro oted at v , and C ( v ) is the set of v ’s c hildren. Finally , for an edge uv of T , let T u ( uv ) and T v ( uv ) b e the tree of T \ uv that con tains u and v resp ectiv ely . Notice that if u is the paren t of v in the tree, then T v ( uv ) = T v and T u ( uv ) = T \ V ( T v ). As in th e pr evious secti on, w e need to d efine feasible p artial em b edd ings together with the notion of succession. F or a v ertex u ∈ V ( T ) and a subset S of V ( G ), a u -p ar tial emb e dding is a function f u : S → B ( u, d + 1). Definition 4.1. F or a u -p artia l emb e dding f u of a su bset S ⊆ V ( G ) and a vertex v ∈ N ( u ) we define S [ v , f u ] = { x ∈ S : f u ( x ) ∈ V ( T v ( uv )) } . Given two inte gers i and j , 0 ≤ i ≤ j ≤ k , 8 let S [ i,j ] [ f u ] = { x ∈ S : i ≤ D ( f u ( x ) , u ) ≤ j } . Final ly, let S [ i,j ] [ v , f u ] = S [ i,j ] [ f u ] ∩ S [ v , f u ] , S k [ v , f u ] = S [ k ,k ] [ v , f u ] for k ≥ 1 and S 0 [ f u ] = S [0 , 0] [ f u ] . Definition 4.2. F or a u -p artia l emb e dding f u of a su bset S ⊆ V ( G ) and a vertex v ∈ N ( u ) we define M [ v , f u ] to b e the union of the vertex sets of al l c onne cte d c omp onents of G \ S that have neighb ors in S [ v , f u ] . Definition 4.3. A u -p artial emb e dding f u of a subset S of V ( G ) is c al le d fe asible if (1) f u is a non-c ontr acting distortion d emb e dding of S i nto B ( u, d + 1) ; (2) f or any distinct p air v , w ∈ N ( u ) , M [ v , f u ] ∩ M [ w , f u ] = ∅ ; (3) N ( S 0 [ f u ]) ⊆ S . Definition 4.4. F or a fe asible u -p ar tial emb e dding f u of a subset S u of V ( G ) and a fe asible v -p artial emb e dding f v of a subset S v of V ( G ) with v ∈ C ( u ) we say that f v succeeds f u if ( 1) S u ∩ S v = ( S [0 ,d ] u [ f u ] ∪ S d +1 u [ v , f u ]) = ( S [0 ,d ] v [ f v ] ∪ S d +1 v [ u, f v ]) ; (2) for every x ∈ S u ∩ S v , f u ( x ) = f v ( x ) ; (3) M [ v, f u ] = S x ∈ N ( v ) \ u ( M [ x, f v ] ⊎ S d +1 u [ x, f v ]) ; and (4) M [ u, f v ] = S x ∈ N ( u ) \ v ( M [ x, f u ] ⊎ S d +1 v [ x, f u ]) . Supp ose w e ha ve p ic ke d out a s ubtree T v for a v ertex v ∈ V ( T ) and found a non-con tracting em b edding f ′ with distortion at most d of a su bset Z of V ( G ) into T ′ = T [ S u ∈ V ( T v ) B ( u, d + 1)]. W e wish to find a n on-con tracting distortion d em b edding of G into T suc h that for ev ery vertex u with f ( u ) ∈ V ( T ′ ), w e ha ve that u ∈ Z and suc h that if u ∈ Z then f ( u ) = f ′ ( u ). A t this p oin t, a natural qu estion arises. C an w e imp ose constraint s on the restriction of f to V ( T ) \ V ( T v ) such that f r estricted to V ( T ) \ V ( T v ) satisfies these conditions if and only if f is a non-con tracting distortion d em b edding of G into T ? On e necessary cond ition is that f restricted to V ( T ) \ V ( T v ) m us t b e a non-con tracting distortion d em b edd ing of { u ∈ V ( G ) : f ( u ) ∈ V ( T ) \ V ( T v ) } . W e can obtain another co n dition by applying the d efinition of feasible u -partial em b eddings. F or eac h ve r tex u , w e can use arguments similar to the ones in Section 2 in order to determine w hic h connected comp onents of T \ V ( T v ) f must m ap u to in order to b e a non-con tracting distortion d em b eddin g of G into T . F or the lin e, these t w o conditions are b oth necessary and sufficien t. Unfortunately , for the case of b ou n ded d egree trees, this is not the case. The reason the conditions are su fficien t when w e restrict ourselv es to the line is that ev ery em b edding of a graph metric into the line that is lo c al ly non-cont r acting and lo c al ly exp anding by a f actor at m ost d , also is glob al ly non- con tracting and expanding by a factor at most d . When we embed in to trees of b ound ed degree, ev ery em b edding that is lo cally expanding by a factor at m ost d , also has this prop ert y glo b ally . Ho w ever, ev ery lo cally non-cont r acting emb edding n eed not b e glob al ly non-cont r acting. T o cop e with this issu e, w e in tro du ce the concept of vertex types. Intuitiv ely , v ertices of the same t yp e in T v are indistin gu ish able w hen view ed f rom T \ V ( T v ). W e show that the s et of p ossible vertex t yp es can b e b ounded by a f unction of d and ∆. Th en, to complete f fr om f ′ w e only n eed to kno w the restriction of f ′ to B ( v , d + 1) and whic h v ertex t yp es app ear in T v . Th en the amoun t of information we need to pass on from f ′ to f is b ounded b y n · h ( d, ∆). W e exploit this fact to giv e an algorithm for the problem. In the rest of this secti on, we formalize this intuitio n . F or a vertex u ∈ T , a n eighb or v of u and a feasible u -partial embedd ing f u of a sub s et S of V ( G ) we defin e a [ v , f u ] -typ e to b e a f unction t : S [ v , f u ] → {∞ , 3 d + 2 , d, . . . , − d, − ( d + 1) } and a [ v, f u ] -typ elist to b e a set of [ v , f u ] -typ es . F or an in teger k let β ( k ) = k if k ≤ 3 d + 2 and β ( k ) = ∞ otherwise. Definition 4.5. F or a vertex u ∈ T with two neighb ors v and w , and a f e asible u -p artial emb e dding f u of a subset S of V ( G ) to gether with a [ v , f u ] -typ elist L 1 and a [ w, f u ] -typ elist L 2 we say that L 1 and L 2 agree if for every typ e t 1 ∈ L 1 and t 2 ∈ L 2 ther e is a vertex x ∈ S [ v , f u ] and a vertex y ∈ S [ w, f u ] such that t 1 ( x ) + t 2 ( y ) ≥ D G ( x, y ) . 9 Definition 4.6. F or a vertex u ∈ T , a neighb or v of u , a f e asible u - p artial emb e dding f u of a sub set S of V ( G ) and a [ v , f u ] -typ elist L we say that L is compatible with S [ v , f u ] if for eve ry vertex x in S [ v , f u ] ther e is a typ e t ∈ L such that for every y ∈ S [ v , f u ] , D T ( f u ( x ) , u ) − D G ( x, y ) = t ( y ) . Definition 4.7. A feasible u -state is a fe asible p artial emb e dding f u of a subset S of V ( G ) to g ether with a [ v , f u ] -typ elist L [ v , f u ] for every v ∈ N ( u ) such that the fol lowing c onditions ar e satisfie d: (1) L [ v , f u ] is c omp at i b le with S [ v , f u ] for every v ∈ N ( u ) ; and (2) F or e v ery p air of distinct vertic es x and y in N ( u ) , L [ x, f u ] agr e es with L [ y , f u ] . Definition 4.8. L et u ∈ V ( T ) , v ∈ C ( u ) . L et X u b e a fe asible u -state and X v b e a fe asible v -state. We say that X v succeeds X u if 1. f v suc c e e ds f u ; 2. F or every w ∈ ( N ( v ) \ u ) and a typ e t 1 ∈ L [ w , f v ] ther e is a typ e t 2 ∈ L [ v , f u ] such that (a) F or every no de x ∈ S [ v , f u ] ∩ S [ w , f v ] , t 2 ( x ) = β ( t 1 ( x ) + 1) ; (b) F or every no de x ∈ ( S [ v , f u ] \ S [ w, f v ]) , t 2 ( x ) = β (max y ∈ S [ w ,f v ] ( t 1 ( y ) + 1 − D G ( x, y ))) . 3. F or every w ∈ ( N ( u ) \ v ) and a typ e t 1 ∈ L [ w , f u ] ther e is a typ e t 2 ∈ L [ u, f v ] such that (a) F or every no de x ∈ S [ u, f v ] ∩ S [ w , f u ] , t 2 ( x ) = β ( t 1 ( x ) + 1) ; (b) F or every no de x ∈ ( S [ u, f v ] \ S [ w , f u ]) , t 2 ( x ) = β (max y ∈ S [ w ,f u ] ( t 1 ( y ) + 1 − D G ( x, y ))) . The m ain resu lt of this section relies on the next tw o lemmas. Lemma 4.9. [ ⋆ ] If ther e is a distortion d emb e dding F of G into T then, for every vertex u of V ( T ) ther e is a f e asible u - state X u such that for every vertex v ∈ V ( T ) , w ∈ C ( v ) , X w suc c e e ds X v . Lemma 4.10. [ ⋆ ] If ther e is a fe asible u -state X u for every vertex u of V ( T ) su c h tha t for every vertex v ∈ V ( T ) , w ∈ C ( v ) , X w suc c e e ds X v then ther e is a distortion d emb e dding F of G into T . Theorem 1.3 [ ⋆ ] Given a g r aph G , tr e e T with maximum de gr e e ∆ and an inte ger d we c an de cide whether G c an b e emb e dde d into T with distortion at most d in time n 2 · | V ( T ) | · 2 O ((5 d ) ∆ d +1 · d ) . 5 Concluding Remarks and Op en Problems In this pap er we describ ed FPT algorithms for em b edding unw eigh ted graph metrics in to a tree metric for a tree of maxim um degree ∆, parameterized by (∆ , d ) where d is the distortion. F or the case when the host metric is th e line, w e generalized our r esult and sho w ed that em b edd ing w eight ed graph metrics in to the line is FPT parameterized b y distortion d and maxim um edge w eight W . A similar generaliza tion can also b e obtained for em b edding w eigh ted graph metrics in to w eigh ted b ound ed degree tree metrics, parameterized by d , ∆ and W wher e W is the maxi- m um edge w eigh t in the input graph. W e p ostp one the details for th e full version of the pap er. Our hardness result that em b edding a w eigh ted metric in to the line is NP-hard for every fixed distortion d ≥ 2 sho wed that our algorithms qualitativ ely are the b est p ossib le. W e b eliev e that our results will lead to further in vesti gation of the com binatorially c hallenging field of lo w d istortion emb eddings within the framew ork of m ultiv ariate algorithmics. W e conclude with tw o concrete interesting op en problems: • What is th e parameterized complexit y of em b eddin g un weigh ted graph metrics in to un- b ound ed degree trees, parameterized b y distortion d ? • What is th e parameterized complexit y of em b edd ing u nw eigh ted graph metrics in to targe t metrics that are minim um distance metrics of cycl es, p arameterized b y d ? 10 References [1] B ˘ adoiu, M., Chuzhoy, J., Indyk, P., and Sidiropoulos, A. Low-distortion emb eddings of ge n eral metrics into the line. In Pr o c e e dings of the 37th Annual ACM Symp osium on The ory of Computing (STO C) (2005 ), A CM, pp. 225–233. [2] B ˘ adoiu, M ., Dhamdhere , K., Gup t a, A., Rabinovich, Y., R ¨ acke, H., Ra v i, R., and Sidir op oulos, A. Appro ximation algorithms for lo w -distortion em b eddings into lo w- dimensional spaces. In Pr o c e e dings of the 16th Annual ACM-SIAM Symp osium on Discr ete Algor ithms (SODA) (20 05), SIAM, pp. 119–128. [3] Bad o iu, M., Indyk, P., and Sidiropoulos, A. App ro ximation algorithms for embed ding general metrics in to trees. In Pr o c e e dings of the 18th A nnual A CM- SIAM Symp osium on Discr ete Algo rithms (SODA) (200 7), ACM and SIAM, pp . 512–521. [4] Bod l aender, H. L., Fellows, M. R., and Hallett, M. T. Bey ond NP-completeness for problems of b ound ed wid th: Hard ness for th e w hierarc hy (extended abstract). In ACM Symp osium on The ory of Computing (1994), pp. 449– 458. [5] Bod l aender, H . L., Fell ows, M . R., Hallett , M. T., W areham, T., and W arnow, T. The hardness of p erfect phylog eny , feasible register assignment and other p roblems on thin co lored graphs. The or. Comput. Sci. 244 , 1-2 (2000), 167–1 88. [6] Downey, R. G., and Fell ows, M. R. Par ameterize d c omplexity . Springer-V erlag, New Y ork, 1999. [7] Fl um, J., and Grohe, M . P ar am e terize d Complexity The or y . T exts in Theoretical Com- puter Science. An EA TCS Series. S pringer-V erlag, Berlin, 2006. [8] Gupt a, A., Newman, I ., Rabinovich, Y., and S inclair, A. Cuts, tr ees and l 1 - em b eddings of graphs. Combina toric a 24 , 2 (2004 ), 233 –269. [9] Hal l, A., and P ap adimitriou, C. H. Approximat in g the distortion. In A ppr oximation, R and omization and Combinatoria l Optimization, Algorithms and T e chniques, 8th Interna- tional Workshop on Appr oxima tion Algorithms for Combinatoria l Optimization Pr oblems (APPRO X- RANDOM) (2005), vol. 3624 of L e ctur e Notes in Comp u ter Scienc e , Spr inger, pp. 111–122. [10] Indyk, P. Algorithmic applications of low-distortio n geometric em b eddings. In Pr o c e e dings of the 42nd IEEE Symp osium on F oundations of Computer Scienc e (FOCS) (200 1), IEEE, pp. 10–33. [11] Ken y on, C., Rabani, Y., and Sinc l air, A. Lo w distortion maps b et ween p oint sets. In Pr o c e e dings of the 36th Annual A CM Symp osium on The ory of Computing (STOC) (200 4), A CM, pp. 27 2–280. [12] Linial, N. Finite metric-spaces—c ombinatorics, geometry and algorithms. In Pr o c e e dings of the Interna tional Congr ess of M athematicians, V ol. III (Beijing, 2002), Higher Ed. Press, pp. 573–586. [13] Niederm eier, R. Invitation to fixe d-p ar ameter algorith ms , v ol. 31 of O xf or d L e c tu r e Series in Mathematics and its Applic atio ns . Oxford Univ ers it y Press, O x f ord, 2006. [14] Sax e , J. B. Dynamic programming algo r ithms for recognizing small band width graphs in p olynomial time. SIAM J. on Algebr aic and D iscr ete Metho ds 1 , 4 (1980), 363 –369. 11 6 App endix Pro of of Observ a tion 2.1: If f ( u ) < f ( v ) < f ( w ) and u pushes w , then u pushes v and v pushes w . Pr o of. By the triangle inequalit y , D ( u, w ) ≤ D ( u, v ) + D ( v , w ). Since u pushes w and b ecause f is n on-con tracting, we ha ve that D ( u, w ) = f ( w ) − f ( u ) = ( f ( w ) − f ( v )) + ( f ( v ) − f ( u )) ≥ D ( u, v ) + D ( v , w ) = D ( u, w ). Since f ( w ) − f ( v ) ≥ D ( v , w ) and f ( v ) − f ( u ) ≥ D ( u, v ) w e ha v e f ( w ) − f ( v ) = D ( v , w ) and f ( v ) − f ( u ) = D ( u, v ). Pro of of Observ ation 2.2: If G c an b e emb e dde d into the line with distortion d , then ther e is a pushing emb e dd ing of G into the line with distortion d . F urthermor e, every pushing emb e dding of G into the line is non-c ontr acting. Pr o of. Among all emb eddings of G in to th e line with d istortion d , let us c h o ose f such that X 2 ≤ i ≤ n | f ( v i ) − f ( v i − 1 ) | is minimized . W e claim th at f is push ing. Indeed, if f is not p ushin g, then there is a minim u m in teger q ≥ 1 su c h that v q do es not p ush v q +1 . By O bserv ation 2.1, for every p ≤ q and r ≥ q + 1, D ( v p , v r ) > f ( v r ) − f ( v p ). But then embed d ing f ′ , f ′ ( v i ) = f ( v i ) for i ≤ q and f ′ ( v i ) = f ( v i ) − 1 for i > q , is non-con tracting embed ding of d istortion d , whic h is a co ntradiction to the c hoice of f . T o pr o ve th at ev ery pushing em b edding of G into the line is non-con tracting, we observ e that for eac h b > a ≥ 1, f ( v b ) − f ( v a ) = P b i = a +1 f ( v i ) − f ( v i − 1 ) = P b i = a +1 D ( v i , v i − 1 ) ≥ D ( v a , v b ). Pro of of Lemma 2.7: F or every p air of fe asible p ar tial e mb e ddings f and g of subsets S f and S g of V ( G ) such that g suc c e e ds f , we have R ( f ) = R ( g ) ∪ S d +1 g and L ( g ) = L ( f ) ∪ S − ( d +1) f . Pr o of. Let u s prov e that R ( f ) = R ( g ) ∪ S d +1 g . (Th e pro of of L ( g ) = L ( f ) ∪ S − ( d +1) f is similar.) Because g succeeds f , w e ha ve that S d +1 g ⊆ R ( f ). Let C b e the v ertex set of a connected comp onent of G \ S g suc h that C ⊆ R ( g ). As S − ( d +1) f ⊆ L ( g ), th e subgraph G [ C ] ind uced by C , is a connected comp onent of G \ ( S f ∪ S g ). If C con tains a n eigh b or of S d +1 g , then C ⊆ R ( f ) (this is b ecause S d +1 g ⊆ R ( f ) and C and S d +1 g are in the same connected comp onent of G \ S f ). On the other h and, if C con tains no neigh b or of S ( d +1) g , then, as C ⊆ R ( g ), C has a n eigh b or in S (1 ,d ) g ⊆ S R f . Therefore C ⊆ R ( f ), whic h in tur n implies that R ( g ) ⊆ R ( f ). T h u s, we h a ve pro ved that R ( g ) ∪ S d +1 g ⊆ R ( f ). Let us now sh o w that R ( f ) ⊆ R ( g ) ∪ S d +1 g . Let C b e the vertex set of a conn ected comp onent of G \ S f suc h that C ⊆ R ( f ). C con tains no neigh b ors of S − ( d +1) f th us C is a connected comp onent of G \ S ( − ( d +1) ,d ) g . If C do es not con tain S d +1 g , th en C is a conn ected comp onen t of G \ S g . F urth er m ore, as C ⊆ R ( f ), C has a neighbor in S (1 ,d +1) f ⊆ S (0 ,d ) g . As S 0 g has no neigh b ors outside of S g , C has a neigh b or in S R g implying C ⊆ R ( g ). On the other hand, if C con tains S d +1 g , then ev ery connected comp onen t C ′ of G [ C ] \ S d +1 g is a connected comp on ent of G \ S g that has a n eigh b or in S d +1 g ⊆ S R g . T his concludes the pro of that R ( f ) ⊆ R ( g ) ∪ S d g , implying R ( f ) = R ( g ) ∪ S d +1 g . Pro of of Lemma 3.1: F or ev ery edge uv in E ′ , D G ′ ( u, v ) = w ( uv ). Pr o of. Clearly , D G ′ ( u, v ) ≤ w ( uv ) for eve r y edge uv , s o it is sufficient to prov e D G ′ ( u, v ) ≥ w ( uv ). If w ( uv ) = 1 then D G ′ ( u, v ) ≥ w ( uv ), so su pp ose w ( uv ) > 1. In this case uv either h as 12 • b oth endp oin ts in C 1 or C 2 , or • is the edge c t c ′ 1 , or • is an edge from c t to a v ertex in T 1 , or • an edge f r om c ′ 1 to a v ertex in T q , or • an edge in ciden t to a separator vertex or • an edge b et ween a vertex in a gadge t T i and a v ertex in a gadget T j . If b oth u and v lie inside C 1 ev ery sh ortest u − v path lies entirely within C 1 . F or ev ery w in C 1 w e h a ve that w ( u, v ) ≤ w ( u, w ) + w ( w , v ) so w ( uv ) ≤ D G ′ ( u, v ). Similarly , if b oth u and v lie inside C 2 then w ( uv ) ≤ D G ′ ( u, v ). If uv is incident to a s ep arator v ertex then w ( uv ) = g and D G ′ ( uv ) ≥ g b ecause eve r y separator v ertex is only inciden t to edges with w eigh t g . If uv is an edge from c t to a v ertex in T 1 or an edge from c ′ 1 to a v ertex in T q then w ( uv ) = g and D G ′ ( uv ) ≥ g b ecause ev ery edge with one end p oint inside C 1 ∪ C 2 and one endp oin t outside of C 1 ∪ C 2 has weigh t exactly g . No w, if uv is an edge b et wee n a v ertex in a gadget T i and a verte x in a gadget T j , w ( uv ) = r | i − j | . Observ e that a p ath from u to v with length smaller than r | i − j | can nev er use the edge c t c ′ 1 and th us will n ev er visit the set C 1 ∪ C 2 . W e prov e that the distance b et we en u and v is at least r | i − j | b y induction on | i − j | . I f | i − j | = 1 then an y path con taining an edge with one endp oin t in T i ′ and another in T j ′ with i ′ 6 = j ′ will ha v e length at least r . Any path fr om u to v that do es not con tain any such edges m ust con tain at least one separator vertex as an in intermediate v ertex and th us ha v e length at least 2 g = 20 a − 2 > 10 b = r . W e no w s u pp ose that th e ind u ction hyp othesis is true when ev er | i − j | < z and sh o w that it also must hold when | i − j | = z . If a p ath P from u to v con tains a ve r tex u ′ from a gadget T i ′ with i ′ 6 = i , i ′ 6 = j and | i ′ − i | + | j − i ′ | = | i − j | then the induction h yp othesis implies that th e length of P is at least | i ′ − i | r + | j − i ′ | r = | i − j | r . If P con tains no suc h v ertices as in termediate v ertices then P m ust con tain at least one edge with one end p oint in T i ′ and another in T j ′ suc h that | i ′ − j ′ | ≥ | i − j | . In this case the length of P is at least | i ′ − j ′ | r ≥ | i − j | r , concludin g the p ro of that the distance b et ween a v ertex u in a gadget T i and a v ertex v in a gadget T j is at least r | i − j | . It remains to s h o w that D G ′ ( c t c ′ 1 ) > L . If a shortest path P fr om c t to c ′ 1 a v oids the edge c t c ′ 1 , the first ve r tex in P after c t m us t b e a v ertex u in T 1 , and the last v ertex in P b efore c ′ 1 m us t b e a v ertex v in T q . Thus, b y the discus sion in the previous paragraph, the length of P is at least 2 g + ( q − 1) r ≥ q r = 10 q b = L , concluding the pro of. Pro of of Lemma 3.2: If G is 3-colorable th en there is an em b edd ing f of M ( G ′ ) in to the line with d istortion at most d . Pr o of. Let ψ : V ( G ) → { 1 , 2 , 3 } b e a pr op er 3-col orin g of the ve r tices of G . W e extend ψ to also color the edges, by defining ψ ( uv ) = { 1 , 2 , 3 } \ { ψ ( u ) , ψ ( v ) } for ev ery edge uv ∈ E ( G ), that is ev ery ed ge gets a color d ifferen t from its t wo end p oints. W e giv e an ord ering of the vertices of G ′ , and the embed d ing f of G ′ in to the line is the pushin g emb edding imp osed by this ordering. W e order the v ertices of G ′ as follo ws: C 1 , T 1 , s 1 , T 2 , s 2 , . . . , T q , C 2 . Here, the ve r tices inside C 1 and C 2 are ord ered like { c 1 , . . . , c t } and { c ′ 1 , . . . , c ′ t } resp ectiv ely and the v ertices inside eac h gadge t T i are ordered b y color. Th at is, if T i corresp onds to an edge e = uv and con tains the v ertices u ′ , v ′ and e ′ corresp ondin g to u , v and e r esp ectiv ely , w e sort u , v and e in increasing ord er by ψ and use the corresp onding order imp osed by this for the v ertices in T i . Observ ation 2.2 implies th at the push ing em b edd in g f is non-contrac ting. T h u s, it suffices to sho w that the expansion of f is at most d . Because of Lemma 3.1 it suffices to sho w that | f ( u ) − f ( v ) | ≤ w ( uv ) d for ev ery edge uv ∈ E ′ . F or edges with b oth endp oin ts in C 1 or b oth endp oin ts in C 2 this inequalit y holds. F or an edge uv b et ween a separator v ertex and a v ertex in a gadget T i w e ha v e | f ( u ) − f ( v ) | ≤ g + 2 ≤ dg = dw ( uv ). F or an edge uv b et ween tw o v ertices in the same gadget T i w e h a v e | f ( u ) − f ( v ) | ≤ 2 ≤ dw ( uv ). No w, for the edge c t c ′ 1 , 13 | f ( c ′ 1 ) − f ( c t ) | = (2 g + 2) q = 10 aq = 10 q ba/b = Ld = w ( c t c ′ 1 ) d . Similarly , an y edge uv with one end p oint in T i and the other in T j for i 6 = j has the prop erty that u and v corresp ond to the same vertex (or edge) of G and th us are giv en the same colo r b y ψ . Hence | f ( c ′ 1 ) − f ( c t ) | = (2 g + 2) | i − j | = 10 a | i − j | = 10 b | i − j | a/b = r | i − j | d = w ( uv ) d . As all edges of G ′ no w are accoun ted for, th is means that the expansion of f is at most d . Pro of of Lemma 4.9 If ther e is a distortion d emb e dding F of G into T then, for every vertex u of V ( T ) ther e is a fe asible u -state X u such that for every vertex v ∈ V ( T ) , w ∈ C ( v ) , X w suc c e e ds X v . Pr o of. W e start by giving a feasible u -partial em b edding f u for eac h verte x of the tree. Recall that a feasible u -state con tains a feasible u -partial emb edding f u of a subset S u of V ( G ). F or a v ertex u ∈ V ( T ) w e defin e f u to b e the restriction of F to B ( u, d + 1). It is easy to see that f u indeed is a feasible p artial em b edd in g for ev ery u and that for ev ery vertex v ∈ V ( T ) , w ∈ C ( v ), f w succeeds f v . No w, for every v ertex u ∈ V ( T ) and v ∈ N ( v ) we give a t yp elist L [ v , f u ]. F or ev ery v ertex x ∈ ( S [ v , f u ] ∪ M [ v , f u ]) w e add a [ v , f u ]-t yp e t x [ v , f u ] to L [ v , f u ]. F or a v ertex y ∈ S [ v , f u ], t x [ v , f u ]( y ) = β ( D T ( F ( x ) , u ) − D G ( x, y )). Notice that since y ∈ B ( u, d + 1) and F is non- con tracting, by the triangle inequ alit y it follo w s that t x ( y ) ≥ − ( d + 1) and thus t x is a [ v , f u ]-t yp e. F u rthermore, for every u ∈ V ( T ), L [ v , f u ] is compatible w ith S [ v , f u ] b ecause for ev ery x and y in S [ v , f u ] w e h a ve that t x [ v , f u ]( y ) = β ( D T ( F ( x ) , u ) − D G ( x, y )). In order to sho w that eac h state X u is a feasible u -state it remains to sho w that for ev ery v ertex u ∈ V ( T ) and ev ery pair of distinct ver- tices v and w in N ( u ), L [ v , f u ] agrees with L [ w , f u ]. Assume f or cont r adiction that there is a type t a [ v , f u ] ∈ L [ v , f u ] and a type t b [ w, f u ] ∈ L [ w , f u ] suc h that t a [ v , f u ]( x )+ t b [ w, f u ]( y ) < D G ( x, y ) for ev ery x ∈ S [ v , f u ] and y ∈ S [ w , f u ]. Let x ′ ∈ S [ v , f u ] and y ′ ∈ S [ w , f u ] b e the pair of v ertices that maximizes t a [ v , f u ]( x ′ ) + t b [ w, f u ]( y ′ ) − D G ( x ′ , y ′ ). T here is a verte x a ∈ ( S [ v , f u ] ∪ M [ v , f u ]) and a v ertex b ∈ ( S [ w , f u ] ∪ M [ w , f u ]) suc h that β ( D T ( f ( a ) , u ) − D G ( a, x )) = t a [ v , f u ]( x ) for every x ∈ S [ v , f u ] and β ( D T ( F ( b ) , u ) − D G ( b, y )) = t b [ w, f u ]( y ) f or eve r y y ∈ S [ w , f u ]. This yields D T ( F ( a ) , u ) − D G ( a, x ′ ) + D T ( F ( b ) , u ) − D G ( b, y ′ ) = ( D T ( F ( a ) , u ) + D T ( F ( b ) , u )) − ( D G ( a, x ′ ) + D G ( b, y ′ )) < D G ( x ′ , y ′ ). No w , ( D T ( F ( a ) , u ) + D T ( F ( b ) , u )) = D T ( F ( a ) , F ( b )) since u lies on the un iqu e f ( a )- f ( b ) path in T . Also, Since x ′ and y ′ are the pair that maximize t a [ v , f u ]( x ′ ) + t b [ w, f u ]( y ′ ) − D G ( x ′ , y ′ ) and ev ery shortest x ′ - y ′ path in G m u st pass b oth thr ou gh S [ v , f u ] and S [ w , f u ], w e conclude that ( D G ( a, x ′ ) + D G ( b, y ′ ) + D G ( x ′ , y ′ )) = D G ( a, b ). Ho wev er this imp lies D T ( F ( a ) , F ( b )) < D G ( a, b ) con tradicting that F is n on-con tracting. It remains to pro v e th at f or eve r y ve r tex u ∈ T , v ∈ N ( u ), w ∈ ( N ( v ) \ u ) and type t 1 ∈ L [ w , f v ] there is a t yp e t 2 ∈ L [ v , f u ] such that 1. for ev ery no de x in S [ v , f u ] ∩ S [ w , f v ], t 2 ( x ) = β ( t 1 ( x ) + 1); 2. for ev ery no de x in S [ v , f u ] \ S [ w , f v ], t 2 ( x ) = β (max y ∈ S [ w ,f v ] ( t 1 ( y ) + 1 − D G ( x, y ))). Let t a [ w, f v ] ∈ L [ w, f v ], and let a b e the v ertex of S [ w , f v ] ∪ M [ w , f v ] such that for ev ery x in S [ w , f v ], t a [ w, f v ]( x ) = β ( D T ( F ( a ) , v ) − D G ( a, x )). No w, S [ w , f v ] ∪ M [ w, f v ] ⊆ S [ v , f u ] ∪ M [ v, f u ] so a ∈ ( S [ v , f u ] ∪ M [ v , f u ]). Let t ′ a [ v , f u ] b e the type in L [ v , f u ] so that for ev ery x ′ in S [ v , f u ], t ′ a [ v , f u ]( x ′ ) = β ( D T ( F ( a ) , u ) − D G ( a, x ′ )). As β ( D T ( F ( a ) , u )) = β ( D T ( F ( a ) , v ) + 1) it is easy to see that for ev ery n o de x ∈ ( S [ v , f u ] ∩ S [ w, f v ]), t ′ a [ v , f u ]( x ) = β ( t a [ w, f v ]( x ) + 1). Finally , observe that for a v ertex x ∈ ( S [ v , f u ] \ S [ w , f v ]) ev ery a - x path in G m u st pass through S [ w , f v ]. Thus D G ( a, x ) = min y ∈ S [ w ,f v ] D G ( a, y ) + D G ( x, y ) and so t ′ a [ v , f u ]( x ) = β (max y ∈ S [ w ,f v ] ( t a [ w, f v ]( y ) + 1 − D G ( x, y ))). This concludes the pro of. Pro of of Lemma 4.10: If ther e is a fe asible u - state X u for every vertex u of V ( T ) such that for every vertex v ∈ V ( T ) , w ∈ C ( v ) , X w suc c e e ds X v then ther e is a distor tion d emb e dding F of G into T . 14 Pr o of. F or ev ery verte x u , let f u b e the feasible u -partial em b edding of the subset S u ⊆ V ( G ) in X u . W e pro v e the lemma by provi n g a series of claims Claim 6.1. F or every vertex x ∈ V ( G ) ther e is a u ∈ V ( T ) such that x ∈ S u . Pr o of. If x ∈ S r ( T ) w e are done, so assume that x / ∈ S r ( T ) . Th is m eans that x ∈ S v ∈ C ( r ( T )) M [ v , f r ( T ) ]. Let v 1 ∈ C ( r ( T )) b e a v ertex such that x ∈ M [ v 1 , f r ( T ) ]. O bserve that the c hoice of v 1 implies that x / ∈ M [ r ( T ) , f v 1 ]. No w , if x ∈ S v 1 w e are done, otherwise x ∈ S v ∈ C ( v 1 ) M [ v , f v 1 ]. Let v 2 b e the v ertex in C ( v 1 ) so that x ∈ M [ v 2 , f v 1 ]. Again, the c hoice of v 1 implies that x / ∈ M [ v 1 , f v 2 ]. If x ∈ S v 2 w e are done, otherwise w e can select v 3 , v 4 and so on until w e select a leaf v q . The choice of v q implies that x ∈ S v q ∪ S v ∈ C ( v q ) M [ v , f v q ] = S v q . Claim 6.2. F or every vertex x ∈ V ( G ) , the set { u ∈ V ( T ) : x ∈ S u } induc es a c onne cte d subtr e e of T . Pr o of. Su pp ose for con tradiction that this is not the case. Then there is a pair of vertic es u, v ∈ V ( T ) suc h th at x ∈ S u , x ∈ S v , uv / ∈ E ( T ) and f or ev ery w on the u - v -path in T , x / ∈ S w . Let w ′ and w ′′ b e the p redecessor and s u ccessor of w on the u - v path resp ectiv ely . By the prop erties of succession of feasible u -partial em b eddin gs b oth M [ w ′ , f w ] and M [ w ′′ , f w ] m u st con tain x . T his con tradicts that f w is a feasible partial embedd ing. F r om Claim 6.2 together with prop ert y 2 of s u ccession feasible u -partial embed d ings it is clear that for ev ery pair of vertic es u and v in V ( T ) such that x ∈ S u and x ∈ S v , f u ( x ) = f v ( x ). W e can therefore defin e a function F : V ( G ) → V ( T ) su c h that for ev ery x ∈ V ( G ) and u ∈ V ( T ) it holds that if x ∈ S u then F ( x ) = f u ( x ). This prop ert y also guaran tees F m aps distinct v ertices of G onto distinct v ertices of T . In the rest of the pro of of L emm a 4.10 we will pro ve that the expansion of F is at m ost d and that F is non-con tracting. Claim 6.3. The exp ansion of F is at most d . Pr o of. It su ffices to pr o v e that F expands every edge of G by at most a factor of d . Let xy ∈ E ( G ). Let u = F ( x ). By the p rop erty 3 of feasible u -partial em b eddings y ∈ S u . F urthermore, since f u is a feasible u -partial embed d ing, D T ( F ( x ) , F ( y )) = D T ( f u ( x ) , f u ( y )) ≤ d wh ic h completes the pro of W e now pro ceed to prov e that F is non-con tracting. Claim 6.4. F or every p ath P = v 1 v 2 ...v k in T , with v 1 = u and v k = w the fol lowing must apply. 1. F r estricte d to S v i ∈ P S v i is non-c ontr acting. 2. F or every vertex x ∈ S w one of the f ol lowing two c onditio ns must hold . (a) either ther e i s a v j ∈ P , y ∈ S v j such that D T ( F ( x ) , v j ) − D G ( x, y ) > 3 d + 2 (b) or ther e is a typ e t x [ v 2 , f u ] ∈ L [ v 2 , f u ] such that for every y ∈ S [ v , f u ] , t x [ v 2 , f u ]( y ) = D T ( F ( x ) , u ) − D G ( x, y ) . Pr o of. W e pro ve the claim by indu ction on k . If k = 1 th en (1) is tr ue b ecause f u is a feasible partial emb edding and (2 b ) holds b ecause of the compatibilit y constraints of feasible u -states. F or k = 2, w e fir st pr o v e that (2 b ) holds for ev ery x ∈ S w . If x ∈ S u then (2 b ) holds b ecause of the compatibilit y constrain ts of feasible u -states. Therefore, consider a v ertex x ∈ S w \ S u . Th en x ∈ S d +1 w [ w ′ , f w ] for a w ′ ∈ ( N ( w ) \ u ). By compatibilit y , ther e is a t yp e t 1 [ w ′ , f w ] ∈ L [ w ′ , f w ] suc h that for every y in S w , t 1 [ w ′ , f w ]( y ) = D T ( F ( x ) , w ) − D G ( x, y ). By the pr op erties of su ccession of feasible u -states, there is a typ e t 2 [ w, f u ] ∈ L [ w , f u ] suc h that 15 1. F or ev ery no de y in S [ w, f u ] ∩ S [ w ′ , f w ], t 2 [ w, f u ]( y ) = β ( t 1 [ w ′ , f w ]( y ) + 1) = t 1 [ w ′ , f w ]( y ) + 1 = D T ( F ( x ) , w ) − D G ( x, y ) + 1 = D T ( F ( x ) , u ) − D G ( x, y ) . 2. F or ev ery no de y in S [ w, f u ] \ S [ w ′ , f w ], t 2 [ w, f u ]( y ) = β max z ∈ S [ w ′ ,f w ] ( t 1 [ w ′ , f w ]( z ) + 1 − D G ( z , y )) = max z ∈ S [ w ′ ,f w ] t 1 [ w ′ , f w ]( z ) + 1 − D G ( z , y ) = max z ∈ S [ w ′ ,f w ] ( D T ( F ( x ) , w ) − D G ( x, z ) + 1 − D G ( z , y )) = D T ( F ( x ) , u ) − D G ( x, y ) . Th u s (2 b ) holds for eve r y x in S w . Using this fact w e can n o w p ro ve (1). Observe that it is sufficien t to pro ve that F d o es not con tract an y verte x y ∈ ( S u \ S w ) and x ∈ ( S w \ S u ). L et u ′ b e the neighbor of u suc h that y ∈ S [ u ′ , f u ]. By (2 b ) there is a t yp e t x [ w, f u ] such that for every z ∈ S [ w , f u ], t x [ w, f u ]( z ) = D T ( F ( x ) , u ) − D G ( x, z ). By th e prop erties of feasible u -states th er e is a t yp e t y [ u ′ , f u ] suc h that for ev ery z ∈ S [ u ′ , f u ], t y [ u ′ , f u ]( z ) = D T ( F ( y ) , u ) − D G ( y , z ). Since t x [ w, f u ] and t y [ u ′ , f u ] m ust agree, it follo ws that there is a vertex x ′ ∈ S [ w, f u ], and a v ertex y ′ ∈ S [ u ′ , f u ] suc h that t x [ w, f u ]( x ′ ) + t y [ u ′ , f u ]( y ′ ) ≥ D G ( x ′ , y ′ ). By su bstituting f or t x [ w, f u ]( x ′ ) and t y [ u ′ , f u ]( y ′ ) w e obtain D T ( F ( x ) , F ( y ) − D G ( x, y ) ≥ D T ( F ( x ) , u ) − D G ( x, x ′ ) + D T ( F ( y ) , u ) − D G ( y , y ′ ) − D G ( f ( x ′ ) , f ( y ′ ) ≥ 0 . Finally , sup p ose the state ment of the claim holds for ev ery k ′ < k for some k > 2. W e pro ve th at the statemen t also must hold for k . W e start b y sho wing (2). C onsider a vertex x ∈ S w suc h that for ev ery v j , j ≥ 1 and ev ery y ∈ S v j w e hav e that D T ( F ( x ) , v j ) − D G ( x, y ) ≤ 3 d + 2, that is, (2 a ) do es not hold for x . W e n eed to show that (2 b ) m ust hold for x . By the inductiv e hypothesis there is a t yp e t x [ v 3 , f v 2 ] ∈ L [ v 3 , f v 2 ] so that for ev ery y ∈ S [ v 3 , f v 2 ], t x [ v 3 , f v 2 ]( y ) = D T ( F ( x ) , v 2 ) − D G ( x, y ). F urtherm ore, b y th e assum p tion that (2 a ) does not hold f or x , t x [ v 3 , f v 2 ] ≤ 3 d + 2. By the p rop erties of succession of feasible u -states there must b e a typ e t ′ x [ v 2 , f u ] ∈ L [ v 2 , f u ] suc h that: 1. F or ev ery no de y in ( S [ v 2 , f u ] ∩ S [ v 3 , f v 2 ]): t ′ x [ v 2 , f u ]( y ) = β ( t x [ v 3 , f v 2 ]( y ) + 1) = β ( D T ( F ( x ) , v 2 ) − D G ( x, y ) + 1) = β ( D T ( F ( x ) , u ) − D G ( x, y )) . Observe that if β ( D T ( F ( x ) , u ) − D G ( x, y )) = ∞ then D T ( F ( x ) , u ) − D G ( x, y ) > 3 d + 2 whic h implies that (2 a ) h olds for x whic h is a cont r adiction. Th erefore, β ( D T ( F ( x ) , u ) − D G ( x, y )) 6 = ∞ so β ( D T ( F ( x ) , u ) − D G ( x, y )) = D T ( F ( x ) , u ) − D G ( x, y ). 2. F or ev ery no de y in S [ v 2 , f u ] \ S [ v 3 , f v 2 ], t ′ x [ v 2 , f u ]( y ) = β max z ∈ S [ v 3 ,f v 2 ] ( t x [ v 3 , f v 2 ]( z ) + 1 − D G ( z , y )) . 16 As b efore, t ′ x [ v 2 , f u ]( y ) ≤ 3 d + 2 b ecause otherwise (2 a ) holds for x . Thus t ′ x [ v 2 , f u ]( y ) = β max z ∈ S [ v 3 ,f v 2 ] ( t x [ v 3 , f v 2 ]( z ) + 1 − D G ( z , y )) = max z ∈ S [ v 3 ,f v 2 ] ( t x [ v 3 , f v 2 ]( z ) + 1 − D G ( z , y )) . F ollo win g this t ′ x [ v 2 , f u ]( y ) = max z ∈ S [ v 3 ,f v 2 ] ( D T ( F ( x ) , v 2 ) − D G ( x, z ) + 1 − D G ( z , y )) = D T ( F ( x ) , u ) − D G ( x, y ) . Th u s (2 b ) holds for x and (2) is true for | P | = k . It remains to p ro ve that (1) is true for | P | = k as well. It is suffi cien t to prov e that F do es not con tract an y x ∈ ( S u \ S v 2 ) with an y y ∈ ( S w \ S v k − 1 ). There are t wo case s , either (2 a ) holds for y or (2 a ) d o es n ot, and in that case, (2 b ) holds for y . In the latter case let t y [ v 1 , f u ] b e the type in L [ v 1 , f u ] such that for every z in S [ v 2 , f u ], t y [ v 1 , f u ]( z ) = D T ( F ( y ) , u ) − D G ( y , z ). Also, let u ′ ∈ ( N ( u ) \ v 1 ) b e the neigh b or of u suc h that x ∈ S [ u ′ , f u ]. As in the p ro of of (1) for k = 2, let t x [ u ′ , f u ] b e the t yp e in L [ u ′ , f u ] suc h that for ev ery z in S [ u ′ , f u ], t x [ u ′ , f u ]( z ) = D T ( F ( x ) , u ) − D G ( x, z ). Again as in the pro of of (1) for k = 2, t x [ u ′ , f u ]( z ) and t y [ v 1 , f u ] m u st agree which in turn im p lies that F do es not cont r act x and y T o conclude, we consider the case when (2 a ) h olds for y . Let v j b e a v ertex suc h that there is a y ′ ∈ S v j so that D T ( F ( y ) , v j ) − D G ( y , y ′ ) > 3 d + 2. By the indu ction hyp othesis, F do es not con tract x and y ′ . This giv es us the follo win g inequalit y for D T ( F ( x ) , F ( y )) and D G ( x, y ): d T ( F ( x ) , F ( y )) = D T ( F ( x ) , v j ) + D T ( v j , F ( y )) ≥ ( D T ( F ( x ) , F ( y ′ )) − D T ( v j , F ( y ′ ))) + D T ( v j , F ( y )) ≥ D G ( x, y ′ ) + D G ( y , y ′ ) + 3 d + 2 − D T ( v j , F ( y ′ )) ≥ D G ( x, y ) + 2 d + 1 ≥ D G ( x, y ) . This implies that the statemen t of the claim holds f or ev ery p ositiv e k . The claims tog ether pro ve the existence of a non-con tracting em b edding F of G into T with distortion at most d . Pro of of Theorem 1.3: Given a gr aph G , tr e e T with maximum de gr e e ∆ and an i nte ger d we c an de cide whether G c an b e emb e dde d into T with distortio n at most d in time n 2 · | V ( T ) | · 2 O ((5 d ) ∆ d +1 · d ) . Pr o of. Th e algorithm p ro ceeds as follo ws. First, c h ec k that ∆( G ) ≤ ∆ d (this f ollo ws from a lo cal densit y argumen t). No w, w e do b ottom up dyn amic p rogramming on th e tree T . F or eac h ve r tex u of the tree w e mak e a Bo olean table with an entry for eac h p ossible feasible u -state. F or ev ery leaf of the tree all the en tries are s et to tr ue. F or an inner no de u and a feasible u -state X u w e set X u ’s entry to true if for eac h c hild v of u there is a feasible v -state X v that su cceeds X u and so that X v ’s entry is set to true. Th e algorithm r eturns “ye s” if, at the termination of this pro cedur e, there is a feasible r ( T )-state X r ( T ) with its table en try set to tru e. T h e algorithm clearly terminates, and correctness of this alg orithm follo ws fr om Lemmas 4.10 and 4.9. W e n o w p ro ceed to the runnin g time analysis. I n our b ottom up sw eep of T , we consider ev ery edge and ev ery v ertex of T exactly once, which yields a factor of n t = | V ( T ) | . F or eac h v ertex u we consider eac h feasible u -state X u once, and for eac h suc h state and eve r y c hild v of u of the state we need to enumerate all feasible v -states that succeed X u . In fact, w e enumerate a 17 larger set of candidate feasible v -states and for eac h suc h state X v w e chec k whether X v succeeds X u . First w e sho w that the num b er of feasible u -partial em b edd ings is at most n · ∆ O ( d 2 · ∆ d +1 ) . This follo ws from the fact th at for an y vertex u of the tree | B ( u, d + 1) | ≤ ∆ d +1 and that the domain of a an y feasible u -partial em b edding f u is contai n ed in a ball of r ad iu s at most 2 d + 2 in G . Beca u se the degree of G is b ounded, a ball of r adius 2 d + 2 in G can conta in at most ∆ O ( d 2 ) v ertices. One can easily pro ve that if the feasible partial em b edding f u is giv en, the n u mb er of types and t yp elists that can app ear in a feasible u -state together with f u is b ound ed by (5 d ) ∆ d +1 and 2 O ((5 d ) ∆ d +1 ) resp ectiv ely . Thus, the num b er of feasible u -states is b oun d ed by 2 O ((5 d ) ∆ d +1 · d ) . If the d omain S v of a feasible partial em b edd in g f v for a c hild v of u is non-empt y then we can use the fact that S v m us t hav e a non-empt y intersecti on with th e domain of f u to b ound the n u m b er of p oten tial successors of a u -state by 2 O ((5 d ) ∆ d +1 · d ) · ∆ d ≤ 2 O ((5 d ) ∆ d +1 · d ) . S ince w e can c hec k whether a particular u -feasible state succeeds another in time n · 2 O ((5 d ) ∆ d +1 · d ) the o verall runn in g time of the alg orithm is b oun ded b y n 2 n t · 2 O ((5 d ) ∆ d +1 · d ) . 18
Original Paper
Loading high-quality paper...
Comments & Academic Discussion
Loading comments...
Leave a Comment