Skip to content

Intractable Problems

Not all decidable problems are practically solvable. Some require time exponential in input size — they are intractable.


Time Complexity Classes

P (Polynomial Time)

P=k0DTIME(nk)

Problems solvable by a deterministic TM in polynomial time. These are generally considered tractable.

Examples: sorting (O(nlogn)), shortest paths, minimum spanning tree, matrix multiplication, linear programming.

NP (Nondeterministic Polynomial Time)

NP=k0NTIME(nk)

Problems solvable by a nondeterministic TM in polynomial time. Equivalently: problems whose solutions can be verified in polynomial time.

Examples: SAT, CLIQUE, Hamiltonian Cycle, Subset Sum, Graph Coloring.

The Big Question: P = NP?

PNPPSPACEEXP

Whether P=NP is the most famous open problem in computer science (one of the Clay Millennium Prize problems).


NP-Completeness

A problem L is NP-complete if:

  1. LNP
  2. For every LNP, LPL (L is polynomial-time reducible to L)

Polynomial-Time Reduction

APB: There exists a polynomial-time computable function f such that:

wAf(w)B

If B is in P and APB, then AP.
If A is NP-complete and AP, then P=NP.


Cook-Levin Theorem

Theorem: SAT (Boolean Satisfiability) is NP-complete.

This was the first problem proven NP-complete (Cook 1971, Levin 1973).

Proof Idea

Given a nondeterministic TM M and input w, construct a boolean formula ϕ that is satisfiable iff M accepts w within nk steps.

The formula encodes the TM's computation tableau:

  • Cell variables: Ti,j,s — at time i, tape cell j contains symbol s
  • State variables: Hi,j — at time i, head is at position j
  • State variables: Qi,q — at time i, TM is in state q

The formula asserts:

  1. The initial configuration is correct (input w on tape, start state)
  2. Each configuration legally follows from the previous one (transition function)
  3. At some time step, an accepting state is reached

Since the TM runs in polynomial time, the tableau is polynomial-sized, and the formula can be constructed in polynomial time.


Common NP-Complete Problems

SAT and Variants

  • SAT: Given a boolean formula, is it satisfiable?
  • 3-SAT: SAT with exactly 3 literals per clause
  • NAE-3-SAT: Not-All-Equal 3-SAT

Graph Problems

  • CLIQUE: Does G have a clique of size k?
  • Vertex Cover: Does G have a vertex cover of size k?
  • Hamiltonian Cycle: Does G have a cycle visiting every vertex exactly once?
  • TSP (Traveling Salesman): Visit all cities with total cost B
  • Graph Coloring: Can G be colored with k colors?

Number/Set Problems

  • Subset Sum: Given numbers, is there a subset summing to target t?
  • Partition: Can a set be partitioned into two equal-sum subsets?
  • Knapsack (decision version): Can we pack items with total value V under weight limit W?
  • Set Cover: Can we cover all elements with k sets?

Proving NP-Completeness

Standard Recipe

  1. Show LNP: Give a polynomial-time verifier (certificate + checking algorithm)
  2. Select a known NP-complete problem L "close" to L
  3. Construct a polynomial-time reduction f from L to L
  4. Prove correctness: xLf(x)L

Reduction Example: 3-SAT P CLIQUE

Given a 3-CNF formula ϕ=C1C2Ck, construct graph G:

  • For each literal in each clause, create a vertex
  • Connect vertices from different clauses unless they represent contradictory literals (x and x¯)
  • G has a k-clique iff ϕ is satisfiable (select one true literal per clause)

Beyond NP

PSPACE

Problems solvable using polynomial space (no time bound). NPPSPACE.

PSPACE-complete examples:

  • TQBF (True Quantified Boolean Formula)
  • Generalized Geography
  • Equivalence of regular expressions
  • Equivalence of NFA

EXP

Problems requiring exponential time. PSPACEEXP.

EXP-complete examples:

  • Generalized Chess, Checkers, Go
  • Equivalence of regular expressions with exponentiation

NEXP

Nondeterministic exponential time.

The Hierarchy

PNPPSPACEEXPNEXP

We know PEXP (by time hierarchy theorem), so at least one of the inclusions above is strict — but we don't know which one(s).


Coping with Intractability

Since many important problems are NP-complete, we need practical approaches:

1. Approximation Algorithms

Find solutions within a guaranteed factor of optimal.

  • Vertex Cover: 2-approximation (greedy matching)
  • TSP with triangle inequality: 1.5-approximation (Christofides)
  • Set Cover: lnn-approximation (greedy)

2. Fixed-Parameter Tractability (FPT)

If the "hard" parameter k is small, algorithms like O(2kn) may be practical.

  • Vertex Cover: O(1.27k+kn)
  • Parameterized complexity: FPT W[1] W[2]...

No guarantees, but often work in practice: genetic algorithms, simulated annealing, tabu search, SAT solvers (DPLL, CDCL).

4. Special Cases

Many NP-complete problems become polynomial on restricted inputs:

  • 2-SAT (P), Horn-SAT (P)
  • Graph coloring on trees (2 colors), bipartite graphs
  • TSP on a line, on a tree