TExcelTAD
Home › Parameterized & Fine-Grained Complexity › The Exponential Time Hypothesis and SETH

The Exponential Time Hypothesis and SETH

P ≠\ne NP says that 3-SAT has no polynomial algorithm. It says nothing about how exponential the best algorithm must be: 2n2^{\sqrt{n}} and 2n/log⁡n2^{n / \log n} are both superpolynomial. Lower bounds that are precise about the exponent need a stronger, quantitative assumption. Impagliazzo and Paturi (2001) proposed two, and together with the sparsification lemma of Impagliazzo, Paturi and Zane (2001) they became the base of almost every tight conditional lower bound in this course.

The constants sks_k

For k≥3k \ge 3, let nn be the number of variables of a kk-CNF formula and define

sk=inf⁡{δ≥0:k-SAT can be solved in time O(2δn)}.s_k = \inf \{ \delta \ge 0 : k\text{-SAT can be solved in time } O(2^{\delta n}) \}.

Brute force over all assignments shows sk≤1s_k \le 1. Since a kk-CNF formula is also a (k+1)(k+1)-CNF formula, s3≤s4≤s5≤⋯s_3 \le s_4 \le s_5 \le \cdots, so s∞=lim⁡k→∞sks_\infty = \lim_{k \to \infty} s_k exists.

Exponential Time Hypothesis (ETH). s3>0s_3 > 0: there is a δ>0\delta > 0 such that 3-SAT cannot be solved in time O(2δn)O(2^{\delta n}).

Strong Exponential Time Hypothesis (SETH). s∞=1s_\infty = 1: for every ε>0\varepsilon > 0 there is a kk such that kk-SAT cannot be solved in time O(2(1−ε)n)O(2^{(1 - \varepsilon) n}).

SETH implies ETH (Impagliazzo and Paturi, 2001; stated): if s3s_3 were 0, the sequence sks_k could not climb to 1. Both are hypotheses, much stronger than P ≠\ne NP. ETH is widely believed. SETH is believed by many but doubted by some, since it rules out any substantial speedup over brute force for CNF-SAT with long clauses; the course states every SETH-based result as conditional on it.

What is known about sks_k

Algorithms for kk-SAT do beat brute force, but by less and less as kk grows:

  • Branching. Pick a clause (ℓ1∨ℓ2∨ℓ3)(\ell_1 \lor \ell_2 \lor \ell_3) and try ℓ1\ell_1 true; ℓ1\ell_1 false and ℓ2\ell_2 true; ℓ1,ℓ2\ell_1, \ell_2 false and ℓ3\ell_3 true. The branching vector (1,2,3)(1, 2, 3) gives O(1.8393n)O(1.8393^n) for 3-SAT (Monien and Speckenmeyer, 1985), using the arithmetic of Branching Vectors and a Faster Vertex Cover.
  • Random walks. Schöning's algorithm (Schöning's Random Walk for 3-SAT) runs in time O∗((2(k−1)k)n)O^*\left(\left(\frac{2(k-1)}{k}\right)^n\right), about 1.334n1.334^n for k=3k = 3.
  • PPZ and PPSZ. Paturi, Pudlák, Saks and Zane (2005) give O∗(1.308n)O^*(1.308^n) for 3-SAT with a unique satisfying assignment and, for general kk, a bound of the form 2(1−Θ(1/k))n2^{(1 - \Theta(1/k)) n}; Hertli (2011) showed that the 1.308n1.308^n bound holds for all of 3-SAT, and later work lowered the base slightly (Hansen, Kaplan, Zamir and Zwick, 2019).

So s3≤0.39s_3 \le 0.39 and sk≤1−cks_k \le 1 - \frac{c}{k} for a constant c>0c > 0. Every known algorithm has the form 2(1−Θ(1/k))n2^{(1 - \Theta(1/k))n}, which is why SETH is plausible: the savings vanish as clauses get longer. The program prints the bases of these algorithms as kk grows.

python · try it yourself
import math

