I have a set of positive integer numbers $A = \{a_1,\dots,a_N\}$ and I need to find a partition of $A$ into two sets, such that the sum of their products is minimal, i.e., $$ \min_{X,Y : X \cup Y = A} \prod_{x \in X} x + \prod_{y \in Y} y. $$ Is there any good approximation/heuristic algorithm to solve this problem?
-
1May we assume the numbers are distinct (since it's a set of numbers)? Are the numbers reals, integers, nonnegative integers, positive integers...? – paw88789 Jun 25 '22 at 14:59
-
Let's assume distinct (would be nice if it worked without), and positive integers. – DrDizzy Jun 25 '22 at 18:54
-
Cross-posted: https://cs.stackexchange.com/q/152673/755, https://math.stackexchange.com/q/4480170/14578. Please do not post the same question on multiple sites. – D.W. Jun 26 '22 at 19:52
1 Answers
You can get an upper bound by instead minimizing $$2\max\left(\prod_{x\in X} x, \prod_{x\in A \setminus X} x\right).$$ Equivalently, minimize $$\max\left(\sum_{x\in X} \log x, \sum_{x\in A \setminus X} \log x\right),$$ which you can linearize as follows. Let binary decision variable $s_a$ indicate whether $a \in X$, and let continuous decision variable $z$ represent the maximum of the two sums of logs. The problem is to minimize $z$ subject to \begin{align} z &\ge \sum_{a\in A} (\log a) s_a \\ z &\ge \sum_{a\in A} (\log a)(1 - s_a) \end{align}
See https://oeis.org/A127180 for optimal values for the original problem when $A=\{1,\dots,n\}$. The resulting sum of products $$\prod_{a\in A: s_a=1} a + \prod_{a\in A: s_a = 0} a$$ obtained from solving the linearized problem agrees with the optimal values found there.
- 45,619