Problem Classes
Problem Classes
not
hamiltonian
Is P =
NP? P
P NP
• The big open question is whether P = NP
• If it is always easy to check a solution, should it also be easy to find a
solution?
• Most computer scientists believe that this is false but no one has
answer …
NP-Completeness
(informally) P NP-complete
NP
• No polynomial time algorithm has been discovered for any NP-Complete problem
• No one has ever proven that no polynomial time algorithm can exist for any
NP-Complete problem
Is P =
NP? P NP-complete
NP
• Hamiltonian cycle
• G = (V, E) a connected, directed graph find a cycle that visits each vertex of G
exactly once
• NP-complete
Satisfiability Problem
(SAT)
• Satisfiability problem: given a logical expression ,
find an assignment of values (F, T) to variables xi that
causes to evaluate to T
=x1 x2 x3 x4
clauses
3-CNF
A subcase of CNF problem:
Satisfiability
• Each clause contains three literals
• Example:
= (x1 x1 x2) (x3 x2 x4)
(x1 x3 x4)
• 3-CNF is NP-Complete
Decision problem:
Clique(G, 3) = YES
• Does G have a clique of size k? Clique(G, 4) = NO
Clique
Verifier
• Given: an undirected graph G = (V, E)
• Problem: Does G have a clique of size k?
• Certificate:
• A set of k nodes
• Verifier:
• Verify that for all pairs of vertices in this set there exists an edge in E