Minimum-area bounding quadrilateral algorithm - MathOverflow most recent 30 from http://mathoverflow.net2013-05-24T18:23:37Zhttp://mathoverflow.net/feeds/question/11580http://www.creativecommons.org/licenses/by-nc/2.5/rdfhttp://mathoverflow.net/questions/11580/minimum-area-bounding-quadrilateral-algorithmMinimum-area bounding quadrilateral algorithmCarsten2010-01-12T20:19:56Z2010-01-12T21:28:21Z
<p>There are a few algorithms around for finding the minimal bounding rectangle (OBB) containing a given (convex) polygon.</p>
<p>Does anybody know about an algorithm for finding a minimal-area bounding quadrilateral (any quadrilateral, not just rectangles)?</p>
<p>I've been refered to this site from stackoverflow.com (<a href="http://stackoverflow.com/questions/2048024/minimum-area-quadrilateral-algorithm" rel="nofollow">original post</a>), since the guys over there did not know the answer to this...</p>
<p>(PS: I'm a programmer and not a mathematician, so I would appreciate especially if you could point me to exisiting implementations if there are any... Thanks a lot!)</p>
http://mathoverflow.net/questions/11580/minimum-area-bounding-quadrilateral-algorithm/11584#11584Answer by David Eppstein for Minimum-area bounding quadrilateral algorithmDavid Eppstein2010-01-12T21:09:32Z2010-01-12T21:09:32Z<p>I think what you want is "Geometric applications of a matrix searching algorithm", Aggarwal et al, Algorithmic 1987, <a href="http://dx.doi.org/10.1007/BF01840359" rel="nofollow">doi:10.1007/BF01840359</a>. It builds on previous work of Aggarwal, Chang, and Yap (their reference [2]) to show that the minimum area enclosing k-gon of a geometric figure can be found in time O(n^2) whenever k is constant — they explain it very briefly towards the bottom of the 11th page of their paper (page 205 of the journal).</p>
http://mathoverflow.net/questions/11580/minimum-area-bounding-quadrilateral-algorithm/11586#11586Answer by Michael Lugo for Minimum-area bounding quadrilateral algorithmMichael Lugo2010-01-12T21:28:21Z2010-01-12T21:28:21Z<p>I like the Monte Carlo algorithm suggested by Carl Smotricz at Stack Overflow, which I'll quote here:</p>
<ul>
<li><p>For each trial, randomly select p
distinct vertices and q distinct
sides of the polygon such that p + q
= 4.</p></li>
<li><p>For each of the q sides, construct a
line passing through that side's
endpoints.</p></li>
<li><p>For each of the p vertices, construct
a line passing through that vertex
and with a randomly assigned slope.</p></li>
<li><p>Verify that the 4 lines indeed form a
quadrilateral, and that this
quadrilateral contains (and does not
intersect!) the polygon. If these
tests fail, don't pursue this
iteration any further.</p></li>
<li><p>If this quadrilateral's area is the
minimum of all areas seen so far,
remember the area and the coordinates
of the quadrilateral's vertices.</p></li>
<li><p>Repeat an arbitrary number of times,
and return the "best" quadrilateral
found.</p></li>
</ul>
<p>But surely this can be improved upon. In particular, the "best" quadrilateral here is not guaranteed to <em>touch</em> the polygon we're attempting to bound, and so it can be made smaller. In particular, it seems like making random guesses and then trying to "improve" them in some way would be better than just making random guesses and throwing them out if they're not good enough.</p>