Hi,

Hopefully someone can help me with this problem... it's driving me crazy:

I have n sets of values, each containing some arbitrary number of integers.
I need to create a new set of groups, by adding elements within each original set, so that the variance of the new groups is minimized.

Example
S_1 = {1, 2}
S_2 = {3}
S_3 = {1, 3, 4}
Variance here is calculated over {1, 2, 3, 1, 3, 4}

New groups that minimize variance:
G_1 = {3}
G_2 = {3}
G_3 = {4, 4}
Variance here is calculated over {3, 3, 4, 4}


Any idea how to approach this problem? Note that n can be quite large, and the number of elements within each set can be quite large as well.

Thank you!


Lz