How can I embed an N-points metric space to a hypercube with low distortion? - MathOverflow most recent 30 from http://mathoverflow.net 2013-05-19T14:10:36Z http://mathoverflow.net/feeds/question/11183 http://www.creativecommons.org/licenses/by-nc/2.5/rdf http://mathoverflow.net/questions/11183/how-can-i-embed-an-n-points-metric-space-to-a-hypercube-with-low-distortion How can I embed an N-points metric space to a hypercube with low distortion? pacificmoth 2010-01-08T20:41:00Z 2010-09-04T13:33:08Z <p>I have a N-point metric space defined by the pairwise distance matrix. I want to encode these N points with binary strings, i.e. each point will be mapped to a vertex in a hypercube. The lengths of the edges on the hypercube could be different for different dimensions. The hypercube basically is a hyper-rectangle. Now the questions are the following: 1. Given the dimension of the hyper-rectangle, what is the lower bound of the distortion to the original metric space? 2. How to achieve that, i.e., the lengths of the edges, the vertices for each point? 3. Is the optimal embedding P or NP?</p> <p>$A = (P,C), |P| = N, C\in [0,1]^{N\times N}$, find a mapping $f:P \rightarrow \times_{j=1}^D$ { $0,l_j$ }, $l_j > 0$.</p> <p>such that for any $\frac{1}{\mu} C_{ij} \le |f(P_i)-f(P_j)| \le \mu C_{ij}$,</p> <p>where $\mu \sim \Omega(g(D,N))$, is a polynomial function. Thanks a lot!</p> http://mathoverflow.net/questions/11183/how-can-i-embed-an-n-points-metric-space-to-a-hypercube-with-low-distortion/11193#11193 Answer by Suresh Venkat for How can I embed an N-points metric space to a hypercube with low distortion? Suresh Venkat 2010-01-08T21:47:09Z 2010-01-08T21:47:09Z <p>This is a well studied (and alas hard) problem. since you're allowing the hypercube to have arbitrary weights, it seems like you're really embedding into an $\ell_1$ space. in general, for such spaces, you can get a $\log n$ distortion using $\log^2 n$ dimensions, and this is tight (the shortest path metric for an expander graph is a lower bound). There's a ton of work on this topic in the area called 'metric embeddings'. a good place to start is the 2004 survey by Indyk and Matousek <a href="http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.7189" rel="nofollow">here</a>, and Tim Roughgarden has <a href="http://theory.stanford.edu/~tim/w06b/w06b.html" rel="nofollow">good class notes</a> (and references)</p> <p>The problem is NP-hard for $\ell_1$ in general. </p> http://mathoverflow.net/questions/11183/how-can-i-embed-an-n-points-metric-space-to-a-hypercube-with-low-distortion/21322#21322 Answer by Zsbán Ambrus for How can I embed an N-points metric space to a hypercube with low distortion? Zsbán Ambrus 2010-04-14T11:02:54Z 2010-04-14T11:02:54Z <p>Y. Bartal has studied a related problem of embedding metric spaces to <em>hierarchically separated trees</em>. With $1 &lt; \mu$ being a fixed real number, a $\mu$-HST is equivalent to the set of corners of a rectangle whose edges are of length $c, c\mu^{-1}, c\mu^{-2}, \dots, c\mu^{1-D}$ with the $l_\infty$-metric. That is, if you think of the space as the set of bit sequences of length $D$, the distance of two sequences is $c\mu^{-j}$ if they first differ in bit $j$. </p> <p>Now in your question you didn't ask for $\infty$-metric, but for this set of points, it doesn't really matter which metric you take because the distortion between this and either the $l_1$ or $l_2$ metric is bounded by a constant (if you fix $\mu$ but $D$ can vary). </p> <p>(This metric can be considered a graph metric on a special tree, that is, one where the points are some (but not necessarily all) vertexes of a tree graph with weighted edges, and the distance is the shortest path. This is where "tree" in the name comes from.) </p> <p>Now Bartal's result in [1] basically says that you can embed any metric space <em>randomly</em> to a $\mu$-HST with distortion at most $\mu(2\ln n+2)(1+\log_\mu n)$ where $n$ is the number of points. (Also, this embedding can be computed with a randomized polynomial algorithm.) </p> <p>For this, you need to know what a distortion $\alpha$ random embedding $f$ means. It means that for any two points $d(x,y) &lt; d(f(x),f(y))$ is always true and that the expected value of $d(f(x),f(y))$ is at most $\alpha d(x,y)$. For many applications, this is just as good as a deterministic embedding with low distortion. In fact, you can make a deterministic embedding with low distortion from it by imagining the metric $d^*$ on the original space where $d^*(x,y) = E(d(f(x), f(y))$, but this notion isn't too useful because the resulting metric does not have nice properties anymore (it's not HST). Indeed, I believe the randomness is essential here as I seem to remember reading somewhere that you can't embed a cycle graph (with equal edge weights) to a tree graph with low distortion.</p> <p>Anyway, this might not really answer your question. Firstly, $D$ (the number of dimensions of the rectangle) is not determined in advance, but that's not a real problem because if you have $D$ significantly different distances in the input metric then you need at least that large a $D$ for any embedding; and with this embedding you don't need a $D$ larger than $\log_\mu (\Delta/\delta)$ where $\Delta$ and $\delta$ are the largest and smallest distances in the input. The real problem is that you seem to want to know a deterministic embedding, and the highest possible distortion necessary in that case, which this really doesn't tell. For example, a cycle graph with an even number $n$ of vertexes can of course be embedded isometrically to a cube of dimension $n/2$.</p> <p>Survey [2] has some more references.</p> <p>[1]: Yair Bartal, On Approximating Arbitrary Metrics by Tree Metrics. <em>Annual ACM Symposium on Foundations of Computer Science</em>, 37 (1996), 184–193.</p> <p>[2]: Piotr Indyk, Jiří Matoušek, Low-distortion embeddings of finite metric spaces. Chapter 8 in <em>Handbook of Discrete and Computational Geometry</em>, ed. Jacob E. Goodman and Joseph O'Rourke, CRC Press, 2004.</p> http://mathoverflow.net/questions/11183/how-can-i-embed-an-n-points-metric-space-to-a-hypercube-with-low-distortion/37715#37715 Answer by sleepless in beantown for How can I embed an N-points metric space to a hypercube with low distortion? sleepless in beantown 2010-09-04T12:06:26Z 2010-09-04T13:33:08Z <p>Perhaps I'm not following what you're asking perfectly, but if you have $N$ points, and a distance matrix which is $N \times N$ in size, you could use an $N$-dimensional hypercube.</p> <p>This hypercube would have the $N$ points at the $N$ vertices defined by the vectors $P_1=(1,0,...,0)$, $P_2=(0,1,0,...,0)$, ..., $P_N=(0,0,...,0,1)$. Thus the $N$ points all exist at Hamming distance $=1$ from the origin (0,0,...,0). In this embedding, all of the $N$ points are at the vertices of the $N$-dimenional <strong>unit hypercube</strong>. In the unit hypercube embedding, the Hamming distance is between each pair of points is $2$, and the Minkowski distance between each pair of points if $\sqrt(2)$</p> <p>The pair-wise distances which you already have as a given are used to define the length of the distance between two vertices and thus give the separation between each pair of points. Of course, if the distances are not in a Euclidean space, you can't use a Minkowski metric to define the distances. </p> <p>If you want to have this be a euclidean space, then you can use different techniques to get the appropriate desired pair-wise Euclidean distance, </p> <p>$$d_{a,b}={(\sum_{i=1}^{i=N}} (a_i-b_i)^2) ^{0.5}$$ </p> <p>or you can use whatever other metric may be appropriate in your case.</p> <p>For the euclidean distance, you can set each point to be at a distance $d_n, 1 \le n \le N$, then calculate the pairwise distances for all of the data points and try to move the points around in order to get closer to approximating your original distance metric.</p> <p>Thus now you would have each point $P_n, 1\le n \le N$ at $(v_1,v_2,...,v_N)$ where $v_i=0$ for $i \ne n$, and $v_i=d_i$ for $i=n$. This embedding now places each of the points at a vertex of a <strong>hyper-rectangle</strong> in $N$-dimensional space, rather than in the unit hypercube.</p> <p>You could use an annealing method or a genetic algorithm with multiple candidates to mutate and cross over, or try to move one point at a time to optimize that point's pair-wise distance to all of the other points.</p> <p>What is the order of magnitude of your data set's $N$? </p>