Solve subset targets with filters, duplicates, limits, negative values, and detailed outputs for faster analysis. Find valid combinations, inspect counts, and download reports instantly.
| Case | Set Values | Target | Size Range | One Valid Subset | Subset Sum |
|---|---|---|---|---|---|
| Budget Mix | 5, 8, 12, 14, 20 | 32 | 1 to 4 | 12, 20 | 32 |
| Score Target | 3, 7, 12, 19, 25, 31 | 38 | 1 to 6 | 7, 31 | 38 |
| Mixed Signs | -4, 6, 9, 13, 17 | 15 | 1 to 5 | -4, 6, 13 | 15 |
The calculator solves the subset sum problem with dynamic programming. For a set S = {a₁, a₂, ..., aₙ} and target T, it checks whether some subset produces:
Σ aᵢ = T for selected indices only.
Each new value extends existing reachable sums. The recurrence is:
DP[k][x] = DP[k-1][x] OR DP[k-1][x - aₖ]
This implementation stores reconstructed subsets, applies subset-size limits, supports decimals by scaling values, and reports exact plus closest sums.
It tests whether selected values from your list can add to an exact target. It also shows matching subsets, closest sums, and useful search statistics.
Yes. The tool scales decimal values before processing, then converts them back for display. Negative numbers are also supported in the search.
Subset sum grows quickly as list size increases. A practical cap keeps the page responsive and reduces memory use on standard hosting environments.
Multiple subsets can produce the same intermediate sum. This setting limits how many examples are saved for each reachable total during reconstruction.
Not always. If many combinations exist, the saved-solution limit may trim some alternatives. Increase the limit when you need broader coverage.
The calculator reports that no exact match was found. If enabled, it also lists subsets whose sums are closest to your target.
It is helpful for budgeting, score combinations, inventory bundling, classroom exercises, test-case design, and algorithm studies involving constrained selections.
Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.