Understanding NP-Complete
Definitions
We define the symbols in this section to prepare for explaining NP-complete.
-
f(x):
fis the problem. E.g. in the given graph G, list the SHORTEST-PATH beween V1 and V2.xis the input for this problem. E.g. the graph G and V1, V2. Usually,f(x)can be an optimization problem. -
C(f(x)) -> {0, 1}: NP theory discusses only decision problem, i.e. a problem which outputs only yes or no (1 or 0). So we need
Cto transformf(x)into a decision problem. For example, the SHORTEST-PATH problem can be transform into: “Does there exists a path in graph G connecting V1 and V2, which is shorter than length k?” Oncef(x)is solved,C(f(x))is solved; sof(x)is harder thanC(f(x))(problem reduction).C(f(x))is the NP problem we gonna discuss here. Note that by definition, an NP problemCdoesn’t necessarily need anf(x). -
A(x, y):
f(x)says “find something”.C(f(x))says “does the something exist?”. We name the “something” here asy.yis called certificate in NP theory. According to the denifition of NP,C(f(x))should be verifiable in polynomial time. We name its verification algorithm asA(x, y)here.A(x, y)says: given the “something”y, does it really satisfy whatC(f(x))wants?A(x, y)has polynomial time complexity. Finally the NP problemC(f(x))can be seen as “does aythat satisfiesA(x, y)exist?”
What is NP-complete

A decision problem C is NP-complete if
-
Cis a NP problem, and -
Cis equal or harder than any other NP problems (“hardness” is defined by problem reduction)
The first NP-complete problem is the circuit satisfiability problem. To prove rule 2 for it
-
Every NP problem
Chas itsA(x, y) -
Since
A(x, y)is an algorithm of polynomial time complexity, we can construct its equivalent combinational logic circuit -
If there exists an
ysatisfyingA(x, y), the equivalentymust satisfy our circuit, vice versa. The later one is the circuit satisfiability problem. -
So, if circuit satisfiability problem is solved, we know whether
yexists, thus solvingC. This means circuit satisfiability problem is equal or harder than any other NP problem.
An NP-complete problem is the hardest problem in NP set. The true magic is that, later people found many other problems are no less harder than the circuit satisfiability problem (proved by problem reduction, see below); i.e. they are off the same hardness. So the truth of NP-complete set is that
-
NP-complete problems are the hardest in the NP set
-
There are many NP-complete problems, and they are of the same hardness.
To prove a NP-complete problem
The NP problem to prove is C1, which has verification algorithm A1(x, y). The general approach is to
-
Find an existing NP-complete problem
C2and itsA2(x, y). -
Given the
A2(x, y), construct its equivalentA1(x, y). So that if anyysatisfiesA1(x, y), it satisfiesA2(x, y), and vice versa. This is the reduction. -
So that if we could solve
C1, i.e. to know whether aysatisfyingA1(x, y)exists, we solveC2. It meansC1is no less harder thanC2, thusC1is NP-complete.
For more about NP-complete, refer to wiki or “Introduction of Algorithms”.
Create an Issue or comment below