Balanced partition


Staff member
I know this was talked over a lot here, but I am struggling with this problem.

We have a set of numbers, e.g [3, 1, 1, 2, 2, 1], and we need to break it into two subsets, so the each sum is equal or difference is minimal.

I've seen <a href="">wikipedia entry</a>, this <a href="">page</a> (problem 7) and a <a href="">blog entry</a>.

But every algorithm listed is giving only YES/NO result and I really don't understand how to use them to print out two subsets (e.g S1 = {5, 4} and S2 = {5, 3, 3}). What am I missing here?