P and NP

Decision Problems

The complexity class P includes those problems, such that for each problem, there exists at least one algorithm that can find its solution in polynomial time.

The complexity class NP includes those problems, such that for each problem, its solution can be verified in polynomial time, but there is no guarantee that there exists an algorithm that can find its solution in polynomial time.

An example of NP problem is travelling salesman problem: "Given a list of cities (vertices) and the distances between each pair of cities (weight of edges), what is the shortest possible route that visits each city exactly once and returns to the original city?" (Quote from Wikipedia with slight modification).

A slightly simplified example of the travelling salesman problem is Hamiltonian Cycle problem: Given a graph G, is there a simple cycle in G that visits each vertex in G exactly once?

P is a subset of NP. Any problem in class P is also a problem in class NP. There is no known answer whether P is a proper subset of NP.

NP-completeness: If a problem is in class NP and can be reduced to a know NP-complete problem in polynomial time, then this problem is NP-complete. Any problem in P is NOT in class NP-complete. All NP-complete problems are equally hard to solve.

NP-hard: A problem X is NP-hard if there is an NP-complete problem Y such that Y can be reduced to X in polynomial time. NP-hard problems can be equally hard as or harder than NP-complete problems. NP-hard problems may not even in NP class.

Commonly know NP-complete problems:

Reduction (with a polynomial function) of 3-SAT to Clique: A conjuctive expression with k three-literal clauses can be reduced to a k-Clique problem. The implication is that if Clique has a polynomial solution, then 3-SAT also has a polynomial solution. Therefore, Clique is also NP-complete.

How are NP-complete problems usually solved?