I. Foundations of Computational Intractability
Computational complexity classifies problems by the resources required to solve them as input size grows. Intractability usually means that no polynomial-time algorithm is known and that strong complexity-theoretic evidence suggests none exists.
A. Governing Concepts and Conventions
The study of NP-hardness and NP-completeness depends on decision problems, efficient verification, and polynomial-time transformations.
- Problem instance: A particular input to a computational problem; its size is denoted by , measured in symbols or bits.
- Decision problem: A problem whose answer is either “yes” or “no,” such as whether a graph contains a clique of size at least .
- Class : The set of decision problems solvable by a deterministic algorithm in polynomial time.
T(n) = O(n^c)- is running time.
- is input size.
- is a fixed constant independent of .
- Class : The set of decision problems whose “yes” instances have certificates verifiable in polynomial time by a deterministic algorithm.
- For Hamiltonian Cycle, a certificate is an ordering of all vertices.
- Verification checks each required edge and confirms that every vertex occurs once.
- Equivalent view of : These are problems solvable in polynomial time by a nondeterministic Turing machine.
- Central unresolved question: Whether . Since , the issue is whether efficient verification always implies efficient solution.
- Intractability qualification: NP-completeness does not prove that a problem requires exponential time; it shows that a polynomial-time solution would imply polynomial-time solutions for every problem in .
- Input encoding: Complexity depends on representation. An integer requires bits in binary, so a running time polynomial in may be exponential in the actual input length.
II. NP-Hard Problems — At Least as Hard as Every Problem in NP
A. Definition and Classification
A problem is NP-hard if every problem in can be transformed into using a polynomial-time reduction.
- Formal condition: is NP-hard when
For every L in NP, L <=p H- is any decision problem in .
- denotes polynomial-time many-one reducibility.
- need not itself belong to .
- Scope: NP-hard problems may be decision, search, or optimization problems; some can even be undecidable.
- Relationship to NP-completeness: Every NP-complete problem is NP-hard, but an NP-hard problem is NP-complete only if it is also a decision problem in .
- Consequence: If any NP-hard problem has a polynomial-time algorithm, then every problem in can be solved in polynomial time and .
B. Examples of NP-hard problems
NP-hard examples commonly occur as optimization versions of NP-complete decision problems.
- Travelling Salesperson optimization problem: Given weighted cities, find a minimum-cost tour visiting each city exactly once and returning to the start.
- Its decision version asks whether a tour of cost at most exists and is NP-complete.
- An optimization solver would answer the decision version by comparing the optimal cost with , so optimization is NP-hard.
- Minimum graph coloring: Determine the chromatic number , the smallest number of colors needed so adjacent vertices receive different colors.
- The related decision problem asks whether .
- Computing exactly is NP-hard.
- Knapsack optimization: Select items to maximize total value without exceeding capacity .
maximize sum(v_i x_i)
subject to sum(w_i x_i) <= W
x_i in {0,1}- and are the value and weight of item .
- means item is selected.
- Exact optimization is NP-hard, while the corresponding decision form is NP-complete.
- Job-shop scheduling optimization: Minimize completion time while respecting machine and operation-order constraints; exact general formulations are NP-hard.
- Halting problem: Determining whether an arbitrary program halts is undecidable and can be classified as NP-hard under suitable polynomial reductions.
- It is not NP-complete because it is not decidable and therefore is not in .
C. Practical Significance and Limitations
NP-hardness directs algorithm design toward methods other than universally efficient exact computation.
- Restricted instances: A hard general problem may become polynomial-time solvable on trees, bounded-degree graphs, fixed dimensions, or other special structures.
- Approximation: An approximation algorithm sacrifices optimality for a provable quality bound; metric TSP, for example, admits constant-factor approximation.
- Parameterized algorithms: Running time such as isolates exponential growth in a parameter , rather than in the full input size.
- Heuristics: Greedy search, local search, and branch-and-bound can perform well in practice but may lack polynomial worst-case guarantees.
- Pseudo-polynomial behavior: The dynamic program for integer knapsack runs in , polynomial in capacity but not in its binary length .
III. NP-Complete Problems — The Hardest Decision Problems in NP
A. Definition and Proof Requirements
A decision problem is NP-complete precisely when it is both in and NP-hard.
- Membership requirement: Show by specifying a polynomial-size certificate and a polynomial-time verifier.
- Hardness requirement: Show that a known NP-complete problem satisfies .
- Direction rule: To prove a new problem hard, reduce the known hard problem to the new problem, not the reverse.
- Polynomial implication: If for any NP-complete , then ; if , no NP-complete problem belongs to .
B. Examples of NP-complete problems
Canonical NP-complete problems represent logic, graphs, sets, numbers, routes, and schedules.
- Boolean Satisfiability (SAT): Decide whether a Boolean formula has an assignment making it true.
- A certificate lists truth values for all variables.
- The verifier evaluates the formula in time polynomial in its length.
- 3-SAT: Decide satisfiability when the formula is a conjunction of clauses containing exactly three literals, such as
(x OR not y OR z) AND (not x OR y OR w)- are Boolean variables.
- A literal is a variable or its negation.
- CLIQUE: Given and integer , decide whether contains vertices that are pairwise adjacent.
- VERTEX COVER: Given and , decide whether at most vertices touch every edge.
- A set is a vertex cover if every has or .
- Hamiltonian Cycle: Decide whether a graph contains a cycle visiting every vertex exactly once.
- SUBSET SUM: Given integers and target , decide whether some subset sums exactly to .
- TSP decision problem: Given a weighted graph and bound , decide whether a tour of total weight at most exists.
- Distinguishing feature: Each listed decision problem has efficiently verifiable “yes” certificates, unlike an unrestricted optimization output or an undecidable problem.
C. Complementary Complexity
NP-completeness concerns efficiently verifiable “yes” answers, while complementary classes clarify the status of “no” answers.
- Class : A language belongs to when its complement belongs to .
- Example: TAUTOLOGY asks whether a Boolean formula is true under every assignment and is -complete.
- Open relationship: Whether is unknown; would imply .
- Logical caution: Failure to find a certificate for “yes” does not itself provide a polynomially verifiable certificate for “no.”
IV. Cook’s Theorem — The Foundation of NP-Completeness
A. Formal Statement and Conditions
Cook’s theorem, independently established in closely related form by Stephen Cook and Leonid Levin, states that Boolean satisfiability is NP-complete.
- Membership: SAT belongs to because a truth assignment is a certificate that can be checked by evaluating the formula.
- Hardness: For every language , there is a polynomial-time transformation such that
x in L if and only if f(x) is satisfiable- is an input instance.
- is a Boolean formula.
- The formula’s size is polynomial in .
B. Cook's theorem
The theorem encodes a polynomial-time nondeterministic computation as a satisfiable Boolean formula.
- Computation tableau: Arrange the machine’s configurations by time step, recording state, tape symbols, and head position.
- Boolean variables: Variables state which symbol, state, or head location occupies each tableau cell at each time.
- Constraint groups:
- Initial constraints: Encode the input and starting configuration.
- Uniqueness constraints: Ensure each cell has one symbol and the machine has one state and head position.
- Transition constraints: Enforce the Turing machine’s legal local transition rules.
- Acceptance constraint: Require an accepting state within the polynomial time bound.
- Correctness: The formula is satisfiable exactly when an accepting computation exists.
- Polynomial size: A polynomial-time machine has only polynomially many time steps and relevant tape cells, so the tableau and formula remain polynomial in input length.
- Historical significance: Cook’s theorem supplied the first NP-complete problem, enabling later hardness proofs through chains of reductions rather than fresh machine encodings.
V. Polynomial-Time Reduction — Transferring Computational Difficulty
A. Purpose and Principle
A reduction converts instances of one problem into instances of another while preserving answers and using only polynomial time.
- Definition: if a polynomial-time computable function satisfies
x in A if and only if f(x) in B- is the source problem.
- is the target problem.
- maps each instance while preserving “yes” and “no.”
B. Problem reduction
Problem reduction establishes hardness by showing that solving the target would also solve an already hard source problem.
- Reduction algorithm:
SolveA(x):
y = f(x)
return SolveB(y)- is an instance of .
- is the corresponding instance of .
- If both steps are polynomial, then a polynomial algorithm for gives one for .
- Transitivity: If and , then .
- Hardness proof pattern:
- Choose a known NP-complete problem .
- Construct a polynomial transformation from to candidate .
- Prove both directions of answer preservation.
- Prove that construction time and output size are polynomial.
- Separately prove if NP-completeness, rather than only NP-hardness, is required.
- Concrete reduction: CLIQUE reduces to VERTEX COVER using graph complementation. A graph has a clique of size exactly when its complement has a vertex cover of size .
- Common error: Showing demonstrates that is no harder than ; it does not establish that inherits ’s hardness.
Nearly through. Did unit 14 of ECAP538 save you a night before the exam?
LPU Notes is free. A student pays for the servers.
Did unit 14 of ECAP538 save you a night before the exam?
Then you can help keep it free for the next batch. Ads cover part of the server bill; the rest comes out of a student's own pocket: the domain, the storage, and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason. to try again.
Nothing here is ever locked, and nothing unlocks.