TNK104 Applied Optimization
Problem Complexity: Detailed
Lecture 9
based on the slides provided by Nikolaos Pappas
Problem Complexity: Preliminaries
2
TNK104 Applied Optimization I
Maybe these algorithms are there, just waiting to be discovered, or, maybe they don’t exist at all???
Problem Complexity: Preliminaries (cont’d)
3
TNK104 Applied Optimization I
A: There is an efficient/fast algorithm that always returns the exact optimum
A: The algorithm’s running time (in the number of elementary calculations) is bounded by a polynomial in the size of problem representation.
Consider a complete graph of n nodes:
k is some constant ! O(n2)
Problem Class NP
4
TNK104 Applied Optimization I
Consider a graph:
All the combinatorial optimization problems we have discussed
have their decision problems in NP*.
Note: NP stands for nondeterministic polynomial time
NP
Class P
5
TNK104 Applied Optimization I
NP
P
Class NP-Complete (NP-C)
6
TNK104 Applied Optimization I
NP
NP-C
P
→ If we can solve one single NP-C problem in polynomial time, we can solve all problems in NP in polynomial time!
Class NP-Complete (NP-C) (cont’d)
7
TNK104 Applied Optimization I
and many more!
M. R. Garey and D. S. Johnson, Computers and Intractability: A Guide to the Theory of NP-Completeness, Freeman, 1979.
NP
NP-C
P
Karp’s 21 NP-Complete Problems
8
TNK104 Applied Optimization I
In 1972, R. Karp discussed the NP-completeness of 21 problems, starting from SAT
Satisfiability Problem (SAT)
9
TNK104 Applied Optimization I
Satisfiability Problem (SAT) (cont’d)
10
TNK104 Applied Optimization I
This is the first problem proved to be NP-C (the concept didn’t exist before the theorem)
→ All problems in NP can be reduced (polynomially) to SAT
NP
SAT
A
11
TNK104 Applied Optimization I
P = NP?
NP
P
NP-C
We still don’t know.
Lance Fortnow, "The Status of the P Versus NP Problem", Communications of the ACM, Vol. 52 No. 9, Pages 78-86
Class NP-Hard
12
TNK104 Applied Optimization I
NP
NP-C
P
NP-hard
→ Finding the optimum to, for example, integer programming, traveling salesman, graph coloring, set covering, and Steiner tree, is NP-hard
How Should We Interpret the Complexity Results?
13
TNK104 Applied Optimization I
L. Wolsey, Integer Programming, John Wiley & Sons, 1998, pp. 87-88:
“A pessimist might say that as most problems appear to be hard,… we have no hope of solving instances of large size …, and so we should give up.
A mathematician (optimist) might set out to become famous by proving that P=NP
A mathematician (pessimist) might set out to become famous by proving that P ≠ NP
A mathematician (thoughtful) might decide to ask a different question: Can I find an algorithm that is guaranteed to find a solution “close to optimal” in polynomial time in all cases?
A probabilist (thoughtful) might also ask a different question: Can I find an algorithm that runs in polynomial time and that is guaranteed to find an optimal or “close to optimal” solution with high probability?
How Should We Interpret the Complexity Results? (cont’d)
14
TNK104 Applied Optimization I
An engineer would start looking for a heuristic algorithm that produces practically usable solution
Your boss may say: I don’t care a damn about integer programming theory. You just worry about our scheduling problem. Give me a feasible production schedule for tomorrow…
A struggling professor might say: Great, previously I was trying to develop one algorithm to solve all integer programs, and publishing one paper every two years explaining why I was not succeeding. Now I know that I might as well study each NP problem individually. As there are thousands of them, I should be able to write twenty papers a year.
Needless to say they are nearly all right.”
How to Relate Problems to Each Other in Complexity?
15
TNK104 Applied Optimization I
→ An algorithm for B works also for A
→ B is at least as difficult as A, or, equivalently, A is at least as easy as B
Thus
A
B
Consider two problems A and B, if A can be (polynomial-time) reduced to B
Examples of Problem Reduction: Bipartite Matching
16
TNK104 Applied Optimization I
Bipartite matching
Instance: A bipartite graph G = (V1, V2, E)
Find a matching with maximum number of edges
(A matching is a set of edges without any node in common)
Example of Problem Reduction: Bipartite Matching (cont’d)
17
TNK104 Applied Optimization I
Relation to maximum flow:
Introduce two nodes s and t, and connect them to V1 and V2, respectively, with edge capacity one
Set also the capacity of the original edges (arcs) to one
The maximum flow from s to t provides the optimal matching
s
t
Examples of Problem Reduction: Degree-Constrained MST
18
TNK104 Applied Optimization I
Degree-constrained MST (DMST)
Examples of Problem Reduction: Degree-Constrained MST (cont’d)
19
TNK104 Applied Optimization I
Hamiltonian path
Equivalent to Hamiltonian cycle that is among Karp’s 21 NP-complete problems
Instance: A graph G = (V, E)
Is there a path visiting each node exactly once?
A graph without any Hamiltonian path A graph with a Hamiltonian path
Examples of Problem Reduction: Degree-Constrained MST (cont’d)
20
TNK104 Applied Optimization I
Hamiltonian path
DMST
DMST is NP-C (at least as difficult as Hamiltonian path)
For d = 2, DMST is . . . . . . a path.
Existence of Hamiltonian path ↔ Existence of a DMST with d = 2
Special Cases of NP-C Problems: Examples
21
TNK104 Applied Optimization I
Hamiltonian path is among Karp’s 21 NP-complete problems
Knapsack is also among Karp’s 21 NP-complete problems
What is the lesson learned?
Self-Study Material
Textbook:
Chapter 34, NP-completeness
MIT OCW video lectures:
#16 https://youtu.be/eHZifpgyH_4
Youtube videos:
Big O notation: https://youtu.be/zUUkiEllHG0
Complexity theory: https://youtu.be/u2DLlNQiPB4
Bipartite matchings https://youtu.be/GhjwOiJ4SqU
Satisfiability Problem https://youtu.be/SAXGKCnOuP8