I want to know is there is a way to reduce a Subset Sum problem with a set 'A' with negative and positive integers to the same problem but only with positive numbers.
1 Answers
You cant technically have the same problem with positive integers because any subset of positive integers (except empty subset) will have sum greater than 0.
You can have slightly different problem with positive integers (and positive subset sum). If you add one positive number X to each element in A thus forming A+ so that there are only positive elements in A+ then you'll search for a subset B of A+ for which the sum of its elements equals X * number of its(B's) elements. However this differs from the original Subset Sum problem by having a dynamic (dependant on the amount of elements in subset) sum to look for.
You might want to look here : http://www.or.deis.unibo.it/alberto/mssp_g_f.ps which is basically free version of this: http://www.sciencedirect.com/science/article/pii/S0020019000000107 as stated here: https://mathoverflow.net/questions/92504/multiple-disjoint-subset-sum-problem
-
1Not very useful answer. Of course you cannot sum positive numbers and get zero. Variant of subset sum problem with positive numbers only asks if subset exists that sums to a given input positive number. Obviously. – Serge Dundich Nov 11 '20 at 10:24
-
But what if there are negative numbers? How to reduce it to problem for positive only? – LetsGoBrandon May 27 '22 at 11:08