Given a rectangle R containing P points, orthogonal with axes, points are natural numbers.
Parcel is a rectangle which:
- is totally inside R
- sides are orthgonal with axes
- contains exactly ONE point inside
- its sides must be adjacent to sides of R or contain point(s) from P
Find an algorithm to find all possible parcels inside R, so their total area is minimal (maximize wastelands area).
Example: One of many ways of division, 5 points(*), 2 parcels
R
|-----------------------------------------------|
| | | |
| | | * |
| * | |
| | * |
| | * | |
| | | |
| | | |
| |-----------*-------| |
| wastelands | |
| | |
| | |
|-----------------------------------------------|
Firstly, lets skip optimizing(max/min). Is there any good way to partition a rectangle?
Edit
It looks like it might be NP-hard. I got some feedback from initiator of this problem and finding all possible parcels is pointless. I think the only way is to use some heuristic (e.g. finding biggest parcels or parcels which sides contain most of points) and check the results.