I keep seeing two versions of the Subset Sum Problem. The first and seemingly least common is:
Given an integer bound $W$ and a collection of $n$ items, each with a positive integer weight $w_i$, find the subset $S$ of the items that maximizes $\sum_{i \in S} w_i$ while keeping this sum at most $W$. Or the decision version: Is there a subset obeying the at-most-$W$ rule with weight at least some number $k$.
So just Knapsack except the values are the weights themselves.
The second and seemingly more common is:
Given a set of $n$ integers, is there a non-empty subset whose sum is 0 (or equivalently, some number $k$)?
E.g., my textbook (Kleinberg and Tardos) as well as this have the first one. Wikipedia and other websites have the second.
I believe both are NP-complete. That said, I haven't found an "obvious reduction" from one to the other that suggests why the two problems are given the same name. So my questions are:
- Do quick reductions exists between the two?
- Why are these given the same name in the first place?