Skip to content
Advertisement

How to optimize min and max to find highest score sum

This problem involves finding two min-max criteria filters to generate the highest score sum in a dataset.

I have a dataset, with 3 columns. x, y, score, with over 1 million of rows.

x y score
3.6 1.2 -5
4.2 1.2 -4
1.2 30.2 1
2.9 6.8 6
3.1 5.8 7
0.1 15.8 7

The data may or may not have a correlation.

I want to find a criteria filter of min/max on x and y that gives me the highest possible sum of scores.

This is how the query would look like in SQL.

What I am looking for is the optimal values for xmin, xmax, ymin och ymax

What kind of optimization method is needed to solve this problem? And exactly how would the implementation look like?

(Preferrably it would be implemented using Java or postgres sql.)

Advertisement

Answer

Not so easy. Here is my MIP model:

The constants M are large enough numbers (I used the range of x or y data).

With some random numbers, I got:

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement