Vertex enumeration of a random point set in 3-dimensions
A convex polytope P can be specified in two ways:
- as the convex hull of the vertex set V of P, or
- as the intersection of the set H of its facetinducing halfspaces
The vertex enumeration problem is to compute V from H. The facet enumeration problem it to compute H from V. These two problems are essentially equivalent under point-hyperplane duality and they are among the central computational problems in the theory of polytopes. The convex hull algorithm of this package is essentially a facet enumeration algorithm , which means that it gives the faces (facetinducing halfspaces, H) that constitute the convex hull of a given set of vertices (V). However, the reverse (i.e. vertex enumeration) is also possible using this algorithm, by making use of the point/hyperplane duality. The set of all points in whose coordinates satisfy a linear equation
is called a hyperplane. Substituting homogeneous coordinates and multiplying out, we get a homogeneous linear equation that represents a hyperplane in :
Notice the symmetry of the last equation between the hyperplane coefficients () and the point coefficients (). For fixed and variable , this equation can also be viewed as the equation characterizing the hyperplanes passing through a given point . In fact, the hyperplane coefficients are also only defined up to an overall scale factor, so the space of all hyperplanes can be considered to be another projective space called the dual of the original space . By the symmetry of the last equation, the dual of the dual is the original space. An extremely important duality principle follows from this symmetry:
Duality Principle : For any projective result established using points and hyperplanes, a symmetrical result holds in which the roles of hyperplanes and points are interchanged: points become planes, the points in a plane become the planes through a point, etc.
In this example the vertex enumeration problem is solved, i.e. the polytope defined by the system of inequalities A*x <= b is converted into a list of vertices V.
Set the random number generator.
Set the dimension of the problem.
Set the system of inequalities A*x + b <= 0 to be converted into vertices.
A=rand(100,d)*2-1; n=sqrt(sum(A.^2,2)); A=A./repmat(n,[1 size(A,2)]); b=-ones(100,1);
Convert the planes to equivalent points by applying the duality principle.
Find the coefficients of the planes of the facets of the convex hull of the set of equivalent points.
Convert the planes of the convex hull into equivalent points by applying the duality principle.
Check if the relation A*x + b <= 0 applies for all the vertices found.
if any(A*points2'+b(:,ones(1,size(points2,1)))>0) error('At least one vertex is not on the convex hull.') end
Each vertex found should satisfy three plane equations (since each vertex is the intersection of three planes).
if any(sum(A*points2'+b(:,ones(1,size(points2,1)))>-100*eps)>d) warning('The convex hull is degenerate.') elseif any(sum(A*points2'+b(:,ones(1,size(points2,1)))>-100*eps)<d) error('At least one vertex does not belong to the convex hull.'); end
(c) 2014 by George Papazafeiropoulos First Lieutenant, Infrastructure Engineer, Hellenic Air Force Civil Engineer, M.Sc., Ph.D. candidate, NTUA