If I have a set of (edit) positive integers, and I'm sure that the pseudo-polynomial time algorithm for partitioning the problem will not give me an answer - what would I do next?
To illustrate this problem let's take a look at this example: {100,1,2,3
}.
The p-p algorithm will give an answer False, and then I can end with result: This set can be partitioned into two set with difference 100-6 = 94
(The 6
is the last result from p-p algorithm on with [_
][vector.size()
] = True, the 106
is the sum of all digits).
But what if I really would like to know the maximum by sum two-split of this set in which every subset has the same sum - for example the result that I'm looking for should be 3
. This set - {100,1,2,3
} can be split (by bypassing the 100
) into two subset with the same sum - {1,2
} and {3
}.
How can I achieve this result?