NP-Complete Problems

NP-Complete Problems
Theory of Computation
●
Intellectual roots can be traced to late 19th century.
–
The foundational crisis: how can meaning be ascribed to
mathematical abstractions and how can mathematics as a
whole be grounded in basic unifying concepts?
–
Are there unsolvable mathematical problems?
●
Turing, Church, Gödel, et al.
●
Investigates the meaning and limits of computation.
–
What is an algorithm?
–
Are there unsolvable problems?
Theory of Computation
●
Since the 1960s, resource-bounded computation.
–
●
●
time, space, randomness, communication, ...
Are there problems that can be solved in principle
but not in practice because solutions would require
too much time?
Do one-way functions exist?
–
(x, y) ↦ x⋅y
Criterion for Efficiency
●
●
Polynomial time is taken as a criterion for efficient
or feasible computation.
Practical and philosophical reasons:
–
Exponential time is clearly not feasible.
–
Linear time seems like too strict a criterion.
–
Polynomials are closed under composition.
–
Algorithms with high-degree polynomial complexity
usually turn out to have low-degree improvements.
P and NP
●
●
●
The class P denotes problems that can be solved in
polynomial time.
NP denotes problems with solutions that can be
verified on polynomial time.
Does P = NP?
–
the most famous open question in computer science
–
resolve it and win $1 million
P and NP
●
Graph problems believed to be in NP – P
–
Maximum Independent Set
–
Hamiltonian Circuit
–
Traveling Salesman
–
Maximum cliques
–
Longest Path
–
3-Coloring
–
and literally hundreds more...
P and NP
●
Other problems believed to be in NP – P
–
Integer Factorization
–
Graph Isomorphism
–
Satisfiability
–
Subset Sum
–
Knapsack
–
Minesweeper Consistency
–
Longest Common Subsequence
AB + AC
NP-Complete Problems
●
●
●
●
An NPC problem:
–
belongs to NP
–
is at least as hard as any other NP problem
To prove that an NP problem is complete, we reduce
a known NPC problem to it.
A good algorithm designer needs to known the basic
theory of NP-completeness.
XKCD
NP-Complete Problems
●
●
Boolean Satisfiability and Tiling were shown to be
NPC in the early 1970s from first principles.
Reductions were used for thousands of other natural
and practical NP problems to prove completeness.
P
NP-Complete
Euler Circuit
Hamiltonian Circuit
Shortest Path
Longest Path
2-Colorability
3-Colorability
Reductions
●
●
3-SAT is NP-Complete.
Instances of this problem are boolean expressions in
CNF with exactly three literals per clause.
–
●
(X1 + X2 + ~X3) ∙ (~X1 + ~X2 + ~X3)
Is there a satisfying assignment?
Independent Set
●
●
An instance of the problem:
–
an undirected graph G = (V, E)
–
a positive integer k
Question:
–
Is there a subset S ⊆ V of size k such that no two vertices
in S are adjacent?
Independent Set
●
Does this graph have an independent set of size 4?
Independent Set
●
Does this graph have an independent set of size 4?
3-SAT  Independent Set
(X + Y + Z) ∙ (~X + ~Y + ~Z) ∙ (~X + Y + Z)
3-SAT  Independent Set
(X + Y + Z) ∙ (~X + ~Y + ~Z) ∙ (~X + Y + Z)
X
Y
~X
Z
~Y
~X
~Z
Y
Z
3-SAT  Independent Set
(X + Y + Z) ∙ (~X + ~Y + ~Z) ∙ (~X + Y + Z)
X
Y
~X
Z
~Y
~X
~Z
Y
Z
Dealing with NPC Problems
Computers and Intractability: A Guide to the Theory of NP-Completeness
M. R. Garey & D. S. Johnson, W. H. Freeman, 1979
Dealing with NPC Problems
●
Find an algorithm that:
–
is fast on average
–
solves a special case of interest
–
approximates an optimal solution
–
finds an optimal solution with high probability