What Mathematical Structure can be used for this Optmisation Problem

35 Views Asked by At

I'm working with an optimisation problem that I'm unsure how to express in a Mathematical Construct.

Here we have $2n$ known numbers $x_i \in \mathbb{R}^+$ that we need to arrange into $n$ equations that all are of the form: $$ x_i + x_j = K $$ Where $K$ is a constant, $K \in \mathbb{R}^+$. Now in most (if not all cases) it will be impossible to arrange the values to satisfy the $n$ equations. As such, we instead are working with a minimisation: $$ \min d(x_i + x_j, K) $$ Where $d(a,b)$ is the distance between $a$, $b$. Now this is quite different to the standard optimisation problems I'm use to as instead of solving $x_i, x_j, \cdots$ in a set of equations we instead are given them and need to solve how to arrange them in a set of equations.

Now, as a point of illustration - consider if we have 4 numbers $20, 10, 50, 40$ and $K = 60$ then we need to create 2 sums that equal $K$. This is quite simple - $$ 20 + 40 = 60\qquad 10 + 50 = 60 $$

Obviously this can be brute forced, but for large datasets this becomes extremely problematic.

So, my question is - how can I formulate this into a Mathematical Construct to then solve? Has anyone worked with this?

I've only put in generic tags, please edit and add where appropriate.

1

There are 1 best solutions below

0
On

You can formulate this is a minimum-weight perfect matching problem in a graph with $2n$ nodes and an edge with weight $d(x_i+x_j,K)$ between nodes $i$ and $j$.