A general solution to this problem is NP-complete, because it subsumes the knapsack problem. However, as with the knapsack problem, you may be able to address it constructively (in "pseudopolynomial time") using dynamic programming.
To see this: given a knapsack problem with knapsack size T
and object sizes c[i]
, compose a problem as described in your question such that a[i]==b[i]==c[i]
and k == sum(c[i]) - T
.
Then, the solution to the knapsack problem is the set of indices not in S
:
sum(c[i] *not* indexed by S) == sum(c[i]) - sum(a[i] indexed by S)
T == sum(c[i]) - k
Note that S
satisfies knapsack constraint sum(c[i] *not* indexed by S) <= T
if and only if the problem constraint sum(a[i] indexed by S) >= k
holds.
sum(c[i] *not* indexed by S) == sum(c[i]) - sum(b[i] indexed by S)
Since a solution to the posed problem minimizes sum(b[i] indexed by S)
over valid S, sum(c[i] *not* indexed by S)
is maximized over valid S, and is an optimal solution of the knapsack problem.