I have any number of graphs. Each graph is a plot of points, not necessarily an equation.
I need to pick a point on each graph in way that the following is true:
- The sum of the y values of each point is maximized
- The sum of the x values of each point does not exceed a limit L, which can be any positive number.
The problem seems so simple, and yet I cannot find a way to solve the problem mathematically. There are several ways to solve the problem using CS, but I would prefer to avoid those if possible.
This has the combinatoric feel that says to me finding a perfect algorithm will be hard and the problem may even be NP hard. I would suggest the following reasonably greedy algorithm:
This is not guaranteed to find an optimal solution. It could be that the third best $y$ in one graph comes with a very small $x$ and would get the sum down to $L$ in one go.