Improving Lagarias-Odlyzko Algorithm for Average-Case Subset Sum: Modular Arithmetic Approach
Abstract
Lagarias and Odlyzko (J.ACM 1985) proposed a polynomial-time algorithm for solving “almost all” instances of the Subset Sum problem with integers of size , where and is a parameter of the lattice basis reduction ( for LLL). The algorithm of Lagarias and Odlyzko is a cornerstone of cryptography. However, the theoretical guarantee on the density of feasible instances has remained unimproved for almost 40 years.
In this paper, we propose an algorithm that solves “almost all” instances of Subset Sum with integers of size after a single call to lattice reduction. Additionally, our approach allows solving the Subset Sum problem for multiple targets, whereas the previous method could handle only one target per call to lattice basis reduction. We introduce a modular arithmetic approach to the Subset Sum problem, leveraging lattice reduction to solve a linear system modulo a suitably large prime. By analyzing the lengths of the LLL-reduced basis vectors of both the primal and dual lattices simultaneously, we show that density guarantees can be improved.
Keywords and phrases:
Average-Case Analysis, Subset Sum, Lattice Reduction, LLLFunding:
Karol Węgrzycki: Supported by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) grant number 559177164.Copyright and License:
2012 ACM Subject Classification:
Security and privacy Cryptanalysis and other attacks ; Theory of computation Randomness, geometry and discrete structuresEditors:
Meena Mahajan, Florin Manea, Annabelle McIver, and Nguyễn Kim ThắngSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
The Subset Sum problem, a fundamental problem of computational complexity and cryptography, has been extensively studied due to its numerous practical implications. In the Subset Sum problem, we are given positive integers and a target . The task is to decide if there exists a subset of the given numbers that sum to .
In particular, the study of Subset Sum has seen numerous applications in cryptography [41, 23], balancing [20], and combinatorial optimization [36]. With these applications in mind, our goal is to propose an efficient algorithm to solve the Subset Sum for a large range of instances. Indeed, since the problem is NP-hard, it is unlikely that we could propose an efficient algorithm to solve all instances of the problem. The natural next step is to characterize which instances of the problem can be solved efficiently. On that front, there is a classical result by Bellman [11] that proposes a polynomial time algorithm for Subset Sum when the numbers are polynomially bounded, i.e., the instance is dense. This result inspired a long line of pseudopolynomial-time algorithms (see e.g., [17, 37, 45]).
At the other end of the spectrum, Lagarias and Odlyzko [38] introduced a polynomial time algorithm for sparse instances. Their work marked a significant milestone by proposing a polynomial-time algorithm capable of solving “almost all” instances of Subset Sum when the numbers are of size , where and is a parameter associated with the lattice reduction. Lagarias and Odlyzko [38] employed the LLL (Lenstra-Lenstra-Lovász [40]) algorithm for lattice basis reduction, for which .
To this day, the Lagarias and Odlyzko algorithm remains a cornerstone of modern cryptography and is featured in numerous text-books on the field [26, 15, 43]. This algorithm was subsequently implemented [46, 49, 16], simplified [24] and was improved assuming access to an exact Closest Vector Problem (CVP) [22, 34]. Nevertheless, the algorithm of Lagarias and Odlyzko is currently the only known method111There are several extensions of the LLL algorithm tailored for solving Subset Sum in practice, see [49, 39]. to solve low-density instances of Subset Sum, both in theory and practice (see [44] for survey).
In this paper, we revisit and improve the result of Lagarias and Odlyzko [38]. We present an algorithm solving almost all instances of Subset Sum when the size of the numbers is . More formally, we prove the following theorem.
Theorem 1.
Let be integers, selected uniformly at random from , where . With overwhelming probability, in polynomial time and after a single call to a basis reduction algorithm with parameter , we obtain a polynomial time tester, that for every given decides whether
Our tester and its creation method are both deterministic. Their success probability only depends on the random choice of the integers and is at least .
The improvement offered by Theorem 1 is twofold. First, in terms of the admissible range, our algorithm improves the bound on the instance’s numbers from down to . This means that, within the same running time as the previous algorithm, we can solve more instances of Subset Sum (see discussion in Section 1.2). Second, our algorithm is oblivious to the target. Namely, after a single call to the lattice basis reduction, with input numbers we can deterministically decide on an answer in polynomial time. In this sense, our argument provides a succinct certificate for “almost all” instances of sparse Subset Sum. Precisely this question was previously considered by Furst and Kannan [25] who used lattice basis reduction to bound the proof complexity of Subset Sum. They strengthened the Lagarias and Odlyzko algorithm and showed that “almost all” instances with numbers in have a polynomial size proof. Our argument again reduces the range to , and our certificates are simpler. In fact, as we will see later, the data-structure behind Theorem 1 requires only a single matrix-vector multiplication.
Running time comparison.
Lagarias and Odlyzko offer a reduction of the average-case Subset Sum problem to a lattice problem. The exact parameters for which the Subset Sum can be solved depend on the quality of the lattice reduction algorithm used. In their original approach, they performed this reduction using a perfect lattice reduction and the LLL algorithm. They assumed access to an algorithm that provided an approximate shortest vector within an approximation factor of .
Theorem 1 provides a more efficient, in terms of the running time, reduction than that of Lagarias and Odlyzko. For simplicity of exposition, we first prove Theorem 1, which uses the LLL algorithm as a subroutine. Later, in Section 1.2, we extend this result to a family of lattice reduction algorithms where the parameter . Although polynomial, these algorithms incur a higher running time cost as approaches 1. In particular, for any fixed constant , average-case instances of Subset Sum with numbers in the range , where
can be solved in time using the Lagarias and Odlyzko approach. This also holds for our approach, and in fact, we achieve the same density using a lattice reduction algorithm with a running time , offering improved efficiency. We provide further details in Section 1.2 and Appendix A.
1.1 Our Technique: Modular Arithmetic Approach
Now, we elaborate on the techniques that we introduce. In this note, we let be a unique integer in such that (see Section 2 for notation). Consider vectors , and an integer such that
| Obviously, for any integers the following also holds | ||||
Next, assume, that we have managed to find and , such that:
Then there are no overflows modulo and actually, we can write
We will show that if the density is small, then there are integers such that for each of them (i) the norm is bounded, i.e., , and (ii) the vectors are linearly independent. More formally we will prove the following theorem.
Theorem 2 (Modular Arithmetic Approach).
Let and let be a prime. There exists a polynomial time algorithm, that given integers selected uniformly at random from outputs, with overwhelming probability, integers such that the following matrix
has full rank. Moreover, for every it holds that:
More precisely, the procedure succeeds with probability , which only depends on the random choice of integers .
The algorithm for Theorem 1 follows easily with the matrix in hand. First we let and compute the inverse of (which is possible because has full-rank). It remains to verify that the vector is in (see Section 3 for the full proof).
Observe that if is a solution for , then . Therefore, if a solution in exists, we find it. On the other hand, recall, that has full rank, hence e such that is unique. This means that, if we find e that satisfies , yet e is not in we know that no solution exists. When we find a solution, we also check that it is indeed a genuine solution of the Subset Sum instance.
Now, we briefly sketch the proof of Theorem 2. Our algorithm is inspired by Howgrave-Graham’s revisit [30] of Coppersmith’s method for finding short roots of univariate modular equations [21]. In a nutshell, we construct a lattice (very similar to the original lattice of Lagarias and Odlyzko) for Subset Sum modulo a prime number . Analogously to the original approach of Lagarias and Odlyzko we bound the length of vectors in this lattice. The caveat is that we can also bound the lengths of the vectors in the dual lattice. This crucially allows us to double the density of the admissible instances.
There are two main differences between our proposal and Howgrave-Graham’s algorithm [30] (and the original Coppersmith’s method [21]) Firstly, the number of variables to consider in our case is much larger. Secondly, we only need to construct linear polynomials in these variables rather than considering large degree polynomials.
1.2 Extension to Block Basis Reduction
We would like to comment on the possible improvements of using stronger lattice reduction. Specifically, the only aspect of the Lagarias-Odlyzko algorithm that relies on the LLL algorithm is the fact that it provides a -approximate solution to the Shortest Vector Problem with . Instead of the LLL algorithm, it is natural to apply block-basis reduction (e.g., [48, 2]) with parameter arbitrarily close to . This way, one expects a better approximation of SVP, consequently improving the range . The obvious drawback of this is the increased running time.
Our approach, in principle, should allow us to reduce the bitlengths of the Subset Sum instances that can be solved regardless of the concrete algorithm behind the lattice reduction. Unfortunately, adapting our approach to work with every basis lattice reduction requires a separate analysis which is much more technical than for LLL. Nevertheless, the takeaway message is as follows:
The Modular Arithmetic Approach allows us to solve almost all instances of Subset Sum with integers with a single call to lattice reduction, whereas the previous approach guaranteed to solve only instances with integers while using the same lattice reduction algorithm.
Since the LLL algorithm is the most popular we decided first to present our algorithms using this algorithm. In Appendix A, we demonstrate that our approach works for the textbook block-reduction presented by Gama and Nguyen [27, 43].
Theorem 3.
Let be a parameter of lattice reduction in [27]. Let be positive integers, selected uniformly at random from range , where . With overwhelming probability, after a single call to a basis reduction algorithm in [27] with parameter , we obtain a polynomial time tester, that for every given decides whether
Our tester and its creation method are both deterministic. Their success probability only depends on the random choice of the integers and is at least .
In comparison, the standard analysis of the Lagarias-Odlyzko algorithm requires the range of integers to be of order when the lattice reduction with parameter is used.
1.3 Related Work
The currently fastest algorithm to solve Subset Sum exactly in the worst-case settings runs in time [29]. Schroeppel and Shamir [50] show that Subset Sum admits a time-space tradeoff, i.e., an algorithm using space and time for any . This tradeoff was improved by [4] for almost all tradeoff parameters (see also [23, 42]).
Average-case algorithms for Subset Sum and more general problems are actively researched [33, 13, 14, 10, 12, 51]. When input numbers are of order , Howgrave-Graham and Joux [31] showed time and space algorithm for Subset Sum. This was subsequently improved by Becker, Coron and Joux [9] to time and space.
The exact running time of the Subset Sum was also analyzed in the parameterized setting [5, 6], quantum regime [3, 28], total regime [1, 19, 7] and the polynomial space regime [8]. From the perspective of pseudopolynomial algorithms, Subset Sum has also been the subject of recent stimulative research [17, 45, 32, 18].
2 Preliminaries
Throughout the paper, we let . We use to denote equivalence modulo , i.e., iff there exists such that . For integers we let be the unique value in set such that . notation hides factors polynomial in .
We consider n with the usual Euclidean topology. We use bold letters to denote vectors. The inner product of two vectors and is denoted by . We denote the norm as . Often, we omit the subscript which means that we consider the Euclidean case with . We denote the -dimensional Euclidean ball of radius centered at 0 by . We use the Stirling formula to approximate the volume of the -dimensional ball, namely:
2.1 Background on Lattices
A lattice in n is a discrete subgroup of . This implies that a lattice is a non-empty set such that for all it holds that . Any subgroup of is a lattice, and it is called an integral lattice.
Let be vectors in n. Let be the set of integral combinations of these vectors, namely:
Then, is a lattice, specifically the lattice spanned by Furthermore, when the vectors are linearly independent (over ), we say that they form a basis of In this case, every vector uniquely decomposes as an integral combination of the basis vectors , i.e., for every there exists unique such that [43, Definition 5, p. 26]. It is well-known that every lattice admits a basis. The cardinality of any basis is an invariant of the lattice and is called its dimension (or sometimes referred to as its rank). This quantity, denoted by is equal to the dimension of its linear span (denoted ) as a vector space over .
We say that a lattice has full rank when . Since any lattice of n admits some basis, we assume w.l.o.g. that every lattice we consider is given in the form for some ’s in n where .
Thus, are linearly independent vectors. Their Gram-Schmidt orthogonalization (GSO) is the orthogonal family defined inductively as follows:
We can define the volume of the lattice spanned by as
and remark that it is a lattice invariant and does not depend on the choice of basis.
Other classical invariants of a lattice are its successive minima. By definition, the th successive minimum, denoted as is the smallest real number for which there exist linearly independent vectors in each of length at most . In particular, is the length of the shortest nonzero vector in . Note that .
2.2 Dual Lattice
For a lattice the dual lattice of is defined as:
When is an -dimensional lattice of then is also an -dimensional lattice of . More precisely, if is spanned by the rows of the basis matrix , then is spanned by the rows of:
Furthermore, it holds that . Finally, if we reverse the order of the rows of , we obtain the so-called dual basis of . The GSO of dual basis is related to the GSO of the primal basis by the following relations:
In order to make explicit that the order of the (row) basis vectors is reversed, we write:
2.3 The LLL algorithm and its property
Lenstra, Lenstra and Lovász [40] presented a polynomial time procedure that, given an arbitrary basis of a lattice computes a so-called reduced basis with better properties. Extensions of LLL can also compute a reduced basis from an arbitrary generating family.
The main parameter of LLL is a real . A secondary parameter is also useful when considering implementations of LLL with finite precision on orthogonalised vectors. The initial LLL with exact rational arithmetic [40] uses . Let be basis of lattice and be its Gram-Schmidt orthogonalized basis of . We say that is -LLL reduced if and only if the following conditions are satisfied:
| Size Reduction: | ||||
| Lovász Condition: |
Recall that . Both of these conditions yield an implied parameter , such that:
| (1) |
Equation 1 is the strongest for for some . This is achieved by taking sufficiently close to and sufficiently close to . In the sequel, we focus on the parameter and express our results in terms of it. Note, that the same inequality holds for the dual lattice.
2.4 State-of-the-art: Lagarias-Odlyzko Algorithm
Assume that is a vector in where each is chosen independently uniformly at random from and is chosen independently at random. Set . Then, clearly e is a solution to the equation:
Here, we recall the argument of Lagarias and Odlyzko who show that if and , then the LLL algorithm is sufficient to solve an instance with target of Subset Sum in polynomial time and with probability .
Note that , and we can assume that as otherwise, we can consider the same instance with target . Let be a sufficiently large integer. Lagarias and Odlyzko [38] construct the following row-generated lattice:
Let such that . Observe that and . Therefore, the vector is a short vector of .
The idea of Lagarias and Odlyzko is to use the algorithm of Lenstra, Lenstra and Lovász [40]. Let v be a minimum length non-zero vector in . The LLL algorithm guarantees finding a nonzero vector with:
Here, is an implied parameter of the LLL algorithm, and we can guarantee that when , the LLL algorithm runs in polynomial time (see Section 2). Note that the vector x found by the LLL algorithm satisfies
The strategy is, hence, to run the LLL algorithm and hope that the vector x returned by LLL is either or . There is of course the possibility that there are other spurious vectors of length less than . The analysis by Lagarias and Odlyzko demonstrates that this is, however, highly unlikely. More precisely, they show the following statement:
Claim 4 (cf., [24]).
Note that this is when . Therefore, by considering the opposite event, we can guarantee that the vector is found with a probability at least . We include the proof of Claim 4 due to [24] as it serves as an introduction to our technique.
Proof of Claim 4.
Let . Observe that if then already . Hence, it must hold that . Let
Now, it suffices to bound the probability that is empty. If, however, is nonempty, there exists and that satisfy and:
| (2) |
Let us now fix this vector w and integer . Let be such that . Observe that . Without loss of generality, we can assume that and we let . Hence,
As and are independent, this is bounded by
Therefore, a fixed w and satisfy Equation (2) with probability at most . Note that the number of and such that , and is at most and the proof concludes.
Note, that the proof of Claim 4 uses lattice reduction as a blackbox. If one were to use lattice reduction with parameter , then the range guaranteed by Claim 4 would be . In the next sections, we will show a method to improve the admissible range down to that uses more properties of lattice reduction. In Section 3 we analyse it with the standard LLL. Then in section Appendix A we analyse it with a textbook block lattice reduction of Gama and Nguyen [27].
3 Modular arithmetic approach
In this section, we focus on the proof of the following statement.
Theorem 2 (Modular Arithmetic Approach). [Restated, see original statement.]
Let and let be a prime. There exists a polynomial time algorithm, that given integers selected uniformly at random from outputs, with overwhelming probability, integers such that the following matrix
has full rank. Moreover, for every it holds that:
More precisely, the procedure succeeds with probability , which only depends on the random choice of integers .
Before we do so, let us show how to use Theorem 2 to solve the Subset Sum formally.
Proof of Theorem 1 assuming Theorem 2.
We start by describing the algorithm. First, we use Theorem 2 to compute the integers . This gives us the matrix . We know that this matrix has full rank so we can compute its inverse with the Gaussian elimination algorithm. This concludes the description of the preprocessing phase.
Now, given a target we compute the vector and compute a candidate solution . Finally, we check that e is indeed correct. Namely, if and we return e and otherwise. This concludes the description of the algorithm. Clearly, the algorithm runs in polynomial time. Moreover, a query takes only arithmetic operations (on numbers bounded by ). The success probability of the algorithm comes exclusively from a single application of Theorem 2. Therefore, it remains to argue about the correctness.
Let be a solution to and assume that our algorithm returns . Because the norm is bounded by it holds that:
Since the matrix has full rank, there exists a unique solution to the above linear system. Hence . Finally, note that we only return this solution if all its coordinates are in and the total weighted sum is equal to the desired target, thus ensuring an incorrect solution is never returned.
From now on we will focus on the proof of Theorem 2.
3.1 Generating Family
Let be the prime fixed in Theorem 2. In particular, is odd. Because the numbers are generated at random in the interval which has length much larger than , the modular reductions are very close to uniform modulo . For simplicity of the analysis we want to assume that they are uniform. This can be achieved by using the rejection sampling to discard any event when at least one is greater than , where is the largest multiple of such that . This is valid, because the probability that specific is discarded is:
Therefore, by the union bound, probability that we do not discard any of is at least . Similarly, we can assume that is not a multiple of . Hence, there exists an integer such that . Note that this integer can be computed with number of arithmetic operations.
Consider the lattice generated by the rows of the following matrix:
| (3) |
Now, let us elaborate on the connection between matrix and any vector from the statement of Theorem 2.
Observation 5.
For every integer it holds that:
Conversely, for every vector , there exists such that:
Moreover, is unique modulo and its exact value can be determined with a constant number of arithmetic operations.
Proof.
For the first property observe that trivially . Let be the vector with at the th coordinate and at the remaining coordinates. Note that by definition for every . Then we construct the desired vector by
For the converse property, by definition any vector is represented as:
for some integers . Let us inspect the th coordinate of v. For every it holds that . Therefore, for every , the th coordinate of v is . We hence can set . Note, that given vector v, the integer can be computed efficiently because it is expressed as , where is the first coordinate of v.
Now, let us further elaborate on the subsequent steps. We run the LLL algorithm on . The LLL algorithm returns a basis of . We show that, with high probability, for every . If that occurs we are nearly finished. By the Observation 5 each of the basis vectors is equal to for some integer . Moreover, because the vectors form a basis of it means that the matrix formed by the vectors has a full-rank.
Therefore, to complete the proof of Theorem 2 it suffices to show that for every . By Cauchy–Schwarz inequality it is actually sufficient to prove that .
3.2 Basis of Generating Family and Dual Basis
Lattice is given to us by a generating family in form of a rectangular matrix. It is much more convenient to work with a basis, especially when given by a square matrix. Therefore, we start by determining a basis of . As we have already noticed, we can assume without loss of generality that is invertible in . For every , let . The rows of the following matrix form a basis of :
In particular, this implies that the volume of is . We can determine the dual lattice of , which in the full-dimensional case is spanned by the rows of the transpose of the inverse matrix. In our case, this is:
Observe that generates the set of integral vectors such that . Or equivalently such that:
3.3 Every vector of the LLL-reduced basis is probably short
Now, let be an LLL-reduced basis of the
lattice . We denote its row vectors by
and their GSO by
.
Recall that the dual basis, given by
.
In this section, we prove the following probabilistic
property on a reduced basis:
Lemma 6.
With probability , it holds that:
Lemma 6 can be proved as a consequence of the following inequalities, which hold with overwhelming probability when the integers are drawn uniformly at random.
Claim 7.
With probability it holds that:
Proof of Lemma 6 assuming Claim 7.
Let us assume that both inequalities in Claim 7 hold. If then by repeated application of Inequality (1) we have that , which is the desired result. Hence we need to focus on the case where . Observe that by repeated application of Inequality (1) and Claim 7 we have
| Similarly, we have | ||||
| Recall that the volume of the lattice is . Hence by multiplying the above inequalities we have | ||||
| Because we have that . Hence | ||||
By rearranging the terms we have
After taking th root, this yields the desired inequality.
It remains to prove inequalities in Claim 7. We split this proof into Proposition 8 and Proposition 9. First, we focus on the right side of the inequality.
Proposition 8.
Proof.
Recall that and . Let us bound the probability of . Note that in this case, Observation 5 asserts that there exists such that
Moreover, integer is determined exactly as . Hence, for a fixed the numbers via operations are determined. This means that for a given value , the conditional probability for a fixed is:
which does not depend on . Thus the unconditional probability is as well. On the other hand, the number of vectors y such that is . Therefore by the union bound we conclude:
For the other part of the inequality in Claim 7, we need to prove that:
Proposition 9.
Proof.
Again recall that and our goal is to bound the probability that . Now, we inspect the dual lattice and the dual basis of the reduced basis. Recall that and . Therefore, we aim to bound the probability .
Because , there exists such that:
First, remark that when the length of is bounded by it holds that:
Observe that the number of of length is at most . Hence, from now on, we fix coordinates and examine the probability that the first coordinate of is bounded. In particular, when it holds that:
Note that, if the values are fixed then is determined. Hence, it holds that:
| (4) |
Recall that the numbers are selected uniformly at random from a range greater than . Hence, for a fixed s the probability that Equation 4 holds is . Therefore, by union bound we have that
3.4 Proof of Theorem 2
Proof.
By Lemma 6, with probability , for every we have:
We set . This means that for every it holds that:
The vectors are the GSO basis of and do not necessarily have integral components. We want to bound the lengths of the in the LLL-reduced basis. By definition of GSO basis, we have
The size reduction condition of LLL guarantees that . Therefore, for every it holds that:
By the Cauchy-Schwartz inequality, the fact that implies that . In particular, it means that . Therefore, by Observation 5 we can find integers such that:
for every . Note that these vectors are linearly independent because the vectors form a basis.
For the running time, observe that we need a single call to the LLL algorithm to get the basis and a linear number of arithmetic operations to retrieve the coefficients . This concludes the proof of Theorem 2.
References
- [1] Divesh Aggarwal, Antoine Joux, Miklos Santha, and Karol Węgrzycki. Polynomial time algorithms for integer programming and unbounded subset sum in the total regime, 2024. doi:10.48550/arXiv.2407.05435.
- [2] Divesh Aggarwal, Zeyong Li, and Noah Stephens-Davidowitz. A -Time Algorithm for -SVP and -Hermite SVP, and an Improved Time-Approximation Tradeoff for (H)SVP. In Advances in Cryptology - EUROCRYPT 2021 - 40th Annual International Conference on the Theory and Applications of Cryptographic Techniques, volume 12696 of Lecture Notes in Computer Science, pages 467–497. Springer, 2021. doi:10.1007/978-3-030-77870-5_17.
- [3] Jonathan Allcock, Yassine Hamoudi, Antoine Joux, Felix Klingelhöfer, and Miklos Santha. Classical and quantum algorithms for variants of subset-sum via dynamic programming. In 30th Annual European Symposium on Algorithms, ESA 2022, volume 244 of LIPIcs, pages 6:1–6:18. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2022. doi:10.4230/LIPIcs.ESA.2022.6.
- [4] Per Austrin, Petteri Kaski, Mikko Koivisto, and Jussi Määttä. Space-Time Tradeoffs for Subset Sum: An Improved Worst Case Algorithm. In Automata, Languages, and Programming - 40th International Colloquium, ICALP 2013, pages 45–56, 2013. doi:10.1007/978-3-642-39206-1_5.
- [5] Per Austrin, Petteri Kaski, Mikko Koivisto, and Jesper Nederlof. Subset Sum in the Absence of Concentration. In 32nd International Symposium on Theoretical Aspects of Computer Science, STACS 2015, pages 48–61, 2015. doi:10.4230/LIPIcs.STACS.2015.48.
- [6] Per Austrin, Petteri Kaski, Mikko Koivisto, and Jesper Nederlof. Dense Subset Sum May Be the Hardest. In 33rd Symposium on Theoretical Aspects of Computer Science, STACS 2016, pages 13:1–13:14, 2016. doi:10.4230/LIPIcs.STACS.2016.13.
- [7] Eleonore Bach, Friedrich Eisenbrand, Thomas Rothvoss, and Robert Weismantel. Forall-exist statements in pseudopolynomial time. In Proceedings of the 2025 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 2225–2233. SIAM, 2025. doi:10.1137/1.9781611978322.73.
- [8] Nikhil Bansal, Shashwat Garg, Jesper Nederlof, and Nikhil Vyas. Faster Space-Efficient Algorithms for Subset Sum, k-Sum, and Related Problems. SIAM J. Comput., 47(5):1755–1777, 2018. doi:10.1137/17M1158203.
- [9] Anja Becker, Jean-Sébastien Coron, and Antoine Joux. Improved generic algorithms for hard knapsacks. In Annual International Conference on the Theory and Applications of Cryptographic Techniques, pages 364–385. Springer, 2011. doi:10.1007/978-3-642-20465-4_21.
- [10] Anja Becker, Antoine Joux, Alexander May, and Alexander Meurer. Decoding random binary linear codes in 2 n/20: How 1+ 1= 0 improves information set decoding. In Advances in Cryptology–EUROCRYPT 2012: 31st Annual International Conference on the Theory and Applications of Cryptographic Techniques, Cambridge, UK, April 15-19, 2012. Proceedings 31, pages 520–536. Springer, 2012. doi:10.1007/978-3-642-29011-4_31.
- [11] Richard Bellman. Dynamic Programming. Princeton University Press, Princeton, NJ, USA, 1957.
- [12] Daniel J Bernstein, Stacey Jeffery, Tanja Lange, and Alexander Meurer. Quantum algorithms for the subset-sum problem. In Post-Quantum Cryptography: 5th International Workshop, PQCrypto 2013, Limoges, France, June 4-7, 2013. Proceedings 5, pages 16–33. Springer, 2013. doi:10.1007/978-3-642-38616-9_2.
- [13] Elena Böhme. Verbesserte subset-sum algorithmen. PhD thesis, Master’s thesis, Ruhr Universität Bochum, 2011.
- [14] Xavier Bonnetain, Rémi Bricout, André Schrottenloher, and Yixin Shen. Improved classical and quantum algorithms for subset-sum. In Advances in Cryptology–ASIACRYPT 2020: 26th International Conference on the Theory and Application of Cryptology and Information Security, Daejeon, South Korea, December 7–11, 2020, Proceedings, Part II 26, pages 633–666. Springer, 2020. doi:10.1007/978-3-030-64834-3_22.
- [15] Murray R Bremner. Lattice basis reduction: an introduction to the LLL algorithm and its applications. CRC Press, 2011.
- [16] Ernest F Brickell. Solving low density knapsacks. In Advances in Cryptology: Proceedings of Crypto 83, pages 25–37. Springer, 1984.
- [17] Karl Bringmann. A Near-Linear Pseudopolynomial Time Algorithm for Subset Sum. In Proceedings of the Twenty-Eighth Annual ACM-SIAM Symposium on Discrete Algorithms, pages 1073–1084. SIAM, 2017. doi:10.1137/1.9781611974782.69.
- [18] Karl Bringmann. Knapsack with small items in near-quadratic time. In Proceedings of the 56th Annual ACM Symposium on Theory of Computing, pages 259–270, 2024. doi:10.1145/3618260.3649719.
- [19] Lin Chen, Yuchen Mao, and Guochuan Zhang. Long arithmetic progressions in sumsets and subset sums: Constructive proofs and efficient witnesses. In Proceedings of the 57th Annual ACM Symposium on Theory of Computing, pages 2086–2097, 2025. doi:10.1145/3717823.3718281.
- [20] Xi Chen, Yaonan Jin, Tim Randolph, and Rocco A. Servedio. Average-case subset balancing problems. In Proceedings of the 2022 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 743–778, 2022. doi:10.1137/1.9781611977073.33.
- [21] Don Coppersmith. Finding a small root of a univariate modular equation. In Advances in Cryptology - EUROCRYPT ’96, International Conference on the Theory and Application of Cryptographic Techniques, volume 1070 of Lecture Notes in Computer Science, pages 155–165. Springer, 1996. doi:10.1007/3-540-68339-9_14.
- [22] Matthijs J Coster, Antoine Joux, Brian A LaMacchia, Andrew M Odlyzko, Claus-Peter Schnorr, and Jacques Stern. Improved low-density subset sum algorithms. Computational complexity, 2:111–128, 1992. doi:10.1007/BF01201999.
- [23] Itai Dinur, Orr Dunkelman, Nathan Keller, and Adi Shamir. Efficient Dissection of Composite Problems, with Applications to Cryptanalysis, Knapsacks, and Combinatorial Search Problems. In Advances in Cryptology - CRYPTO 2012 - 32nd Annual Cryptology Conference. Proceedings, 2012.
- [24] Alan M. Frieze. On the Lagarias-Odlyzko Algorithm for the Subset Sum Problem. SIAM J. Comput., 15(2):536–539, 1986. doi:10.1137/0215038.
- [25] Merrick L Furst and Ravi Kannan. Succinct certificates for almost all subset sum problems. SIAM Journal on Computing, 18(3):550–558, 1989. doi:10.1137/0218037.
- [26] Steven D Galbraith. Mathematics of public key cryptography. Cambridge University Press, 2012.
- [27] Nicolas Gama and Phong Q Nguyen. Finding short lattice vectors within Mordell’s inequality. In Proceedings of the fortieth annual ACM symposium on Theory of computing, pages 207–216, 2008. doi:10.1145/1374376.1374408.
- [28] Alexander Helm and Alexander May. Subset sum quantumly in . In 13th Conference on the Theory of Quantum Computation, Communication and Cryptography (TQC 2018). Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2018. doi:10.4230/LIPIcs.TQC.2018.5.
- [29] Ellis Horowitz and Sartaj Sahni. Computing Partitions with Applications to the Knapsack Problem. J. ACM, 21(2):277–292, 1974. doi:10.1145/321812.321823.
- [30] Nick Howgrave-Graham. Finding small roots of univariate modular equations revisited. In Cryptography and Coding, 6th IMA International Conference, volume 1355, pages 131–142. Springer, 1997. doi:10.1007/BFB0024458.
- [31] Nick Howgrave-Graham and Antoine Joux. New generic algorithms for hard knapsacks. In Annual International Conference on the Theory and Applications of Cryptographic Techniques, pages 235–256. Springer, 2010. doi:10.1007/978-3-642-13190-5_12.
- [32] Ce Jin. 0-1 Knapsack in nearly quadratic time. In Proceedings of the 56th Annual ACM Symposium on Theory of Computing, pages 271–282, 2024. doi:10.1145/3618260.3649618.
- [33] Antoine Joux, Hunter Kippen, and Julian Loss. A concrete analysis of wagner’s k-list algorithm over , 2024.
- [34] Antoine Joux and Jacques Stern. Improving the Critical Density of the Lagarias-Odlyzko Attack Against Subset Sum Problems. In Fundamentals of Computation Theory, 8th International Symposium, FCT ’91, volume 529, pages 258–264. Springer, 1991. doi:10.1007/3-540-54458-5_70.
- [35] Antoine Joux and Karol Wegrzycki. Improving lagarias-odlyzko algorithm for average-case subset sum: Modular arithmetic approach. CoRR, abs/2408.16108, 2024. doi:10.48550/arXiv.2408.16108.
- [36] Hans Kellerer, Ulrich Pferschy, and David Pisinger. Knapsack problems. Springer, 2004. doi:10.1007/978-3-540-24777-7.
- [37] Konstantinos Koiliaris and Chao Xu. Faster pseudopolynomial time algorithms for subset sum. ACM Transactions on Algorithms (TALG), 15(3):1–20, 2019. doi:10.1145/3329863.
- [38] J. C. Lagarias and Andrew M. Odlyzko. Solving low-density subset sum problems. J. ACM, 32(1):229–246, 1985. doi:10.1145/2455.2461.
- [39] Brian A LaMacchia. Basis reduction algorithms and subset sum problems. Technical report, Massachusetts Institute of Technology, 1991.
- [40] Arjen K Lenstra, Hendrik Willem Lenstra, and László Lovász. Factoring polynomials with rational coefficients. Mathematische annalen, 261:515–534, 1982.
- [41] Ralph C. Merkle and Martin E. Hellman. Hiding information and signatures in trapdoor knapsacks. IEEE Trans. Information Theory, 24(5):525–530, 1978. doi:10.1109/TIT.1978.1055927.
- [42] Jesper Nederlof and Karol Węgrzycki. Improving Schroeppel and Shamir’s Algorithm for Subset Sum via Orthogonal Vectors. In STOC ’21: 53rd Annual ACM SIGACT Symposium on Theory of Computing, pages 1670–1683. ACM, 2021. doi:10.1145/3406325.3451024.
- [43] Phong Q Nguyen and Brigitte Vallée. The LLL algorithm. Springer, 2010.
- [44] Andrew M Odlyzko. The rise and fall of knapsack cryptosystems. Cryptology and computational number theory, 42(2), 1990.
- [45] Adam Polak, Lars Rohwedder, and Karol Węgrzycki. Knapsack and Subset Sum with Small Items. In 48th International Colloquium on Automata, Languages, and Programming, ICALP 2021, volume 198 of LIPIcs, pages 106:1–106:19. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2021. doi:10.4230/LIPIcs.ICALP.2021.106.
- [46] Stanislaw Radziszowski and Donald Kreher. Solving subset sum problems with the algorithm. The Charles Babbage Research Centre: The Journal of Combinatorial Mathematics and Combinatorial Computing, 3, 1988.
- [47] Keegan Ryan and Nadia Heninger. Fast practical lattice reduction through iterated compression. In Advances in Cryptology – CRYPTO 2023, pages 3–36, Cham, 2023. Springer Nature Switzerland. doi:10.1007/978-3-031-38548-3_1.
- [48] Claus-Peter Schnorr. A hierarchy of polynomial time lattice basis reduction algorithms. Theoretical computer science, 53(2-3):201–224, 1987. doi:10.1016/0304-3975(87)90064-8.
- [49] Claus-Peter Schnorr and Martin Euchner. Lattice basis reduction: Improved practical algorithms and solving subset sum problems. Mathematical programming, 66:181–199, 1994. doi:10.1007/BF01581144.
- [50] Richard Schroeppel and Adi Shamir. A T=, S= Algorithm for Certain NP-Complete Problems. SIAM J. Comput., 10(3):456–464, 1981.
- [51] Andrew Shallue. An improved multi-set algorithm for the dense subset sum problem. In International Algorithmic Number Theory Symposium, pages 416–429. Springer, 2008. doi:10.1007/978-3-540-79456-1_28.
Appendix A Extension to the block reduction
In this Section, we prove Theorem 3. Note that the proof of Theorem 1 and the proof of Theorem 2 only relied on the specific lattice reduction via Lemma 6. Hence, in order to establish Theorem 3, it is enough to generalize Lemma 6 to the case of block basis reduction and prove the following statement.
Lemma 10.
Before we prove Lemma 10, let us elaborate on the block basis reduction from [27]. Here, we follow the description from the textbook [43, Chapter 2, Sliding Algorithm]. The main parameter in the block-reduction is the block size . Gama and Nguyen [27], actually parameterize their reduction with respect to the block-size. For any integer let be the Hermite constant (see Chapter 2 [43]). The blocksize of the lattice reduction of Gama and Nguyen is the smallest integer such that . Note that , so is a properly defined constant that depends on the choice of .
The block-reduction of [27] has two important properties. First, it returns a basis that is block-Mordell-reduced. The only property about block-Mordell-reduced basis we need is the following inequality:
Claim 11 (Primal-Dual inequality, Chapter 2, Lemma 11, Equality (2.48) in [43]).
Let be a block-Mordell-reduced basis of the lattice with blocksize , then:
| (5) |
where such that .
The second property of the algorithm from [27] is that its output basis is also LLL-reduced (see [43, Chapter 2, Sliding Algorithm, Algorithm 6]). As a consequence, we can also use inequality (1).
Claim 12.
For all , it holds that
| (6) |
Proof.
Note that blocks in block-reduced algorithm overlap on the indices [27]. Hence, for the sake of clarity for let to be the index of the block that is contained, i.e., . Let be the index of the first element in the th block. Similarly let when and otherwise, be the index of the last element of the block.
Because is also LLL reduced we know that that by repeated application of inequality (1), for every it holds:
| (7) |
Next, we use Equation 5, that for says:
| (8) |
Hence, by combining above we get:
| (by (7)) | ||||
| (by (8)) | ||||
| (by (7)) |
where the last inequality follows because .
Proof of Lemma 10.
The probabilistic event in Claim 7 is a function of the lattice itself and not of any specific basis of it. Thus, it remains valid for the basis produced by the block reduction algorithm. Hence, with we have that . First, consider the case .
This concludes the proof for the case as . It remains to consider the case . By repeated application of (6) we have:
Similarly:
Hence, by multiplying these two inequalities and by we conclude that:
Because we have that . Hence,
Next, we use Claim 7 with to have
After taking th root we conclude that:
Finally, observe that as this means that is a constant that depends only on , since is a constant and depends only on . Hence:
