
Introduction to complexity theory
Complexity Class P:
What is the worst-case running time to solve the shortest path problem?
What is the worst-case running time to solve the longest path problem that you
can come up with?
Which problem, the shortest path problem or the longest path problem, provably
belongs to P?
Polynomial Equivalence of Decision and Optimization Problems
Clique definition: A set of nodes C in a graph G=(V,E) such that for any two nodes
u,v in C, the edge (u,v) is in E.
• Example transformation using clique problem
– Optimization Problems
• Input: Graph G=(V,E)
• Task 1: Output size of maximum clique in G
• Task 2: Output a maximum sized clique of G
– Decision Problem
• Input: Graph G=(V,E), integer k ≤ |V|
• Y/N Question: Does G contain a clique of size k?
• Your tasks
– Show that if we can solve the decision clique problem in polynomial-time,
then we can solve the optimization clique problem with task 2 in
polynomial-time.
– Show that if we can solve the optimization clique problem with task 2, we
can solve the optimization clique problem with task 1 in polynomial time.
Convert the following optimization problem into a related decision problem.
Vertex Cover Optimization Problem:
Input: Graph G = (V,E)
Task: Produce the smallest set of nodes C such that for all edges (u,v) in E,
either u or v belongs to C. The set C is called a vertex cover.