CAPÍTULO 3: ARQUITECTURA DEL SISTEMA
3.8 Conclusiones
An important concept when dealing with CO problems is the measure of their computational complexity. Such a measure can assess how difficult it is to solve the problem.
Let fA : N → N be a time function for a given algorithm A. This means that the algorithm running time is at most fA(n) for an input with size n ∈ N. We say that A is a polynomial time algorithm if, for a given polynomial p, fA(n) ≤ p(n),
12 2. Combinatorial and Integer Programming
∀n ∈ N. Problems that can be solved by a polynomial time algorithm are usually addressed as easy problems. Problems that cannot be solved by a polynomial time algorithm are considered to be intractable for instances that are not very small.
A decision problem is a problem that, for any given input, has only two possible outputs: yes (or 1) and no (or 0). We say that a decision problem Π is polynomially reducible to a decision problem Π∗ (Π ∝ Π∗) if there is a polynomial time algorithm which transforms instances i ∈ Π into instances i∗ ∈ Π∗ in such a way that instance i has an answer yes if and only if instance i∗ has an answer yes.
In 1971, Stephen Cook [52] defined the complexity class N P , laying the foun-dations of complexity theory. The author proved that any problem in this class can be converted in polynomial time to the boolean satisfiability problem (SAT), with the famous Cook’s theorem. With this theorem, the author introduced the notion of N P -completeness, and SAT became the fist proven N P -complete prob-lem. Later on, Karp [125] proved other twenty one problems to be N P -complete, followed by Garey and Johnson [91], who provided a more comprehensive list of 300 N P -complete problems.
Given an optimization problem, for example, min{cx : x ∈ X}, a corresponding decision problem (also called recognition problem) would be the problem in the form of the question: Is there any x ∈ X such that cx ≤ k?, being k a constant.
From a complexity point of view, both the optimization and decision problems are equivalent in the sense that if we can answer the second one in polynomial time, the solution for the first one can also be found in polynomial time. Having said that, we stress the fact that, formally, the N P -completeness theory only addresses decision problems.
2.3.1 Complexity Classes
Let us now define four classes of problems:
(i) the class of N P (nondeterministic polynomial time) problems is the subset of
2.3. Algorithms and Computational Complexity 13
decision problems for which any instance with an answer yes has a polynomial proof for it;
(ii) the class of P problems is the subset of decision problems that belong to N P and for which there is a polynomial algorithm;
(iii) the class of N P -complete problems is the subset of problems Π ∈ N P such that for every problem ∆ ∈ N P , ∆ is polynomially reducible to Π. This means that problems Π are at least as hard as every other problem in class N P ;
(iv) the class of N P -hard problems is the subset of problems Π such that for every problem ∆ ∈ N P , ∆ is polynomially reducible to Π. Π does not necessarily belong to class N P . Therefore, the intersection between class N P and class N P -hard is the class N P -complete. An optimization problem is, therefore, said to be N P -hard if its recognition version is N P -complete.
It is clear that P ⊆ N P and that N P -complete ⊆ N P . The fundamental question is P = N P ? If someone proves that there is a problem in the class N P -hard that is polynomially reducible to a problem in the class P , then it would be proved that all problems could be solved in polynomial time, and thus P = N P . Neither this nor its contrary has ever been proved. The fact that no one has ever found a polynomial algorithm for a N P -hard problem may be an empirical evidence that P 6= N P , although not everyone in the research community is convinced of that. This is one of the most famous open problems in theoretical computer science, and it is commonly addressed as the P vs N P problem. The Claus Mathematics Institute established this problem as one of the seven Millennium Problems, with a prize of one million dollars for who ever formally proves either that P = N P or P 6= N P .
N P -complete problems can still be divided into two categories. The weakly N P -complete and the strongly N P -complete problems. The first are the ones that
14 2. Combinatorial and Integer Programming
can be solved with a pseudo-polynomial algorithm and the second are the ones that cannot be solved with a pseudo-polynomial algorithm unless P = N P .
Pseudo-polynomial algorithms are polynomial in the dimension of the input and the size of the numerical data. They differ from strongly polynomial algorithms as strongly polynomial algorithms have a running time that is independent of the nu-merical size of the input. An integer sorting algorithm is an example of a strongly polynomial algorithm. The number os steps required to solve it is independent of the sizes of the input data, depending only on the number of integers to sort.
The size of an instance is the number of bits required to encode it. Numerical data are encoded in binary notation. This means that an integer x takes log2x bits to encode. Technically speaking, pseudo-polynomial algorithms are, therefore, exponential, but, according to Garey and Johnson [91], they only express an ex-ponential behavior when the input data contains exex-ponentially large numbers, and thus can efficiently solve instances where that does not happen. Strongly N P -complete problems are those that remain N P --complete even if the input data is encoded in unary notation (an integer number x takes x bits to encode in unary notation).
2.3.2 Big-O Notation
The efficiency of an algorithm can also be described by the so called Big-O nota-tion. It measures an algorithm efficiency by its worst-case behavior, i.e., the worst performance of all inputs possible.
Given two real functions f and g, f (n) is O(g(n)) if |f (n)| ≤ k|g(n)| for all n > 0 and some k > 0.
The Big-O notation uses an asymptotic analysis to provide an approximate upper bound on the computational effort for the algorithm to solve an instance of size n.