6

Consider an undirected weighted graph $G = (V,E)$, where $V \subset \mathbb{R}^3$ so the points are 3D, and the weight of an edge equals the (Euclidean) distance between its endpoints. Note that we're not given the coordinates of the points in V. We may not even be given all pairwise distances, so the graph need not be complete, and it may even be sparse.

Suppose we're given $k$ and told that there are $k$ planes such that all the vertices belong to at least one of those plane. We want to find $k$ such planes, with an added restriction:

In order to determine whether 4 points are coplanar given only their pairwise distances, the most straightforward method is to use the Cayley-Menger determinant. For our problem, this would require the graph to be fairly dense, since we'd need to know most of the pairwise distances to apply Cayley-Menger. The restriction is to find $k$ planes without using the Cayley-Menger determinant.

If this is impossible, can we obtain a proof that states this is impossible? In other words, can we prove that for any such graph $G$ and given $k$, if we have enough information to find $k$ planes for $G$ by some means, then we have enough information to use Cayley-Menger to find $k$ planes?

padawan
  • 1,455
  • 1
  • 12
  • 30

4 Answers4

3

I think that if the input graph is 3-connected, and you assume some arbitrary origin and orientation, you can recreate the original points. Especially if you can find K_4 to seed the triangulation process.

Once we have the points, greedy strategies become available. They might not be optimal, but maybe they're enough for your purposes.

I've asked about recovering the embedding as a separate question.

Random Greedy

Until we have fewer than three not-disqualified points, arbitrarily pick three of them, yield the plane going through them, and mark all points on the plane as disqualified.

Take the remaining not-disqualified points (if any), pair them with some arbitrary disqualified points, and yield the plane going through them.

The planes we yielded covered all of the points. The number of planes we yielded is at most $\frac{n}{3}$, and each requires scanning through the remaining points, so this algorithm takes $O(n^2)$ time (faster than computing a determinant).

If the number of planes $k \ll n$, then we have reasonably good odds of hitting one of the large planes. I'm not sure what the expected running time is, but I would wild-guess it at $O(n \, k^3 \log k)$. (That's based on the coupon collector problem implying we need $\approx k \log k$ hits to collect $k$ planes, and that the odds of a hit are $\approx (1/k)^2$ so the expected time between hits is $\approx k^2$).

Prioritized Greedy

Another thing we can do, if we can solve for the points, is iterate over all triplets and count how many points are on that plane. Then we repeatedly yield the plane covering the most points, until no points are left.

If we don't account for disqualified points when choosing the next plane, then this takes $O(n^3 \log t)$ time where $t$ is the number of planes we return. If we do re-prioritize, then I think it can still be done in $O(n^3 \log t)$ (the number of disqualified points on other planes can only change by 2 so it might be possible to rebalance in some clever way).

This approach should do better, but again I don't think it's guaranteed to have $t=k$. We can probably arrange the points so that taking the plane covering most of them sends us down the wrong path.

Craig Gidney
  • 5,992
  • 1
  • 26
  • 51
3

RANSAC would be one candidate method to find planes that cover a large fraction of the points.

Suppose that a large fraction of the points go through some plane $P$, say, $n/10$ of them. Here's how we can find it:

So let's pick 4 points at random from the $n$; call those points $q,r,s,t$. Suppose we know the distances between all such pairs (they form a 4-clique, $K_4$). Then we can use the Cayley-Menger determinant to see if they are co-planar. Suppose they are co-planar. Then we might try testing each other point $x$ and seeing whether we can tell whether it is co-planar with the plane formed by $q,r,s,t$. We might only be able to test this when the additional point $u$ forms a 4-clique together with some other points known to be on the plane. At the end, if we've found a significant number of points that are on the plane formed by $q,r,s,t$, we keep this plane. Keep doing this for, say, 1000 random choices of $q,r,s,t$.

How well will this work? Well, suppose we model the graph as a random graph where each possible edge appears with probability $p$ (so we expect $pn(n-1)/2$ edges on average). Then the probability that a randomly chosen set of 4 points form a 4-clique in the graph is $p^6$. Therefore, if we sample at least $10^4/p^6$ choices of $q,r,s,t$, we expect to find at least one where they reveal the plane $P$. Also, the probability that an additional point $u$ forms a 4-clique with at least three of $p,q,r$ is $p^3$, so when we do find four points $q,r,s,t$ on the plane $P$, we expect to find at least $p^3 n/10$ of the points on the plane $P$. (Actually, we'll probably find a lot more than that. Once we have those $p^3 n/10$ points, now the probability that an additional point $v$ forms a 4-clique with at least three of them is $1-(1-p^3)^{p^3 n/10} \approx 1-\exp\{-p^6 n/10\}$, which is significantly larger than $p^3$.) In other words, once we find points $q,r,s,t$ on the plane $P$, it is likely that we will keep this plane.

So as long as you sample enough 4-combinations of points, and as long as your graph is dense enough, this procedure is likely to detect all planes that cover a large fraction of points.

D.W.
  • 167,959
  • 22
  • 232
  • 500
3

Unfortunately, the answer is that this is an NP-Complete problem. Using only 4 planes of points, you can encode satisfiability problems into whether or not there is a point set that generates a sparse set of distances.

That means you can create problems where determining if a fifth plane is necessary or not requires solving 3-SAT problems. You can combine two such problems, where exactly one requires the fifth plane, to keep the number of planes constant and force the algorithm to solve 3-SAT problems even if it knows $k$ ahead of time.

So the problem has no worst case polynomial time solution, unless P = NP.

Craig Gidney
  • 5,992
  • 1
  • 26
  • 51
-1

am attempting an answer even though the question may be somewhat unclearly stated. half of it says the points are given, the other half says that pairwise distances are given. am going to assume that point coordinates are given for this answer. there is a close connection between computing determinant and matrix rank. there is a generalization as follows. create the matrix of 3d vectors, they can be either column or row vectors. compute the rank. if it is 2, the points are coplanar. the pairwise distances can be computed from the coordinates and is not necessary to calculate/ determine matrix rank.

vzn
  • 11,162
  • 1
  • 28
  • 52