I’m working on a task scheduler and faced the following problem (distribution of tasks among processors):
There is a set of N integers. How to partition them into K disjoint subsets that have small difference of their sums?
I’m looking for a simple heuristics that has reasonable computational complexity for N=100-500 and K=10-20. There is no need in the optimal solution (i.e. minimal possible difference of sums), rough approximation is enough.
Thanks in advance.
The construction heuristics First Fit or First Fit Decreasing work well.
For First fit Decreasing, first sort the parts in decreasing size (in the example below: A, B, C, D) and then put them in one by one, in the best remaining spot (X or Y). In the example below, ignore 1 of the 2 dimensions (for example, ignore CPU).