Given a problem, there may exist any number of upper and lower bounds for solving it. The lower bounds can involve deep mathematical cross-problem relationships.

Introduction

Given an unsorted list of integers, return the list of indices as if it were sorted.

A potential solution: We have an obvious upper bound on sorting. In time, we can sort the array, keep track of the indicies and return them. But can we do faster? Is there some algorithm?

Suppose there exists an algorithm, perhaps. Since you can sort the array based on the indices in linear time, this implies an sorting algorithm, a contradiction. Hence, the complexity of this problem is . This way of solving problems is called reduction, and reasonably very popular in complexity theory.

Background

A decision problem is a problem which can be phrased as a yes or no quesiton.

Define to be the class of decision problems decidable in polynomial time. If an algorithm on input , to correctly say yes if and no otherwise, some such that this algorithm runs in time.

Why?

Reason 1: The class captures an intuitive notion of what it means for an algorithm to be “efficient”. If there exists a polynomial time algorithm for a problem, either the problem is trivial or we have a mathematical characterization of the problem. Most problems have terrible brute force time complexities.

Reason 2: is closed under operations which do not violate our intuition about efficiency. The sum, product, and composition of polynomials are all polynomials. If are polynomial time algorithms, they are “efficient”. An algorithm involving running , then , should maintatin this intuition with it’s polynomail runtime.

Reason 3: By the time hierarchy theorems, problems of do exist, though apparently useless.

Completeness

NP-complete problems are the hardest problems in .

Prove a problem is NP-complete by defining a polynomial time reduction for two problems such that 1. is poly time reducible to if there exists which is computable in polynomail time such that .

In short, to prove a problem is NP-complete, show and is NP-hard, usually by virtue of being NP-complete and .

Footnotes

  1. Think of () as being as hard or harder than . is an upper bound for ; is a lower bound for .