How to effectively det in N-dim space that a point from a set is a convex hull vertex of that set, without calculating the entire hull?

51 Views Asked by At

I need to find a universal algorithm that could check (for an N-dim space) whether a point from a point cloud is a convex hull vertex of that cloud without spending computational resources on finding the entire hull.

Honestly, I've been struggling with this problem for a week now. I've consulted neural networks and searched on Google, but I couldn't find the right and suitable solution.

I've developed what I believe is a pretty good algorithm for 2D:

import numpy as np

def DetIsConvexHullPoint2D(point_cloud_, traget_point_index_):

    # code simplified and checks skipped

    other_point_index = 0 

    if (other_point_index == traget_point_index_):
    
       other_point_index = 1
    
    target_point    = point_cloud[traget_point_index_]        
    other_point     = point_cloud[other_point_index]

    v_other = other_point - target_point

    v_left  = v_other    
    v_right = v_other

    for point in point_cloud_:

        v_point = point - target_point

        if np.cross(v_other, v_point) < 0:
    
            v_right = v_point if np.cross(v_right, v_point) < 0 else v_right
    
        else:
    
            v_left = v_point if 0 < np.cross(v_left, v_point) else v_left
    
    is_convex_hull_point = np.cross(v_left, v_right) <= 0

    return is_convex_hull_point

I successfully extrapolated it to 3D, but when I moved to dimensions higher than that, I realized that for dimensions where 3 < N, the cross product operation is not defined, and I understood that I've hit a dead end.

Please help me find a suitable algorithm.

P.S.

I need this algorithm for resampling (reducing the density) data point clouds when developing classifiers. The clouds corresponding to the classes of my data are good, dense, and do not have explicit intersections, i.e., they are well separated from each other. For this reason, it is sufficient for me to take only the points belonging to concave hull of the cloud. Since the task of finding a parameterized concave hull in high-dimensional spaces does not have ready-made out-of-the-box solutions, I found an alternative option:

For each point in cloud I take a small area around it, find all the points belonging to this small area, and then check that this central point is a convex hull vertex of the small point cloud from this area. As a result, I get exactly what I need.

However, unfortunately, at the moment, I have to calculate a separate full convex hull for each point and then check for membership in it. Despite successfully parallelizing the entire process, due to the high density of clouds, the entire resampling process takes a huge amount of time.