One way of doing this is to have two new classes NPO and PO that contain optimizations problems and theithey mimic of course the classes NP and P for decision problems. New reductions are necessary as well. Then we can recreate a version NP-hardness for optimization problems very much the same as for decision problems. But first we have to agree what an optimization-problem is.
Definition: Let $O=(X,L,f,opt)$ be an optimization-problem. $X$ is the set of inputs or instances suitable encoded as strings. $L$ is a function that maps each instance $x\in X$ onto a set of strings, the feasible solutions of instance $x$. ItIt is a set because there are many solutions to an optimization-problem. Thus we haven an objective function $f$ that tells us for every pair $(x, L(x))$ of instance and solution set its cost or value. $opt$ tells us wheter we are maximizing or minimizing.
This allows us to define what an optimal solution is: Let $y_{opt}\in L(x)$ be the optimal solution of an instance $x\in X$ of an optimization problem-problem $O=(X,L,f,opt)$ with $$f(x,y_{opt})=opt\{f(x,y')\mid y'\in L(x)\}.$$ The optimal solution is often denoted by $y^*$.
Now we can define the class NPO: Let $NPO$ be the set of all optimization problems-problems $O=(X,L,f,opt)$ with:
- We can verify efficiently if $x$ is actually a valid instance of our optimization problem
- The size of the feasible solutions is bounded polynomially in the size of the inputs, And we can verify efficiently if $y\in L(x)$ is a fesible solutionfsolution of the instance $x$.
- The value of a solution $y\in L(x)$ can be determined efficiently.
Now we are able to define what we want to call an approximation-algorithm: An approximation-algorithm of an optimization problem-problem $O=(X,L,f,opt)$ is an algorithmsalgorithm that computes a feasible solution $y\in L(x)$ for an instance $x\in X$.
Now we have to types of errors: The absolute error of a feasible solution $y\in L(x)$ of an instance $x\in X$ of the optimization problem-problem $O=(X,L,f,opt)$ is $|f(x,y)-f(x,y^*)|$.
We call the absolute error of an approximation algorithm-algorithm $A$ for the optimization-problem $O$ bounded by $k$ if the algorithm $A$ computes for every instance $x\in X$ a feasible solution with an absolute error bounded by $k$.
This example is rather an exception, small absolute errors are rare, thus we define the relative error $\epsilon_A(x)$ of the approximation algorithm-algorithm $A$ on instance $x$ of the optimization problem-problem $O=(X,L,f,opt)$ with $f(x,y)>0$ for all $x\in X$ and $y\in L(x)$ to be
where $A(x)=y\in L(x)$ is the feasible solution computed by the approximation algorithm-algorithm $A$.
We can now define approximation-algorithm $A$ for the optimization problem-problem $O=(X,L,f,opt)$ to be a $\delta$-approximation-algorithm for $O$ if the relative error $\epsilon_A(x)$ is bounded by $\delta\ge 0$ for every instance $x\in X$, thus
$$\epsilon_A(x)\le \delta\qquad \forall x\in X.$$
The choice of $\max\{f(x,A(x)),f(x,y^*)\}$ in the denominator of the definition of the relative error was selectselected to make the definition symmetric for maximizing and minimizing. The value of the relative error $\epsilon_A(x)\in[0,1]$. In case of a maximiyingmaximizing problem the value of the solution is never lessen than $(1-\epsilon_A(x))\cdot f(x,y^*)$ and never larger than $1/(1-\epsilon_A(x))\cdot f(x,y^*)$ for a minimizing problem.
Now we can call an optimization problem-problem $\delta$-approximable if there is a $\delta$-approximation-algorithm $A$ for $O$ that runs in polynomial time.
We do not want to look at the error for every instance $x$, we look only at the worst case. Thus we define $\epsilon_A(n)$, the maximal relativ error of the approximation algorithm-algorithm $A$ for the optimization problem-problem $O$ to be
$$\epsilon_A(n)=\sup\{\epsilon_A(x)\mid |x|\le n\}.$$
Example: A maximal matching in a graph can be transformed in to a minimal node cover $C$ by adding all incident nodes from the matching to the vertexcoververtex cover. Thus $1/2\cdot |C|$ edges are covered. As each vertex cover including the optimal one must have one of the nodes of each covered edge, otherwise it could be improved, we have $1/2\cdot |C|\cdot f(x,y^*)$. It follows that $$\frac{|C|-f(x,y^*)}{|C|}\le\frac{1}{2}$$
Thus the greedy algorithm for a maximal matching is a $1/2$-approximatio-algorithm for $\mathsf{Minimal-VertexCover}$. Hence $\mathsf{Minimal-VertexCover}$ is $1/2$-approximable.
Let $O=(X,L,f,opt)$ be an optimization problem-problem with $f(x, y)>0$ for all $x\in X$ and $y\in L(x)$ and $A$ an approximation-algorithm for $O$. The approximation ratio-ratio $r_A(x)$ of feasible solution $A(x)=y\in L(x)$ of the instance $x\in X$ is
$$r_A(x)=\begin{cases}1&f(x,A(x))=f(x,y^*)\\\max\left\{
\frac{f(x,A(x))}{f(x, y^*)},\frac{f(x, y^*)}{f(x, A(x))}\right\}&f(x,A(x))\ne f(x,y^*)\end{cases}$$
As before we call an approximation-algorithm $A$ an $r$-approximation-algorithm for the optimization problem-problem $O$ if the approximation ratio-ratio $r_A(x)$ is bounded by $r\ge1$ for every input $x\in X$.
$$r_A(x)\le r$$
And yet again if we have an $r$-approximation-algorithm $A$ for the optimization problem-problem $O$ then $O$ is called $r$-approximable. Again we reduce ourselves to the worst case and define the maximal approximation ratio-ratio $r_A(n)$ to be
$$r_A(n)=\sup\{r_A(x)\mid |x|\le n\}.$$
IfAccordingly the approximation ratio-ratio is larger than $1$ for suboptimal solutions. Thus better solutions have smaller ratios. For $\mathsf{Minimum-SetCover}$ we can now write that it is $(1\ln(n))$-approximable. And in case of $\mathsf{Minimum-VertexCover}$ we nowknow from the previous example that it is $2$-approximable. Between relative error and approximation ratio-ratio we have simple relations:
$$r_A(x)=\frac{1}{1-\epsilon_A(x)}\qquad \epsilon_A(x)=1-\frac{1}{r_A(x)}.$$
For small deviations from the optimum $\epsilon<1/2$ and $r<2$ the relative error is advantageous over the approximation ration-ratio, that shows is strengthits strengths for large deviations $\epsilon\ge 1/2$ and $r\ge 2$.
The two versions of $\alpha$-approximable don’t overlap as one version has always $\alpha\le 1$ and the other $\alpha\ge 1$. The case $\alpha=1$ is not problematic as this is only reached by algorithms that produce an exact solution and consequentially need not be treated as approximation algorithms-algorithms.
Another class appears often APX. It is define as the set of all optimization problems-problems $O$ from $NPO$ that haven an $r$-approximation algorithm-algorithm with $r\ge1$ that runs in polynomial time.
We are almost through. We would like to copy the successful ideas of reductions and completness from complexity theory. The observation is that many NP-hard decision variants of optimization problems-problems are reducible to each other while their optimization variants have different properties regarding their approximability. This is due to the polynomialtime-Krap-reduction used in NP-completness reductions, which does not preserve the objective function. And even if the objective functions is preserved the polynomialtime-Krap-reduction may change the quality of the solution.
Finally we can define what we mean by $\mathcal{C}$-hard and $\mathcal{C}$-complete for optimization problems-problems:
Let $O$ be an optimization problems-problems from $NPO$ and $\mathcal{C}$ a class of optimization problems-problems from $NPO$ then $O$ is called $\mathcal{C}$-hard with respect to $\le_{AP}$ if for all $O'\in\mathcal{C}$ $O'\le_{AP} O$ holds.