2

So I have a set of points V, which are the vertices of a convex polytope, and a separate point p. Basically, I want to check whether p is contained in V. To do so, I set up a linear program that checks whether there exists a hyperplane such that all points in V lie on one side, while p lies on the other, like so (using YALMIP):

z=sdpvar(size(p,1),1);
sdpvar z0;

LMI=[z'*vert-z0<=0,z'*probs-z0<=1];

solvesdp(LMI,-z'*probs+z0);

The hyperplane is defined by the set of points z such that z'*x - z0 = 0, such that if I get a value larger than zero for the point p, and one smaller than zero for all vertices, then I know they are separated by the plane (the second constraint is just so the problem is bounded). This works fine. However, now I want to check whether there is a hyperplane separating the two point sets such that it contains the origin. For this, I simply set z0 = 0, i.e. drop it entirely, getting:

z=sdpvar(size(p,1),1);

LMI=[z'*vert<=0,z'*probs<=1];

solvesdp(LMI,-z'*probs);

Now, however, even for cases in which I know there is a solution, it doesn't find it, and I'm at a loss for understanding why. As a test, I've used the vertices

v1=[0;0;0];v2=[1;0;0];v3=[0;1;0];v4=[1;1;1];

and the point

p=[0.4;0.6;0.6];

When plotted, that looks like the picture here.

So it's clear that there should be a plane separating the lone point and the polytope that contains the origin (the front and center point of the polytope).

One thing I've tried already is to offset the vertex of the polytope that's now on the origin from the origin a little (10^-5), such that the plane would not touch the polytope (although the LP should allow for that), but that didn't work either.

I'm grateful for any ideas!

Jochen
  • 21
  • 2
  • I'm assuming this is a 3D polytope? And, does your polytope definitely contain the origin? – anon01 Jul 31 '15 at 14:56
  • I'd like a solution for the general case; I'm using 3D merely for the convenience of representability. And yes, the polytope will always contain the origin, although I suppose I can do without, since the planes going to the origin that envelop the rest of the points will also envelop the original polytope. But even for cases when the origin is excluded, the program does not produce a solution (I tried simply separating two points, and it didn't work). – Jochen Aug 03 '15 at 06:46
  • You say you drop z0, but it is still in the second constraint. Hence, the second model is still unbounded. – Johan Löfberg Aug 10 '15 at 11:45
  • Sorry, my mistake, I merely forgot to take it out; of course, z0 should not be there (the solver would produce an error, since I haven't declared z0 as an SDP variable). Anyway, I've found by now that the program works if I merely check for feasibility, i.e. don't optimize anything. Still no idea why the optimization process should fail, though. – Jochen Aug 11 '15 at 12:30

0 Answers0