def branching_base(k):                       # vector (1, 2, ..., k)
    lo, hi = 1.0, 2.0
    for _ in range(100):
        mid = (lo + hi) / 2
        if sum(mid ** -t for t in range(1, k + 1)) > 1:
            lo = mid
        else:
            hi = mid
    return hi

print(" k   clause branching   Schoening 2(k-1)/k   Schoening delta = log2")
for k in [3, 4, 5, 6, 8, 12, 20]:
    b, s = branching_base(k), 2 * (k - 1) / k
    print(f"{k:2} {b:18.4f} {s:20.4f} {math.log2(s):22.4f}")
 k   clause branching   Schoening 2(k-1)/k   Schoening delta = log2
 3             1.8393               1.3333                 0.4150
 4             1.9276               1.5000                 0.5850
 5             1.9659               1.6000                 0.6781
 6             1.9836               1.6667                 0.7370
 8             1.9960               1.7500                 0.8074
12             1.9998               1.8333                 0.8745
20             2.0000               1.9000                 0.9260

Both bases approach 2 as kk grows: sks_k is bounded away from 1 for each kk, but the known algorithms give no uniform bound below 1, exactly the gap SETH says cannot be closed.

Measuring a search tree

The clause-branching algorithm in action, with the number of search-tree nodes on random 3-CNF formulas with 4.26n4.26n clauses (near the satisfiability threshold, where random instances are hardest), next to the 2n2^n assignments of brute force and the 1.8393n1.8393^n bound.

python · try it yourself
import random

def random_3cnf(n, m, rng):
    return [tuple(rng.choice([1, -1]) * v for v in rng.sample(range(1, n + 1), 3)) for _ in range(m)]

def simplify(clauses, lit):
    out = []
    for c in clauses:
        if lit in c:
            continue
        c2 = tuple(x for x in c if x != -lit)
        if not c2:
            return None
        out.append(c2)
    return out

def solve(clauses, st):
    st[0] += 1
    if clauses is None:
        return False
    if not clauses:
        return True
    c = min(clauses, key=len)                  # a shortest clause
    fixed = []
    for lit in c:                              # l1; not l1 and l2; not l1, not l2 and l3
        cur = clauses
        for f in fixed:
            cur = cur and simplify(cur, -f)
        cur = cur and simplify(cur, lit)
        if cur is not None and solve(cur, st):
            return True
        fixed.append(lit)
    return False

rng = random.Random(5)
print("  n    m  satisfiable  tree nodes  2^n      1.8393^n")
for n in [10, 14, 18, 22]:
    F = random_3cnf(n, round(4.26 * n), rng)
    st = [0]
    sat = solve(F, st)
    print(f"{n:3} {len(F):4}  {sat!s:11} {st[0]:10} {2 ** n:8} {1.8393 ** n:10.0f}")
  n    m  satisfiable  tree nodes  2^n      1.8393^n
 10   43  False               24     1024        443
 14   60  True                15    16384       5071
 18   77  True                22   262144      58043
 22   94  True                57  4194304     664288

The search tree is far below both bounds: real formulas give unit clauses and short clauses quickly. The bound is a worst case over all formulas; ETH says that some formulas force 2Ω(n)2^{\Omega(n)} work from every algorithm.

In C++

The same clause-branching solver with clauses as vectors and an assignment array; it counts nodes on a random 3-CNF formula with 40 variables.

cpp · try it yourself
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <vector>

int n;
std::vector<std::vector<int>> F;
std::vector<int> val;                         // 0 unassigned, 1 true, -1 false
long nodes = 0;

int lit_value(int l) { int v = val[std::abs(l)]; return l > 0 ? v : -v; }

bool solve() {
    nodes++;
    const std::vector<int>* best = nullptr;
    int best_free = 4;
    for (auto& c : F) {
        int free_lits = 0;
        bool sat = false;
        for (int l : c) { int x = lit_value(l); if (x == 1) sat = true; else if (x == 0) free_lits++; }
        if (sat) continue;
        if (free_lits == 0) return false;     // falsified clause
        if (free_lits < best_free) { best_free = free_lits; best = &c; }
    }
    if (!best) return true;                   // all clauses satisfied
    std::vector<int> free_l;
    for (int l : *best) if (lit_value(l) == 0) free_l.push_back(l);
    for (size_t i = 0; i < free_l.size(); i++) {
        for (size_t j = 0; j < i; j++) val[std::abs(free_l[j])] = free_l[j] > 0 ? -1 : 1;
        val[std::abs(free_l[i])] = free_l[i] > 0 ? 1 : -1;
        if (solve()) return true;
        for (size_t j = 0; j <= i; j++) val[std::abs(free_l[j])] = 0;
    }
    return false;
}

