Choosing points from a set that produce the largest polygon

In summary: Hi Scott! Thanks for these ideas. I really like the last one, though unfortunately the centers do not necessarily form a convex polygon. However, on reconsidering the problem I am dealing with, I would not be interested in points that contributed to a non-convex shape, so I think all I might need is to choose an existing convex hull algorithm.Hi Scott! Thanks for these ideas. I really like the last one, though unfortunately the centers do not necessarily form a convex polygon. However, on reconsidering the problem I am dealing with, I would not be interested in points that contributed to a non-convex shape, so I think all I might need is to
  • #1
Jeff.Nevington
12
1
I am trying to find the most efficient way to select points on a 2d plane from a set that maximizes the area of the of the shape they define when joined together.

The points are all paired (sharing the same A->B vector), with these pairs also appearing mirrored about the origin. Here is an example:

https://i.imgur.com/MNARxPI.png

Sometimes a single point is used from the pair, and sometimes both.

For any given problem I can easily draw the solution by hand, but I am struggling to clearly define a sensible solution. I can loop through and for each point, check adjacent points, using the solution for which no other point in the subset is further from the origin than the joining line, but it seems messy. I feel like there should be a more elegant solution.

Does anyone have any ideas?
 
Physics news on Phys.org
  • #2
It's not so much finding a way to do it - but finding a relatively efficient way.
I would start by computing the average X,Y of all points, and then identifying the ones that are furthest from that center in each of 8 directions. I pick 8 directions because it is easy to sort them that way based on X>0, Y>0, and |X|>|Y|.
Then I would form large triangles with that initial group of points and eliminate any other point that fell within the triangle. Determining whether a point is inside a triangle (or any polygon) can be done by determining which side of each line of the triangle the point is on, if it is on the inside side of each line, it is inside the triangle and can be eliminated.

Ultimately, this test can be applied to all triangles and all points - all groups of 4 of the remaining points.

From there, it is just a matter of finding optimizations.
 
  • #3
Actually, any point that is furthest in any direction must be part of the border.
So start by finding the points with max and min X, max and min Y, max and min (X+Y)/2, and max and min (X-Y)/2.
Then eliminate all point that are within the resulting polygon.
Finally, do the "ultimate test" that I described above - except you do not have to test those original point, since they are definitely to be included.
 
  • #4
It's unclear whether there are additional constraints to your data.
Specifically:
When you draw a vector from one point in a pair to the other, is that vector of the same size and direction as all other vectors in the set?
If you take the midpoint of each pair, are they always the vertices of a convex polygon? With the points following clockwise or counter clockwise along that polygon?

If the answer to all three is yes, then rotate your figure so that the pair direction is along the X direction. Then, as you follow the pairs clockwise:
* for each segment that is decending (-Y direction), use the high X member of the pair;
* for each segment that is ascending (+Y direction), use the low X member of the pair.
Two pairs will have end up using both points. Those will be the ones where the trailing segment heads in a different Y direction than the leading segment.
 
  • #5
Hi Scott! Thanks for these ideas. I really like the last one, though unfortunately the centers do not necessarily form a convex polygon. However, on reconsidering the problem I am dealing with, I would not be interested in points that contributed to a non-convex shape, so I think all I might need is to choose an existing convex hull algorithm.
 
  • #6
Jeff.Nevington said:
Hi Scott! Thanks for these ideas. I really like the last one, though unfortunately the centers do not necessarily form a convex polygon. However, on reconsidering the problem I am dealing with, I would not be interested in points that contributed to a non-convex shape, so I think all I might need is to choose an existing convex hull algorithm.
If you have a concave polygon, or one that may be concave, just follow it around taking the cross product of each adjacent pair of sides. Depending on the direction of travel (clockwise or CCW), you will be looking for only positive or negative cross products. If you find one that doesn't belong, the point between them should be dropped.
 

1. How do you determine which points will produce the largest polygon?

The best way to determine the points that will produce the largest polygon is to first plot all the points on a graph and then draw lines connecting them. Next, calculate the area of each polygon and compare them to find the largest one.

2. Is there a specific algorithm or method for choosing points that produce the largest polygon?

Yes, there are several algorithms and methods that can be used to choose points that produce the largest polygon. Some popular ones include the Convex Hull algorithm, the Graham Scan algorithm, and the Quickhull algorithm. Each of these has its own advantages and disadvantages, so it is important to consider the specific needs of the problem at hand when choosing the method.

3. What factors should be considered when choosing points for a large polygon?

When choosing points for a large polygon, some important factors to consider include the shape and distribution of the points, the desired size and proportions of the polygon, and any constraints or limitations that may affect the placement of the points. It is also important to consider the computational complexity of the chosen algorithm, as this can impact the efficiency of the solution.

4. Can points be added or removed to improve the size of the polygon?

In some cases, adding or removing points can improve the size of the polygon. This is often dependent on the specific problem and the algorithm being used. For example, the Graham Scan algorithm allows for the addition and removal of points to adjust the shape and size of the resulting polygon.

5. Are there any limitations or challenges when choosing points for a large polygon?

One major limitation when choosing points for a large polygon is the computational complexity of the problem. As the number of points increases, the time and resources required to calculate the largest polygon also increase. Additionally, the shape and distribution of the points can greatly affect the size and proportions of the resulting polygon, making it challenging to find an optimal solution.

Similar threads

  • General Math
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
4
Views
2K
  • Linear and Abstract Algebra
Replies
9
Views
1K
Replies
4
Views
620
  • Differential Geometry
Replies
3
Views
2K
  • Special and General Relativity
3
Replies
82
Views
5K
  • Topology and Analysis
Replies
6
Views
1K
  • Precalculus Mathematics Homework Help
Replies
20
Views
2K
  • Introductory Physics Homework Help
Replies
5
Views
2K
  • Introductory Physics Homework Help
Replies
3
Views
1K
Back
Top