Questions tagged [euclidean-distance]

57 questions
11
votes
4 answers

Recovering a point embedding from a graph with edges weighted by point distance

Suppose I give you an undirected graph with weighted edges, and tell you that each node corresponds to a point in 3d space. Whenever there's an edge between two nodes, the weight of the edge is the distance between the points. Your goal is to…
6
votes
1 answer

How to detect intersecting segments based on length of the segments

As part of a larger problem, I am trying to detect based on the distance matrix which segments intersect in the original 2D space that originated the matrix. I don´t have coordinates (lat/long, x/y or any other for the points). As an example, on the…
Picarus
  • 163
  • 4
4
votes
1 answer

Algorithm for shortest continuous line to join N points

I have a set of points in a 2D plane. I'm searching for an algorithm that: Draws a continuous line passing through all the points starting from a random point. Optimizes for the minimum total line length in Euclidean distance. The line should end…
4
votes
2 answers

Given a vector of points, what is the fastest algorithm to find all pairs of points at a distance of 1?

Given a vector of points (on the 2D plane), what is the fastest algorithm to find all pairs of points at a distance of 1? Of course, I could use the $O(N^2)$ algorithm to check all pairs of points. However, I recently found out that there are at…
4
votes
0 answers

Finding the smallest distance between a point and a set of points

I have a GPS dataset that corresponds to a route taken by a vehicle in a day. It consist of a set of coordinates. Then say I have a coordinate and I want to know how close this coordinate is to this route. So basically I am calculating the distance…
4
votes
0 answers

Distance from high dimensional convex hull to target point T

I have a set S of high dimensional points in Euclidean space, with convex hull H (not known); and some target point T in that space not in or on H. Rather than worry about calculating both H and the distance to it explicitly, is there an efficient…
3
votes
1 answer

Algorithm to mimimally pair up points in 3D space

Given a set of $n$ points $P$ and a set of $n$ points $Q$ in 3 dimensional space, what's the fastest algorithm to uniquely pair points in $P$ with points in $Q$ so that the sum of the square of the distance between points in $P$ and their…
3
votes
0 answers

Is it possible to simulate/emulate non-euclidean geometry using computer graphics?

I am aware of the frequent use of "smoke and mirrors" in order to achieve the effect of non-euclidean geometry, but I was wondering it if it possible to implement spherical (sometimes called elliptic) and hyperbolic geometries. If so, how would we…
3
votes
1 answer

Should planar Euclidean graphs be planar straight-line graphs?

An Euclidean graph, by definition is A weighted graph in which the weights are equal to the Euclidean lengths of the edges in a specified embedding and a graph is called planar if it can be drawn in a plane without graph edges…
padawan
  • 1,455
  • 1
  • 12
  • 30
3
votes
2 answers

How to prevent overflow and underflow in the Euclidean distance and Mahalanobis distance

I was working in my project when I was struck by the question of whether it would be necessary, or at least cautious, prevent overflow and underflow in the calculation of these two distances. I remembered that there is an implementation of the…
3
votes
1 answer

Efficient algorithm to fulfil a set of coordinate constraints

I have a set of labelled points and a set of distance constraints between pairs of points, consisting of a lower and upper distance bound. There is definitely an arrangement of the points in 3D space that fulfils all distance constraints. I wish to…
jgreener
  • 133
  • 4
3
votes
0 answers

How fast is closest pair?

I'm reading a recent paper "Finding Correlations in Subquadratic Time, with Applications to Learning Parities and the Closest Pair Problem" by Gregory Valiant on finding approximate closest pairs in $R^d$. Valiant says the current upper bound for…
3
votes
1 answer

A heuristic for finding the vector that is maximally distant from a set of vectors

I have two sets of vectors: A and B. I want to find the vector Bi in set B that is maximally distant from the vectors in set A, either by average distance or closest distance. I know that I can accomplish this by comparing every vector Ai in A with…
magnetlion
  • 113
  • 1
  • 6
3
votes
0 answers

Stable and fast computation of the squared euclidean distance matrix

Let's say I want to compute the matrix $M$ of the squared euclidean distances between each pair of vectors $(x, y)$ belonging to two sets $X$ and $Y$ respectively. The sets of vectors $X$ and $Y$ have size $m$ and $n$. Each vector has $k$ floating…
3
votes
0 answers

Sub-optimal and fast solutions to assignment problem

I am looking for a fast solution to the assignment problem for large cost matrices (5000x5000 or larger). The Hungarian algorithm is $O^3$, which is impractical for any moderately large problem. Are there similar algorithms but sub-optimal and…
1
2 3 4