Compressing sets of rectangles... help me find an algorithm?
jdoliner: Well if you're willing to sacrifice a bit of speed I think I have a pretty good heuristic algorithm you can use:
Step 1: Find a maximal point, by this a mean a point `p' s.t. no point has x >= p.x and y >= p.y. (such a point clearly exists). 
Step 2:
Now it shouldn't be too hard to see that for a rectangle to cover `p' it would have to have `p' as one of its corners, so we set one corner as `p' and then grow the other corner until it runs into walls.This is just off the top of my head so I'm haven't really done much analysis. You could make it a bit slower and actually get the rectangle that takes up the most area instead of just growing until you hit walls. Not sure how much that actually improves it.