int main() {
    n = 40;
    unsigned s = 77;
    auto rnd = [&](int m) { s = s * 1103515245u + 12345u; return int((s >> 8) % m); };
    int m = 170;
    for (int i = 0; i < m; i++) {
        std::vector<int> c;
        while (c.size() < 3) {
            int v = 1 + rnd(n);
            bool dup = false;
            for (int l : c) if (std::abs(l) == v) dup = true;
            if (!dup) c.push_back(rnd(2) ? v : -v);
        }
        F.push_back(c);
    }
    val.assign(n + 1, 0);
    bool sat = solve();
    std::printf("n = %d, m = %d: %s, %ld search-tree nodes (2^n = %.2e, 1.8393^n = %.2e)\n",
                n, m, sat ? "satisfiable" : "unsatisfiable", nodes, std::pow(2.0, n), std::pow(1.8393, n));
}
n = 40, m = 170: satisfiable, 281 search-tree nodes (2^n = 1.10e+12, 1.8393^n = 3.86e+10)

Sparsification

ETH is stated in terms of nn, the number of variables. A 3-CNF formula can have up to Θ(n3)\Theta(n^3) clauses, and reductions usually produce instances whose size depends on the number of clauses mm. The sparsification lemma closes this gap.

Sparsification lemma (Impagliazzo, Paturi and Zane, 2001; stated). For every kk and ε>0\varepsilon > 0 there is a constant CC such that every kk-CNF formula φ\varphi on nn variables can be written as the disjunction of at most 2εn2^{\varepsilon n} kk-CNF formulas ψi\psi_i, each on the same variables and with at most CnC n clauses, and they can be listed in time 2εn⋅nO(1)2^{\varepsilon n} \cdot n^{O(1)}.

Corollary. Under ETH, 3-SAT has no 2o(n+m)2^{o(n + m)} algorithm. If it had, apply it to each sparse ψi\psi_i, where m=O(n)m = O(n): the total time 2εn⋅2o(n)2^{\varepsilon n} \cdot 2^{o(n)} would beat 2δn2^{\delta n} for any δ\delta, after choosing ε\varepsilon small.

This is the form used in practice: a reduction from 3-SAT with nn variables and m=O(n)m = O(n) clauses to a problem of size N=O(n+m)N = O(n + m) transfers the lower bound 2o(N)2^{o(N)}, as the next lesson shows for vertex cover, clique and many others.

Test yourself

What does the Exponential Time Hypothesis state?

  1. P ≠\ne NP
  2. There is a δ>0\delta > 0 such that 3-SAT on nn variables cannot be solved in time O(2δn)O(2^{\delta n})
  3. 3-SAT needs time 2n2^n
  4. Every NP problem needs exponential time

What does SETH say?

  1. s3=1s_3 = 1
  2. For every ε>0\varepsilon > 0 there is a kk such that kk-SAT has no O(2(1−ε)n)O(2^{(1-\varepsilon)n}) algorithm
  3. CNF-SAT is in P
  4. ETH is false

Why is the sparsification lemma needed?

  1. To make formulas satisfiable
  2. Because reductions produce instances whose size depends on the number of clauses, and sparsification shows ETH also rules out 2o(n+m)2^{o(n + m)} algorithms
  3. To prove SETH
  4. To convert kk-SAT into 2-SAT

What is the branching vector of the clause-branching algorithm for 3-SAT, and its base?

  1. (1,1,1)(1, 1, 1), base 3
  2. (1,2,3)(1, 2, 3), base about 1.8393
  3. (1,1)(1, 1), base 2
  4. (2,2,2)(2, 2, 2), base 1.44