Find k rectangles so that they cover the maximum number of points

后端 未结 4 438
伪装坚强ぢ
伪装坚强ぢ 2020-12-10 23:13

In two dimensional space, given a bunch of rectangles, every rectangle covers a number of points and there may be overlap between two arbitrary rectangles, for a specified n

4条回答
  •  感动是毒
    2020-12-10 23:51

    If you have n rectangles, k of which you have to choose, then there are (choose n k) different combinations, i.e. (/ (factorial n) (factorial k) (factorial (- n k))). In the general case, I suspect that you have to enumerate these combinations and calculate their coverage. However, you might be able to cut this short a bit by ordering the rectangles by coverage (i.e. number of points covered by themselves), starting with the combination of the biggest rectangles, and stopping when the remaining rectangles cannot surpass your previously best combination.

提交回复
热议问题