Given is a pool of $400$ elements that are supposed to be matched pairwise based on the following rules:
- Each element has a parameter $x$, and the matching should be done so that $x_1$ (first element of a pair) plus $x_2$ (second element of a pair) are as big as possible while the sum is globally as equal as possible.
- Each element has a parameter $y$, and the matching should be done so that $(\frac1{y_1} + \frac1{y_2})^{-1}$ is as small as possible while the result is globally as equal as possible.
Out of the $400$ elements, a set of $280$ is supposed to be created so that the conditions above are met optimally.
Trying all possible combinations would be something like $\binom{400}{280}$ which is a very large number according to WolframAlpha.
I am searching for an algorithm that is capable of calculating the optimal matching of elements in the best runtime possible.