The Exponential Time Hypothesis and SETH
P NP says that 3-SAT has no polynomial algorithm. It says nothing about how exponential the best algorithm must be: and 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
For , let be the number of variables of a -CNF formula and define
Brute force over all assignments shows . Since a -CNF formula is also a -CNF formula, , so exists.
Exponential Time Hypothesis (ETH). : there is a such that 3-SAT cannot be solved in time .
Strong Exponential Time Hypothesis (SETH). : for every there is a such that -SAT cannot be solved in time .
SETH implies ETH (Impagliazzo and Paturi, 2001; stated): if were 0, the sequence could not climb to 1. Both are hypotheses, much stronger than P 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
Algorithms for -SAT do beat brute force, but by less and less as grows:
- Branching. Pick a clause and try true; false and true; false and true. The branching vector gives 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 , about for .
- PPZ and PPSZ. Paturi, Pudlák, Saks and Zane (2005) give for 3-SAT with a unique satisfying assignment and, for general , a bound of the form ; Hertli (2011) showed that the bound holds for all of 3-SAT, and later work lowered the base slightly (Hansen, Kaplan, Zamir and Zwick, 2019).
So and for a constant . Every known algorithm has the form , which is why SETH is plausible: the savings vanish as clauses get longer. The program prints the bases of these algorithms as grows.
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 grows: is bounded away from 1 for each , 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 clauses (near the satisfiability threshold, where random instances are hardest), next to the assignments of brute force and the bound.
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 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.
#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 , the number of variables. A 3-CNF formula can have up to clauses, and reductions usually produce instances whose size depends on the number of clauses . The sparsification lemma closes this gap.
Sparsification lemma (Impagliazzo, Paturi and Zane, 2001; stated). For every and there is a constant such that every -CNF formula on variables can be written as the disjunction of at most -CNF formulas , each on the same variables and with at most clauses, and they can be listed in time .
Corollary. Under ETH, 3-SAT has no algorithm. If it had, apply it to each sparse , where : the total time would beat for any , after choosing small.
This is the form used in practice: a reduction from 3-SAT with variables and clauses to a problem of size transfers the lower bound , as the next lesson shows for vertex cover, clique and many others.
Test yourself
What does the Exponential Time Hypothesis state?
- P NP
- There is a such that 3-SAT on variables cannot be solved in time
- 3-SAT needs time
- Every NP problem needs exponential time
What does SETH say?
- For every there is a such that -SAT has no algorithm
- CNF-SAT is in P
- ETH is false
Why is the sparsification lemma needed?
- To make formulas satisfiable
- Because reductions produce instances whose size depends on the number of clauses, and sparsification shows ETH also rules out algorithms
- To prove SETH
- To convert -SAT into 2-SAT
What is the branching vector of the clause-branching algorithm for 3-SAT, and its base?
- , base 3
- , base about 1.8393
- , base 2
- , base 1.44