<p>Let m be the logarithm of the largest number.
If <span class="math-container">$m=O(\log n)$</span> then it is solvable in polynomial time using dynamic programming.
In general, every known algorithm take at least <span class="math-container">$\Omega(2^{m})$</span> time. There is no known polynomial time algorithm when <span class="math-container">$m=\omega(\log n)$</span> and <span class="math-container">$m=o(n)$</span></p>
<p>However, Flaxman and Przydatek provide an algorithm that solves Medium-Density Subset Sum Problems in Expected Polynomial Time.</p>
<p>Check this reference:</p>
<p><a href="https://doi.org/10.1007/978-3-540-31856-9_25" rel="nofollow noreferrer">Flaxman and Przydatek, Solving Medium-Density Subset Sum Problems in Expected Polynomial Time</a></p>

CC BY-SA 2.5
2010-09-08T16:32:16.480Z
This result is only for choosing the numbers in the Subset Sum instance significantly lower than I want.  They choose the range of numbers on the order of log(n)^2 whereas I am interesting in the range of numbers on the order of 2^n.  There are well known algorithms to solve Subset Sum when the range of numbers is restricted to be so low and it looks like they've just extended this range a bit, which is great, it's just not what I was looking for.  Thank you though.
user834
CC BY-SA 4.0
2010-09-08T15:26:59.033Z
2022-10-05T09:45:36.263Z
2022-10-05T09:45:36.263Z
Mohammad Al-Turkistany
<p>Is there a way to encode an instance of Subset Sum or the Number Partition Problem so that a (small) solution to an integer relation yields an answer?  If not definitely, then in some probabilistic sense?</p>

<p>I know that LLL (and perhaps PSLQ) have been used with moderate success in solving Subset Sum problems in the 'low-density' region, where the range of numbers chosen is greater than $2^N$, but these methods don't scale well to instances of larger size and fail in the 'high-density' region, when the range of numbers chosen is much smaller than $2^N$.  Here low-density and high-density refers to the number of solutions.  The low-density region refers to the few or no solutions that exist whereas high density refers to a region with many solutions.</p>

<p>In the high density region, LLL finds (small) integer relations amongst instances given, but as instance size increases, the probability of the relation found being a viable Subset Sum or Number Partition Problem solution becomes decreasingly small.</p>

<p>Integer relation detection is polynomial to within an exponential bound of optimal whereas Subset Sum and NPP are obviously NP-Complete, so in general this is probably not possible, but if the instance is drawn uniformly at random, could this make it simpler?</p>

<p>Or should I not even be asking this question and instead be asking if there is a way to reduce the exponential bound from the optimal answer in lieu of an exponential increase in computation?</p>

