0

Subset-sum problem is NP-complete. I presume so is the problem of determining, given a positive integer $p$, whether in a set of positive integers $\{x_1,x_2,...,x_n\}$ there is a subset which sums to one of the numbers $\{p-1,p,p+1\}$. Am I correct?

I've been struggling to reduce standard Subset-sum to this variation, but for no good so far. Can you see any other reduction? Or could give me a hint on this one? Perhaps I'm fixed for that Subset-sum and don't some other obvious possibility.

Raphael
  • 72,336
  • 29
  • 179
  • 389
Jules
  • 337
  • 2
  • 13
  • Intuitively, suppose you had an efficient algorithm for this new problem. Using this supposed algorithm, can you solve the subset sum problem efficiently as well? – Juho Nov 06 '15 at 06:36
  • 1
    See http://cs.stackexchange.com/q/1240/755 and http://cs.stackexchange.com/q/11209/755 for our reference material on this topic. (Possible dup?) – D.W. Nov 06 '15 at 07:06
  • @Juho Wouldn't that lead us to a Cook reduction (instead of Karp)? – Raphael Nov 06 '15 at 08:45
  • @Raphael Yes, possibly. – Juho Nov 06 '15 at 08:49

1 Answers1

1

Hint: Given an instance $\{x_1,\ldots,x_n\},T$ of SUBSET-SUM, construct the instance $\{2x_1,\ldots,2x_n\},2T$ of your problem.

Yuval Filmus
  • 276,994
  • 27
  • 311
  • 503