Are euclidean and rectilinear metrics equivalent for determining the ordering of closeness between points?

215 Views Asked by At

I'm writing software that necessitates calculating hundreds of thousands of distances between points (in this case, in 67-space).

The distance between two points $p$ and $q$ using euclidean metrics is:

$$D_{p, q} = \sqrt{(p_1 - q_1)^2 + (p_2 - q_2)^2 + \dots + (p_n - q_n)^2}$$

However, using rectilinear metrics:

$$D_{p, q} = |p_1 - q_1| + |p_2 - q_2| + \dots + |p_n - q_n|$$

I found that using euclidean metrics I need $3n$ arithmetic operations whereas with rectilinear I only need $2n-1$: using rectilinear metrics I use $n+1$ less operations, or it's roughly 34% less operations which means speedier software.

Can rectilinear metrics be used in an equivalent fashion to euclidean for my purposes? I care about the closeness of points and their ordering; if I have three arbitrary points $p$, $q$, and $r$, if $p$ is closer to $q$ than $r$ using euclidean metrics, is it also true for rectilinear metrics irrespective of point values?

More declarative:

$$\begin{align} \text{if } D_{eucl.\text{ }p, q} &< D_{eucl.\text{ }p, r}\\ \text{then } D_{rect.\text{ }p, q} &< D_{rect.\text{ }p, r} \end{align}$$

For all integer values $p_1 \dots p_n$, $q_1 \dots q_n$, $r_1 \dots r_n$?

1

There are 1 best solutions below

3
On BEST ANSWER

No. Let $p$ be the origin (both metrics are translation-invariant, so we can always shift so that this is the case). Take $q = (1.1,0,\ldots,0)$. Then $D_{eucl}(p,q) = D_{rect}(p,q) = 1.1 $. Take $r = \frac{\sqrt{2}}{2}(1,1,0,\ldots,0)$. Then $D_{eucl}(p,r) = 1 < D_{eucl}(p,q)$. But $D_{rect}(p,r) = \sqrt{2} > D_{rect}(p,q)$.