Determining the positions of $N$ one dimensional points

37 Views Asked by At

The statement of the problem :

Given $n$ points and $\binom{n}{2}$ pairings denoting the distances between any such pair of points, find a valid way of plotting each of these points on the $x$-axis such that the given constraints hold, assuming the constraints are valid.

For simplicity, you can choose to fix any of these points in say $x = 0$ and then proceed with plotting the other points based on the given constraints. I've seen a similar $2d$ problem here on MSE, but it seems to be overly complicated for this version of the problem.

Does anyone know of an algorithm or procedure to efficiently solve this?

1

There are 1 best solutions below

0
On

I have hunch the following may work. Pick an arbitrary point $A$ to be the origin, and its shortest neighbor $B$ (say $b$ away) to be $(b,0)$. Sort the rest in increasing distance from $A$.

Now for each consecutive neighbor of $A$ of increasing distance, draw circles of correct radii from all the previously picked points. Their intersection will be the location of the next point. If there are multiple intersection points of all circles, pick any one. (I think this latter condition is likely to occur only when picking the next point $C$, but after $\Delta ABC$ is fixed, it should not happen, but I cannot prove it now.)