Statistical Mechanics of an NP-complete Problem: Subset Sum

We study the statistical properties of an NP-complete problem, the subset sum, using the methods and concepts of statistical mechanics. The problem is a generalization of the number partitioning problem, which is also an NPcomplete problem and has been studied in the physics literature. The asymptotic expressions for the number of solutions are obtained. These results, applied to the number partitioning problem as a special case, are compared with those which were previously obtained by a different method. We discuss the limit of applicability of the techniques of statistical mechanics to the present problem.