Approximation Algorithms for LowDistortion Embeddings into LowDimensional Spaces Badoiu et al. (SODA 2005) Presented by: Ethan Phelps-Goodman Atri Rudra 1 Moving from Seattle to NY Looks like a 2hr drive Looks like a 10hr plane ride Contraction is bad Expansion is bad “Faithful” representation 2 Metric Spaces Set of points Distance function Non-negative Triangle Inequality Metric Graph 1 2 3 5 6 5 weighted graph shortest path distance 3 Embeddings (Y,d2(¢,¢)) (X,d1(¢,¢)) Mapping : X! Y Exp()=maxa,b2 X d2((a),(b))/d1(a,b) Contr()=Exp(-1) Dist()=Exp() with Contr()¸ 1 4 Edge property Mapping from a unwt graph G=(V,E) Exp()=max(x,y)2 E d2(x’,y’) Exp()=maxx2 V,y2 V d2(x’,y’)/d1(x,y) ¸ is obvious x=v1,v2,,vL=y be the shortest path in G maxi d2(v’i,v’i+1)¸ 1/L¢ i d2(v’i,v’i+1) The sum ¸ d2(x’,y’) by triangle inequality 5 Embedding into a class of metrics Pick an embedding Non-contractive Minimum distortion Embedding into specific Metric [KRS04],[PS05] 6 Previous work Start with a problem in some metric space Embed inputs into another “nice” metric Combinatorial in nature Problem is easy to solve in the nice metric For e.g., embed graphs into trees Try to upper bound the distortion Survey by Indyk D 7 Algorithmic Task Find embedding with min possible distortion Don’t care about the value of distortion Recall the map example Embed unweighted graph into R (line) as well as possible 8 What is in store for you ? Embed unwt graph ! Line Hardness of the algorithmic Q Approx Algo for general unwt graph Approx Algo for unwt tree What else is there in the paper ? Open problems 9 Hardness of Approximation NP-Hard to a-approximate for some a>1 Reduction from TSP on (1,2)-metric All distances are in {1,2} NP-Hard to a-approximate for any a <5381/5380 (X,D) ) G=(X,E) D(u,v)=1 (u,v)2 E 10 Hardness of Approximation TSP on (1,2)-metric Input M:- (V,D(¢,¢)) Output:- Permutation of V which is a tour M G=(V,E) G x y D(x,y)=1 (x,y)2 E 11 The Construction G Given metric M G Make a copy of G called G’=(V’,E’) Add a special node o connected to V[ V’ The constrcuted graph H has diameter=2 12 Showing that it works M has a tour of len t) H embeds into R with distr · t Let the tour be v1,v2,,vn,v1 Start with v1 Lay out v2,,vn according to their distances Put in o Lay out G’ in the same way as G Non-contractive Expansion=t v1 0 v2 vi vi+1 D(vi,vi+1) vn v’1 o 1 v’n R 1 13 The other direction f embeds H into R w/ distr s ) 9 tour in M of len ·s+1 Let u1,,u2n be the ordering of V[ V’ by f Assume “nice” ordering |f(u2n)-f(u1)|· 2s (Wlog) blue box · (2s-2)/2=s-1 Blue box gives a tour of length · (s-1)+2=s+1 ¸1 R f(u2n) f(u1) 14 Getting a nice ordering Total ‘span’ still · 2s “Boundary” nodes are at distance ¸ 2 Swap blue and green boxes Total Span still · 2s Still non-contractive Keep on swapping till nice ordering is reached ¸2 R 15 What is in store for you ? Embed unwt graph ! Line Hardness of the algorithmic Q Approx Algo for general unwt graph Approx Algo for unwt tree What else is there in the paper ? Open problems 16 Embedding a tree into R Create an Eulerian tour Embed according to tour preserve order preserve distances No contraction Distortion · 2n-1 17 Embedding general graphs Every graph embeds into R w/ O(n) distortion Coming Soon: c-approx algo Use any spanning tree c is the value of the optimal distortion Combining both gives O(n1/2)-approx If c· n1/2, c-approx algo works If c> n1/2, spanning tree algo works 18 c-approx algorithm Embed G=(V,E) into R Let f* be the optimal embedding Let t1,t2 be the ‘end-points’ of f* t1=v1,v2,,vL=t2 shortest path V=V1[ V2 [ VL x closest to vi ) x2 Vi 19 c-approx algo (contd.) V1 V2 VL-1 Vi VL R |Vi| |Vi| Embed Vi (i=1, L) by the spanning tree algo 2|Vi| Layout vi first Recall that the max span is · 2|Vi| Leave a gap of |Vi| on each side Run for all possible values of t1 and t2 20 Notations f* is the optimal embedding c is the optimal distortion f is the computed embedding D(¢,¢) shortest path in G 21 Analysis V1 Vi V2 x y |Vi| 2|V i| | 4|V i |Vi| Clm1: D(vi,x)· c/2 Clm2: |Vi|+|Vi+1|++|Vi+c-1|· 2c2 f* has distortion c Clm3: Embedding is non-contracting Will now show |f(x)-f(y)|· 16c2 VL Vj R VL-1 |i-j|· 2c as D(vi,vj)· D(x,vi)+D(x,y)+D(y,v+j)· c/2+1+c/2 Span= 4¢[ (|Vi|++|Vi+c-1|) + (|Vi+c|++|Vj|) ] The constructed embedding has distortion O(c2) 22 Non-contractive embedding V1 Vi V2 x y y VL-1 VL Vj R |Vi| 2|Vi| |Vi| x,y2 Vi x2 Vi, y2 Vj |f(x)-f(y)|¸ |Vi| Should be |Vj|+1 (root goes first) + 2(|Vi+1|+ |Vj-1|) +|Vj| ¸ |Vi| + |j-i| ¸ D(x,vi) + D(vi,vj) ¸ D(x,y) + |Vj| + D(vj,y) 23 Proof of Clm1 vj vi Vj+1 x R f*(vj) f*(vi) f*(vj+1) 2¢ D(x,vi) · ? c D(x,vi) + D(x,vi) · D(x,vj)+D(x,vj+1) · ( f*(vj) – f*(x) ) + ( f*(x) – f*(vj+1) = f*(vj) – f*(vj+1) ·c 24 Embedding Trees into the line Problem: Given an unweighted tree that embeds into the line with distortion c, find the smallest distortion line embedding. They give (c logc)1/2-approximation, Can also be stated as O((n logn)1/3)approximation: If c > n2/3 then use simple spanning tree algorithm If c < n2/3 then use this algorithm 25 Tree Embeddings Similar to previous algorithm Select endpoints & compute shortest path 26 Tree Embeddings Similar to previous algorithm Select endpoints & compute shortest path Group every c vertices Embed each component, then concatenate 27 Local Density Define local density by Then c > . = maxv, r (|B(v, r)|-1)/2r. In max density ball, there are 2r vertices, so end points of embedding have distance at least 2r. But max distance is 2r, so endpoints have distortion at least . Also, any component with diameter d has at most d vertices. 28 Component Embedding Note: only care about order of vertices. Distances computed from shortest path Want to embed in roughly depth-first order But don’t want neighbors too far away Algorithm alternates between laying out neighbors of previously visited vertices (BFS) and DFS. 29 Component Embedding in action Ci 30 Component embedding algorithm Magic number g(c)= 2(clogc)1/2 + c Pick a leftmost vertex r Let Ci be vertices visited up to round i While there are unvisited vertices Visit all neighbors of Ci Visit next g(c) vertices in light-path DFS order 31 Bounding the distortion Outline: Bound number of iterations Bound span of neighbor step Bound total distortion in component Bound distortion from concatenation 32 Number of iterations Diameter of tree is at most 2c: So total # vertices is 2c At least g(c) added at each iteration Number of iterations is (2c)/g(c) (clog-1c)1/2 c c/2 c/2 33 Distortion of neighbor set or, where did g(c) come from? Claim: neighbor set is spanned by tree of size g(c). Idea: Vertices in neighbor set can’t be too far from “active” DFS vertices: at most (i+1) < (clog-1c)1/2 away. So spanned by tree of size (clog-1c)1/2 2c2 vertices in component, so 2logc can be active 2logc * (clog-1c)1/2 + c = g(c). 34 Distortion for full component Vertices added in neighbor step are spanned by tree of size g(c) g(c) connected vertices added in DFS step So distortion at most 2g(c) for each iteration 2 adjacent vertices could be on opposite ends of iteration i and i+1, so total distortion 4g(c) over all iterations 35 Concatenating the embeddings There is only one edge (vi, vi+1) connecting components Xi and Xi+1 Modify the DFS ordering of Xi so that vi is last visited Doesn’t affect distortion of Xi, and distortion of edge (vi, vi+1) is at most 2g(c) Total distortion is at most 4g(c) = 8(clogc)1/2 + 4c 8 c3/2log1/2c + 4c Or O((c logc)1/2) times optimal 36 Other algorithms in paper An exact algorithm for embedding a general graph into the line, with runtime O(nc). A geometric 3-approximation for embedding the sphere into the plane. 37 Open questions For lines: Better approximation ratios Lower bounds Weighted graphs (with large distortion) Bigger question: algorithmic embeddings of graphs into the plane. 38