Home › Exponential Growth › Lesson 11

Exponential and Subexponential Complexity

Lesson 11 of 12

Key idea of this section

P ⊊ EXP;   between them lie quasi-polynomial n(log n)c and subexponential 2o(n) running times

In computer science, the dividing line between feasible and infeasible computation is drawn, as a first approximation, between polynomial and exponential running time. The reason is the hierarchy of Lesson 4 together with a scaling argument: if hardware becomes faster by a factor of 2, an algorithm with running time nᵏ can solve instances 21/k times larger in the same time, whereas an algorithm with running time 2ⁿ gains only one unit of input size.

Exponential recursions

Recurrences that reduce the problem size by subtraction typically yield exponential growth; those that reduce it by division typically yield polynomial growth. The Tower of Hanoi with n discs requires T(n) = 2T(n − 1) + 1 moves, with T(1) = 1; adding 1 gives T(n) + 1 = 2(T(n − 1) + 1), so T(n) = 2ⁿ − 1, and a simple argument (the largest disc must move at least once, and before its first move all other discs must be stacked on the third peg, and after its last move they must all be moved back onto it, so T(n) ≥ 2T(n − 1) + 1) shows that no algorithm uses fewer moves. Computing the Fibonacci number Fₙ by the naive recursion makes C(n) = C(n − 1) + C(n − 2) + 1 calls, with C(0) = C(1) = 1; then C(n) + 1 satisfies the Fibonacci recurrence, and C(n) = 2Fₙ₊₁ − 1 ~ (2/√5) φn+1. Storing computed values reduces this to a linear number of additions, and the identity (Fₙ₊₁, Fₙ; Fₙ, Fₙ₋₁) = (1, 1; 1, 0)ⁿ together with repeated squaring reduces it to O(log n) matrix multiplications.

By contrast, divide-and-conquer recurrences T(n) = aT(n/b) + Θ(nᵈ) have polynomial solutions by the master theorem: Θ(nᵈ) if d > logb a, Θ(nᵈ log n) if d = logb a, and Θ(nlogb a) if d < logb a. Mergesort, T(n) = 2T(n/2) + Θ(n), is Θ(n log n).

The classes P and EXP

Let P be the class of decision problems solvable by a deterministic Turing machine in time O(nᵏ) for some k, and EXP the class solvable in time O(2nᵏ) for some k. The time hierarchy theorem (Hartmanis and Stearns 1965; in this form Hennie and Stearns 1966) states that for time-constructible functions with f(n) log f(n) = o(g(n)), DTIME(f) ⊊ DTIME(g); it is proved by diagonalization, and it implies P ⊊ EXP. Thus there are decidable problems that provably require exponential time; generalized chess and Go on n × n boards (with suitable rules) are EXP-complete. The famous open problems, P versus NP and NP versus EXP, concern classes that lie between: P ⊆ NP ⊆ PSPACE ⊆ EXP, and at least one of these inclusions is strict.

Exhaustive search for satisfiability of a Boolean formula in n variables takes 2ⁿ · poly(n) time. Much better exponential bases are known for restricted versions: randomized algorithms for 3-SAT in time about 1.307ⁿ descend from the PPSZ algorithm of Paturi, Pudlák, Saks and Zane. Whether the base can be pushed down to 1 + ε for every ε is the content of the Exponential Time Hypothesis (Impagliazzo and Paturi 2001), which asserts that 3-SAT cannot be solved in time 2o(n); it is a stronger assumption than P ≠ NP, and many fine-grained lower bounds are conditional on it. Exponents can also be halved by meet-in-the-middle: subset sum on n numbers can be solved in O(2n/2 · n) time by splitting the set in two and sorting the 2n/2 partial sums of each half (Horowitz and Sahni 1974).

Between polynomial and exponential

A function is subexponential if it is 2o(n). Number theory supplies the canonical examples through the L-notation

Ln[α, c] = exp( (c + o(1)) (ln n)α (ln ln n)1−α ),   0 ≤ α ≤ 1,

which interpolates between polynomial in ln n (α = 0) and polynomial in n (α = 1). The quadratic sieve factors an integer n in time Ln[1/2, 1] and the general number field sieve, the fastest known classical method for numbers of cryptographic size, in heuristic time Ln[1/3, (64/9)1/3], with (64/9)1/3 ≈ 1.923. Since the input size is the number of digits, log n, these running times are subexponential but superpolynomial in the input size. Shor's algorithm (1994) factors in polynomial time on a quantum computer.

Quasi-polynomial time, 2(log n)c, sits just above polynomial time. In 2015 László Babai announced an algorithm deciding graph isomorphism in quasi-polynomial time, the largest advance on that problem in decades.

Exponential lower bounds in restricted models

Where unconditional exponential lower bounds are known, they concern restricted models of computation. Haken (1985) proved that every resolution refutation of the pigeonhole principle (n + 1 pigeons, n holes) has size exponential in n, and Razborov (1985) proved superpolynomial (later exponential, by Alon and Boppana) lower bounds for monotone circuits computing the clique function. Proving such bounds for general circuits would separate P from NP.

Exercise

  • (a)
    Solve T(n) = 3T(n − 1) + 2 with T(0) = 0.
  • (b)
    An algorithm of running time 1.5ⁿ handles n = 60 in one hour. What size does it handle in one hour on a machine 1000 times faster?
  • (c)
    Apply the master theorem to T(n) = 8T(n/2) + n².
Show solution

Answers: (a) T(n) + 1 = 3(T(n − 1) + 1) and T(0) + 1 = 1, so T(n) = 3ⁿ − 1. (b) 1.5n − 60 = 1000 gives n − 60 = ln 1000/ln 1.5 ≈ 17.04, so n ≈ 77. (c) log₂ 8 = 3 > 2, so T(n) = Θ(n³).

V.3.1