I have N(for example 30) integer numbers V[i]
, and M(for example 8) packs, each pack
have an expected value P[j]
.
I want to assign each integer number to one pack, the following expression calculate the difference
between the sum of V[k]
that in pack j
and the expected value of pack j
.
diff[j] = abs(P[j] - sum(V[k] that in pack j))
The target is to find the best solution that minimize sum(diff[j])
.
I don't know what's the type of this kind of problem. Can this be solved by Linear programming, or is it a NP-Complete problem?