Daniel Sutantyo, Department of Computing, Macquarie University
11.2 - Reduction
\(\text{EXP}\)
\(\text{P}\)
\(\text{NP}\)
\(\text{EXP}\)
\(\text{NP-hard}\)
\(\text{NP-complete}\)
11.2 - Reduction
11.2 - Reduction
Input for Problem A
Input for Problem B
Solution for Problem B
Solution for Problem A
REDUCER
REDUCER
SOLVER for B
11.2 - Reduction
Input for Problem A
REDUCER
Input for Problem B
SOLVER for B
Yes / No
11.2 - Reduction
11.2 - Reduction
11.2 - Reduction
Travelling
Salesman
Linear
Search
REDUCER
11.2 - Reduction
11.2 - Reduction
What is the length of the shortest route in the TSP problem
Is there a cycle of length k?
REDUCER
for k = 0 to MAX
Length of the shortest route in the TSP problem
11.2 - Reduction
11.2 - Reduction
11.2 - Reduction
because reduction is a way for us to say that a problem is HARD
because reduction is a way for us to say that a problem is HARD
11.2 - Reduction
Illustration by Stefan Szeider, https://www.ac.tuwien.ac.at/people/szeider/cartoon/
11.2 - Reduction
A \(\le_p\) B
11.2 - Reduction
A \(\le_p\) B \(x^2+x+1\)
11.2 - Reduction
A \(\le_p\) B
A is easy, B is hard
Can you solve an easy problem in a hard way? Yes!
(cue in the poor COMP125 student)
11.2 - Reduction
A is easy, B is hard
A \(\le_p\) B
11.2 - Reduction
You shouldn't be able to do that (this is trying to do Travelling Salesman Problem using linear search)
A is easy, B is hard
A \(\le_p\) B
A is hard, B is easy
11.2 - Reduction
A is easy, B is hard
A \(\le_p\) B
A is hard, B is easy
11.2 - Reduction
A is easy, B is hard
A \(\le_p\) B
A is hard, B is easy
A is easy, B is easy
A is hard, B is hard
11.2 - Reduction
A is easy, B is hard
A \(\le_p\) B
A is hard, B is easy
A is easy, B is easy
A is hard, B is hard
These are fine, but not very useful, it just says that we can convert P problems to P problems and NP problems to NP problems (we stay in the complexity class)
11.2 - Reduction
A is easy, B is hard
A \(\le_p\) B
A is hard, B is easy
A is easy, B is easy
A is hard, B is hard
11.2 - Reduction
A is easy, B is hard
A \(\le_p\) B
A is hard, B is easy
A is easy, B is easy
A is hard, B is hard
11.2 - Reduction
A is easy, B is hard
A \(\le_p\) B
A is hard, B is easy
A is easy, B is easy
A is hard, B is hard
11.2 - Reduction
A is easy, B is hard
A \(\le_p\) B
A is hard, B is easy
A is easy, B is easy
A is hard, B is hard
11.2 - Reduction
A is easy, B is hard
A is hard, B is easy
A is easy, B is easy
A is hard, B is hard
11.2 - Reduction
A
B
\(\le_p\)
(known)
(unknown)
NP-hard
NP-complete
11.2 - Reduction
(disclaimer: I never saw Twilight)
11.2 - Reduction
11.2 - Reduction
\[x_0 \lor \neg x_1 \lor \neg x_3 \]
\[x_1 \lor x_2 \lor \neg x_3 \]
\[\neg x_0 \lor \neg x_2 \lor x_3 \]
\[x_0 \lor x_1 \lor x_3 \]
11.2 - Reduction
\[x_0 \lor \neg x_1 \lor \neg x_3 \]
\[x_1 \lor x_2 \lor \neg x_3 \]
\[\neg x_0 \lor \neg x_2 \lor x_3 \]
\[x_0 \lor x_1 \lor x_3 \]
\[x_0 = 1, x_1 = 1, x_2 = 1, x_3 = 1\]
1 0 0
1 1 0
0 0 1
1 1 1
11.2 - Reduction
11.2 - Reduction
SAT
3-SAT or 3-CNF
Clique
Vertex Cover
Hamiltonian Cycle
Travelling Salesman
Subset Sum
Partition
Knapsack
11.2 - Reduction
SAT
3-SAT or 3-CNF
Clique
Vertex Cover
Hamiltonian Cycle
Travelling Salesman
Subset Sum
Partition
Knapsack
Your
Problem
11.2 - Reduction