I'm faced with the following problem:
Given
Goal:
Notes:
I'm looking for an optimal assignment.
My questions:
(I may be expected to mention what have I tried. Since I'm looking for an optimal assignment, my heuristic ideas are not really relevant. At this point I have no idea how to find the optimal assignment).
It's a geometric special case of the weighted maximum coverage problem. The general MCP is NP-hard, and I suspect that this special case is as well, though unlike the general case, it probably has an efficient polynomial-time approximation scheme. You want an optimal solution, however, so the first thing that I would recommend is to feed the integer linear programming formulation in the linked Wikipedia article to an LP solver.
maximize sum_j (w_j * y_j)
subject to
for all i, sum_i x_i <= U
for all j, sum_{i : j in S_i} x_i - y_j >= 0
for all i, x_i in {0, 1}
for all j, 0 <= y_j <= 1
The weight w_j
of each point j
is given, and the sets S_i
are all possibilities for covering points with a width L
square. The meaning of x_i
is whether set S_i
is chosen. The meaning of y_j
is whether point j
is covered. The simplest cubic algorithm for constructing the S_i
s is to enumerate all squares whose lower left vertex has x coordinate equal to that of some point and y coordinate equal to that of some (possibly other) point, since every other square can be slid up and/or to the right without sacrificing coverage.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With