I have an optimization problem as follows.
Given an array of positive integers, for example. (y1 = 2, y2 = 3, y3 = 1, y4 = 4, y5 = 3) , I try to maximize the sum of the values ββof the functions f(x) , where f(x) = x if x + y <= m and f(x) = 0 otherwise. ( m is a positive integer)
For example, in this specific example above (with m = 5 ), the optimal value of x is 2 , since the sum will be 2 + 2 + 2 + 0 + 2 = 8 , which is the highest among other possible values ββfor x (implicitly, possible x will vary between 0 and 5 )
Of course, I can exhaustively work out and compare the sums received by all possible values ββof x, and choose x, which gives the highest amount, provided that the range x is sufficiently small. However, if the range becomes large, this method can become overly expensive.
I wonder if there is anything that I can use from things like linear programming to solve this problem more generally and correctly.
source share