# Partitioning a connected shape into rectangles

I imagine this must be an introductory computational geometry question, but I'm not sure of the best search phrases, and I'm interested in variations of the question, also, so I'm hoping for pointers to useful references. I'm interested in feasible algorithms for the following problem.

Input: A connected set of points (shape) in $\mathbb{Z} \times \mathbb{Z}$.
Output: A partition of the shape into rectangles, such that the rectangles do not overlap one another, and they cover only the shape, no "empty" space.

I'm interested in finding the minimum number of rectangles, the "best" set of rectangles for any notion of best, whether this problem becomes easier or harder for different classes of shapes.

Thank you. :-)

• Look at this MathOverflow question Commented Jan 20, 2011 at 2:13
• @Peter Shor: Thanks very much. That looks like exactly what I need. Commented Jan 20, 2011 at 2:35
• So should this be an answer ? or should the question be closed ? Commented Jan 20, 2011 at 4:12
• @Suresh: I think it resolves my question, though perhaps someone else might have something to add about variants of the problem. I would prefer the question remain open in case anyone else has anything to add. I would be happy to accept it as an answer if @Peter Shor posted it as such. Commented Jan 20, 2011 at 20:04
• I guess I can post it as an answer, even though it seems like I did very little work. You should wait to accept it until you're sure nobody else has anything to add. Commented Jan 21, 2011 at 4:34

## 1 Answer

David Eppstein gave an excellent answer for this question here on MathOverflow (responding to a question for which it is not quite as good an answer). To summarize, there is a polynomial-time algorithm for finding the minimum number of rectangles.