r/ProgrammingProblems • • Jan 08 '11

Smallest Area in n-sided Polygon

Given n different "sticks" with n respective lengths, what is the area of the smallest polygon that can be formed using the sticks? (Assuming it is possible.)

4 Upvotes

4 comments sorted by

View all comments

Show parent comment

1

u/WeAreButFew Jan 11 '11

What if you're not constrained to a convex polygon? (The assumption was yours not mine.)

Next, it seems to me that regardless of the number of segments (the "sticks" in your description), the solution will end up being a triangle

What about four equal length sticks? Impossible to form into a triangle. In fact, this problem seems kinda of degenerate because you can get arbitrarily close to a line of length 2(stick lengths). Maybe I should have asked for max area.

2

u/nickbenn Jan 11 '11 edited Jan 11 '11

If you're not constrained to convex, then you have all sorts of degeneracy options, where you fold two segments together, and they simply become one segment, with length equal to the difference of the two.

As to the four equal sides case, with the convexity assumption:

One of the techniques I was thinking of for the partitioning into three subsets is first to partition the set into two subsets, of as close to equal total length as possible, with the constraint that the subset with the larger sum must consist of at least two segments, since that one will have to form the two sides of a triangle (the subset with the smaller sum becomes a single side of a triangle). If the two subsets have equal sums, then you win the game: a zero-area degenerate triangle. That's what happens with four sides of equal length.

Even if you don't do the partitioning into two subsets first, it's easy to show that you get the same result from the first formulation I posted. Set A will contain one of the sides, set B another, and set C the remaining two (of course, it doesn't matter which of the three sets contains two sides). If (for example) each of the four sides has length 1, then a = 1, b = 1, c = 2, and s = (1 + 1 + 2) / 2 = 2. Then Heron's formula gives 2(0)(1)(1) = 0 for the squared area of the resulting triangle.

Edit: Last paragraph added.

Edit: Note that the zero-area degenerate triangles described above are still convex, by the strict definition of a convex set.