CC BY-SA 2.5
2010-09-08T16:33:53.823Z
I wasn't getting any answers so I've cross posted to mathoverflow: http://mathoverflow.net/questions/38063/integer-relation-detection-for-subset-sum-or-npp
user834
CC BY-SA 2.5
2010-09-08T23:07:51.097Z
This is a very interesting question, I'm also waiting for answers. You are basically asking for a polynomial-time reduction (maybe random) from Subset sum or NPP to integer relation. How about this, if $t=0$ is the target of your subset sum problem, and $S$ is a set of positive integers, with $S'$ a solution satisfying $0=\sum_{a\in S'} a$. This is exactly a linear combination with real coefficients equal to 1. If for each $a_i \in S$ you have that $\sum_i a_i < 2^n-1$ there is always a solution, and the mapping to integer relation will also give you a solution.
Marcos Villagra
CC BY-SA 2.5
2010-09-13T12:35:37.143Z
@Marcos Villagra: your comment is a little hard to parse...one can embed the problem as a subset sum/number partition problem into a lattice (see [here](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.57.3331&rep=rep1&type=ps) for a review), the question is finding a way to restrict coefficients to the desired set (0,1 or -1,1, say).  LLL will find an integer relation, even a small one, but just one 2 or 3 as a coefficient will invalidate it as a subset sum/number partition answer.
user834
<cc.complexity-theory><np-hardness><approximation-algorithms><reductions><subset-sum>
Integer relation detection for Subset Sum or NPP?
user834
# Integer relation detection for Subset Sum or NPP?

(Asked by: username_0 on 2010-09-07)

Is there a way to encode an instance of Subset Sum or the Number Partition Problem so that a (small) solution to an integer relation yields an answer? If not definitely, then in some probabilistic sense?

I know that LLL (and perhaps PSLQ) have been used with moderate success in solving Subset Sum problems in the 'low-density' region, where the range of numbers chosen is greater than $2^N$, but these methods don't scale well to instances of larger size and fail in the 'high-density' region, when the range of numbers chosen is much smaller than $2^N$. Here low-density and high-density refers to the number of solutions. The low-density region refers to the few or no solutions that exist whereas high density refers to a region with many solutions.

In the high density region, LLL finds (small) integer relations amongst instances given, but as instance size increases, the probability of the relation found being a viable Subset Sum or Number Partition Problem solution becomes decreasingly small.

Integer relation detection is polynomial to within an exponential bound of optimal whereas Subset Sum and NPP are obviously NP-Complete, so in general this is probably not possible, but if the instance is drawn uniformly at random, could this make it simpler?

Or should I not even be asking this question and instead be asking if there is a way to reduce the exponential bound from the optimal answer in lieu of an exponential increase in computation?

**Tags:** cc.complexity-theory, np-hardness, approximation-algorithms, reductions, subset-sum

> **Comments:**
> **username_0**: I wasn't getting any answers so I've cross posted to mathoverflow: http://mathoverflow.net/questions/38063/integer-relation-detection-for-subset-sum-or-npp  
> **username_1**: This is a very interesting question, I'm also waiting for answers. You are basically asking for a polynomial-time reduction (maybe random) from Subset sum or NPP to integer relation. How about this, if $t=0$ is the target of your subset sum problem, and $S$ is a set of positive integers, with $S'$ a solution satisfying $0=\sum_{a\in S'} a$. This is exactly a linear combination with real coefficients equal to 1. If for each $a_i \in S$ you have that $\sum_i a_i < 2^n-1$ there is always a solution, and the mapping to integer relation will also give you a solution.  
> **username_0**: @username_1: your comment is a little hard to parse...one can embed the problem as a subset sum/number partition problem into a lattice (see [here](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.57.3331&rep=rep1&type=ps) for a review), the question is finding a way to restrict coefficients to the desired set (0,1 or -1,1, say).  LLL will find an integer relation, even a small one, but just one 2 or 3 as a coefficient will invalidate it as a subset sum/number partition answer.  

---

## 1 answers

### Answer by username_2 on 2010-09-08. Score: 2

Let m be the logarithm of the largest number.
If $m=O(\log n)$ then it is solvable in polynomial time using dynamic programming.
In general, every known algorithm take at least $\Omega(2^{m})$ time. There is no known polynomial time algorithm when $m=\omega(\log n)$ and $m=o(n)$

However, Flaxman and Przydatek provide an algorithm that solves Medium-Density Subset Sum Problems in Expected Polynomial Time.

Check this reference:

[Flaxman and Przydatek, Solving Medium-Density Subset Sum Problems in Expected Polynomial Time](https://doi.org/10.1007/978-3-540-31856-9_25)

> **Comments:**
> **username_0**: This result is only for choosing the numbers in the Subset Sum instance significantly lower than I want.  They choose the range of numbers on the order of log(n)^2 whereas I am interesting in the range of numbers on the order of 2^n.  There are well known algorithms to solve Subset Sum when the range of numbers is restricted to be so low and it looks like they've just extended this range a bit, which is great, it's just not what I was looking for.  Thank you though.  

---

