How to partition a set of positive integers as evenly as possible?

718 Views Asked by At

I want to partition a set of positive integers into $n$ subsets as evenly as possible. Summation of these subsets should be close to each other as much as possible.

I have read something about NP-completeness but I got confused. Can someone suggest a method in -for-dummies fashion?

1

There are 1 best solutions below

2
On

Greedy method: Sort the numbers and start with the biggest and the go to the smallest. Always put the next number in the subset with the smallest sum.