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="http://en.wikipedia.org/wiki/Partition_problem">wikipedia entry</a>, this <a href="http://people.csail.mit.edu/bdean/6.046/dp/">page</a> (problem 7) and a <a href="http://ronzii.wordpress.com/2012/03/19/balanced-partition-problem/">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?
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="http://en.wikipedia.org/wiki/Partition_problem">wikipedia entry</a>, this <a href="http://people.csail.mit.edu/bdean/6.046/dp/">page</a> (problem 7) and a <a href="http://ronzii.wordpress.com/2012/03/19/balanced-partition-problem/">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?