partition set of integers - Programmers Heaven

#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

#### Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

# partition set of integers

Posts: 1Member
Hello,

I need to partition a set S of integers into k subsets, so that the variance of the sum of the integers in each partition is minimized.

Example, for k=3

the original set:
S = {1, 1, 2, 4, 6, 17, 19, 25, 28, 39, 49}

is split into:
s1={28,19,17}
s2={39,25}
s3={49,6,4,2,1,1}

because it minimizes var(63, 64, 64)

Note that S can have a large number of elements... so I need something relatively efficient.

Any help would be appreciated.

Thanks!!