MathOverflow is a question and answer site for professional mathematicians. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

There are a few algorithms around for finding the minimal bounding rectangle (OBB) containing a given (convex) polygon.

Does anybody know about an algorithm for finding a minimal-area bounding quadrilateral (any quadrilateral, not just rectangles)?

I've been refered to this site from (original post), since the guys over there did not know the answer to this...

(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!)

share|cite|improve this question
up vote 5 down vote accepted

I think what you want is "Geometric applications of a matrix searching algorithm", Aggarwal et al, Algorithmic 1987, doi:10.1007/BF01840359. 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).

share|cite|improve this answer
This is it. Thanks a lot. – Carsten Jan 13 '10 at 9:21

I like the Monte Carlo algorithm suggested by Carl Smotricz at Stack Overflow, which I'll quote here:

  • For each trial, randomly select p distinct vertices and q distinct sides of the polygon such that p + q = 4.

  • For each of the q sides, construct a line passing through that side's endpoints.

  • For each of the p vertices, construct a line passing through that vertex and with a randomly assigned slope.

  • 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.

  • 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.

  • Repeat an arbitrary number of times, and return the "best" quadrilateral found.

But surely this can be improved upon. In particular, the "best" quadrilateral here is not guaranteed to touch 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.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.