Hacker News new | ask | show | jobs
by 256 3133 days ago
This is indeed an interesting problem. If you just want to minimize the number of rectangles there is a neat solution on stackoverflow [1] that uses minimum vertex cover (equivalently, bipartite maximum matching).

[1] https://stackoverflow.com/a/6634668

1 comments

But the goal here really isn’t to minimize the number of pieces used. It is to minimize total cost of covering the space. This makes things much more complex as it turns into some weird variant of a knapsack problem.