Generated by GPT-5-mini| Subset sum | |
|---|---|
| Name | Subset sum |
| Type | Decision problem, Optimization problem |
| Field | Computer science, Combinatorics, Cryptography |
| Introduced | 1890s |
| Complexity | NP-complete |
Subset sum is a classical decision and optimization problem in theoretical computer science and combinatorics concerning selection of elements from a multiset to achieve a target sum. It arose in early number theory and later became central to computational complexity, cryptography, and algorithm design. The problem connects to many prominent researchers and institutions in algorithmic theory and has influenced practical systems and cryptosystems.
Given a finite multiset of integers and a target integer, the problem asks whether there exists a subset whose elements sum exactly to the target. Formalizations treat inputs as sequences of integers and a target; variants allow nonnegative, positive, or arbitrary integers, and consider decision, counting, or optimization formulations. The decision version is typically stated as a language over instances in binary representation. Historical developments tie to work by mathematicians in the late 19th century and to early computational studies at institutions such as Princeton University, Bell Labs, University of California, Berkeley, and Massachusetts Institute of Technology.
The decision formulation is one of the canonical NP-complete problems, proven NP-complete in the 1970s in the context of reductions used by researchers associated with Princeton University and Carnegie Mellon University. It is NP-hard under many-one reductions and belongs to NP because candidate subsets serve as polynomial-size witnesses verifiable in deterministic polynomial time. The problem played a role in the development of complexity classes and hardness results explored by scholars at Stanford University, University of Toronto, Cornell University, and University of Cambridge. Variants with bounded numeric values admit pseudopolynomial-time algorithms, relating to the distinction between weak and strong NP-completeness studied by researchers at University of Oxford and ETH Zurich.
Exact algorithms include dynamic programming, branch-and-bound, meet-in-the-middle, and integer linear programming formulations used by practitioners at IBM Research, Microsoft Research, and The Alan Turing Institute. Pseudopolynomial dynamic programming runs in time polynomial in the numeric target magnitude and input size; classic references include algorithmic textbooks from Cambridge University Press and MIT Press. Meet-in-the-middle methods, pioneered in part by cryptanalysts and algorithm designers at GCHQ and NSA contexts, split the set and combine half-sums, achieving time roughly proportional to 2^{n/2}. Approximation schemes like fully polynomial-time approximation schemes (FPTAS) for the optimization variant exploit scaling and rounding techniques developed in collaboration among researchers at INRIA, Université Paris-Saclay, and ETH Zurich. Heuristic and practical methods—such as lattice reduction using the LLL algorithm developed by researchers connected to École Normale Supérieure and Rutgers University—are employed in cryptanalysis and integer programming. Parameterized complexity approaches treat parameters like number of elements, target magnitude, or solution size, with work at University of Illinois Urbana–Champaign and Tel Aviv University contributing fixed-parameter tractable algorithms and kernelization results.
Numerous variants generalize or constrain the basic formulation: bounded subset sum, partition (a special case), knapsack (with weights and values), multi-dimensional subset sum, modular subset sum, and k-sum problems. These variants have been studied at research centers including Princeton University, Harvard University, Yale University, and University of Washington. Counting versions relate to #P-completeness results established by theorists at Rutgers University and California Institute of Technology. The modular and sparse instances link to additive combinatorics work by scholars at University of Oxford and University of Cambridge. Strongly NP-hard generalizations motivate hardness of approximation results from groups at Columbia University, University of Michigan, and University of Pennsylvania.
Subset sum underpins cryptographic constructions and cryptanalysis, particularly historical knapsack cryptosystems studied by cryptographers at RSA Laboratories, Draper Laboratory, and academic groups at University of California, San Diego and University College London. In operations research and integer programming, it models resource allocation problems tackled by practitioners at McKinsey & Company and Bain & Company as well as academic teams at Imperial College London and IESE Business School. Combinatorial and additive problems in number theory and coding theory connect to work at Institut Henri Poincaré and Max Planck Institute for Informatics. Applications also appear in bioinformatics, subset selection, and portfolio optimization studied by researchers at Broad Institute and London School of Economics.
Simple illustrative instances include: given {3, 34, 4, 12, 5, 2} and target 9, a subset {4,5} yields a solution; this instance has been used in textbooks from Addison-Wesley and Prentice Hall. For meet-in-the-middle demonstration, splitting a 6-element set reduces complexity, a technique highlighted in algorithm courses at Carnegie Mellon University and University of Cambridge. Harder crafted instances used in cryptanalysis and benchmarking have been generated by research groups at Zuse Institute Berlin and National Institute of Standards and Technology. Practical solvers combine dynamic programming, branch-and-bound, and heuristic search, with implementations distributed by teams at Google Research and Facebook AI Research for use in competition and benchmarking frameworks.
Category:Computational problems