I have a set of floating point values that I want to divide into two sets whose size differs at most by one element. Additionally, the difference of value sums between the two s
My suggestion would be to sort the values, then consider each pair of values (v1, v2), (v3, v4) putting one element from each pair into one partition.
The idea is to alternate putting the values into each set, so:
s1 = {v1, v4, v5, v8, . . . }
s2 = {v2, v3, v6, v7, . . . }
If there are an odd number of elements, put the last value into the set that best meets your conditions.
You have a relaxed definition of minimal, so a full search is unnecessary. The above should work quite well for many distributions of the values.