Question

I am trying to solve the following:

Given a set $S_0$, find min $|S|$ where $S_0 \subseteq S$ subject to:

$\forall s \in S$ $\exists$ $s_a, s_b \in S $ $|$ $ ( s_a \neq s, s_b\neq s ) \land ( s = s_a + s_b \lor s = 1 \lor s=2 ) $

Or in english, forall s in S there exists sa, sb in S such that sa != s, sb != s AND ( s = sa + sb OR s = 1 OR s = 2 )

For example if $S_0 = \{ 7, 9, 13, 22 \}$ then the solution is $S = \{ 1, 2, 3, 4, 7, 9, 13, 22 \}$ as

1 -> is 1 so allowed
2 -> is 2 so allowed
3 = 1 + 2
4 = 1 + 3
7 = 3 + 4
9 = 7 + 2
13 = 9 + 4
22 = 9 + 13
|S| = 8

$|S_0|$ is not particularly large but the numbers in $S_0$ can be very very large such that expressing all numbers possible is infeasible.

I have tried an ILP and ran out of memory expressing the binary variables for each number in the set.

My current approach ( which gives a pretty bad solution ) is pick the lowest number that is violated, heuristically pick two numbers and put them in the set. Repeat until all numbers meet constraints.

An approximate solution is fine. Anyone have any ideas?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with cs.stackexchange
scroll top