I thought of an approach to solving this problem:
From the set of all points, all possible 3-point subsets are generated. This is the set of all triangles in your space. From this set, remove all triangles that contain another point, and you will get a set of all empty triangles.
For each of the empty triangles, you will increase it to its maximum size. That is, for each point outside the rectangle, you must insert it between the two nearest points of the polygon and check if there are points in this new triangle. If not, you will remember this point and the area that it adds. For each new item you want to add one that maximizes the added area. When can no longer be added, the maximum convex polygon was built. Write down the area for each polygon and remember the one that has the largest area.
Important for the performance of this algorithm is your ability to determine a) whether the point is in the triangle and b) whether the polygon remains convex after adding a certain point.
I think you can reduce b) to be problem a), and you just need to find the most effective method to determine if the point is in the triangle. Reducing the search space can be achieved as follows: Take a triangle and increase all edges to an infinite length in both directions. This separates the area outside the triangle to 6 subregions. The good thing for us is that only 3 of these subregions may contain points that will adhere to the bulge constraint. Thus, for each point you check, you need to determine whether it is in an expanding convex subregion, which again is related to the question of whether it is in a certain triangle.
An entire polygon that develops and approaches the shape of a circle will have smaller and smaller regions that still allow convex expansion. One point in the concave area will not again become part of the expanding expansion area, so you can quickly reduce the number of points that you will have to consider when expanding. In addition, while testing extension points, you can further shorten the list of possible points. If the point is checked falsely, then it is located in the concave subregion of another point, and therefore, all other points of the concave subregion of the tested points should not be considered, since they are also in the concave subregion of the internal point. You can quickly shorten the list of possible points.
However, you need to do this for every empty triangle, of course.
Unfortunately, I cannot guarantee that by always adding the maximum new area, your polygon will become the maximum polygon.
Andreas Sep 22 2018-11-22T00: 00Z
source share