[Math] Covering a polygon with rectangles

computational geometrycoveringdiscrete geometrymg.metric-geometry

I am trying to cover a simple concave polygon with a minimum rectangles. My rectangles can be any length, but they have maximum widths, and the polygon will never have an acute angle.

I thought about trying to decompose my concave polygon into triangles that produce a set of minimally overlapping rectangles minimally bounding each triangle and then merging those rectangles into larger ones. However, I don't think this will work for small notches in the edges of the polygon. The triangles created by the reflex vertices on those notches will create the wrong rectangles. I am looking for rectangles that will span/ignore notches.

I don't really know anything about computational geometry, so I'm not really sure on how to begin asking the question.

I found other posts that were similar, but not what I need:

Some examples: Black is the input. Red is the acceptable output.

enter image description here

Another example: The second output is preferred. However, generating both outputs and using another factor to determine preference is probably necessary and not the responsibility of this algorithm.

enter image description here

enter image description here

Polygons that mimic curves are extremely rare. In this scenario much of the area of the rectangles is wasted. However, this is acceptable because each rectangle obeys the max width constraint.

enter image description here

Also, I found this article to be close to what I need:

Maybe a better question is "How can I identify rectangular-like portions of a concave polygon?"
enter image description here

Here is an image showing the desired implementation:
enter image description here

The green is the actual material usage. The red rectangles are the layouts. The blue is the MBR of the entire polygon. I am thinking I should try to get little MBRs and fill them in. The 2-3 green rectangles in the upper left corner that terminate into the middle of the polygon are expensive. That is what I want to minimize. The green rectangles have a min and max width and height, but I can use as many rows and columns necessary to cover a region. Again, I must minimize the number of rectangles that do not span across the input. I can also modify the shape of the green rectangle to fit in small places that is also very expensive. In other words, getting as many rectangles as possible to span as much as possible is ideal.

Best Answer

Here is one relevant result, by Michael Hoffmann, "Covering polygons with few rectangles," 2001. (PDF download link)
        Hoffmann Italy
He shows that minimal covering by two or three congruent axis-aligned rectangles of a collection of polygons with a total of $n$ vertices can be found in $O(n)$ time.

He also says that the more general problem—covering a set of polygons by $p>3$ congruent rectangles—cannot be approximated by better than a factor of $2$ unless $P=NP$ (because of the relation to the $p$-center problem). He does not directly address covering just one polygon, or with covering by incongruent rectangles.

This latter problem (your problem) is partially addressed computationally in the paper 2011, "Covering a polygonal region by rectangles," Computational Optimization and Applications (Springer link). It appears that they start with a set of rectangles, and extend them until they form a cover.

Related Question