2

The quickest algorithm for solving subset sum currently is $2^{n/2}$ (via Wiki). Why doesn't this violate the Exponential Time Hypothesis which states that “there is no family of algorithms that can solve 3-SAT in $2^{o(n)}$ time.”

Couldn't a 3-SAT problem be translated to a subset sum problem in polynomial time and then solved in $2^{n/2}$ time. What am I missing here?

Kyle Jones
  • 8,091
  • 2
  • 29
  • 51
C Shreve
  • 471
  • 4
  • 8

1 Answers1

3

Given a 3SAT problem of size $n$, you can convert that to a subset sum problem of size $n^2$ (roughly). Now you can apply the algorithm for subset sum to solve the subset sum in time $2^{n^2/2}$ (roughly). Remember, the running time depends on the size (length) of the input, and here the size of the input will be $n^2$, yielding the $2^{n^2/2}$ figure.

That will give you an algorithm for solving a 3SAT problem of size $n$ in $2^{n^2/2}$ time (roughly). But that's much worse than the naive algorithm, which takes $2^n$ time: $2^n$ is much smaller than $2^{n^2/2}$. So this reduction does not contradict the exponential time hypothesis: it doesn't give you a way to solve 3SAT faster than $2^n$ time.

D.W.
  • 159,275
  • 20
  • 227
  • 470
  • Ok. I buy that - transformation from 3SAT to SUBSET SUM yields n^2 and the result would be 2^(n^2/2). But the Exponential Time Hypothesis also says that any NP-complete problem cannot be solved in subexponential time. I guess 2^N/2 is not considered subexponential? – C Shreve Jun 23 '16 at 21:48
  • 1
    @CShreve, the ETH doesn't say that. Read it again. $2^{n/2}$ time is not subexponential. ETH talks about SAT, not all NP-complete problems, and it talks about $2^{o(n)}$, and $n/2$ is not $o(n)$. See https://en.wikipedia.org/wiki/Exponential_time_hypothesis, http://cs.stackexchange.com/q/9813/755. Please don't use the comments to ask follow-up questions or for extended discussion. – D.W. Jun 23 '16 at 22:03
  • @D.W. So is there a $poly(2^{\sqrt n})$ time algorithm for subset sum? It wont violate ETH right? – VS. Feb 06 '20 at 16:34