chapter 3 · in chap. 2, we have seen that, in some cases, standard algorithm design techniques,...

36
Chapter 3 Approximation Classes I N THE first chapter we have seen that, due to their inherent complexity, NP-hard optimization problems cannot be efficiently solved in an exact way, unless P = NP. Therefore, if we want to solve an NP-hard optimiza- tion problem by means of an efficient (polynomial-time) algorithm, we have to accept the fact that the algorithm does not always return an optimal solution but rather an approximate one. In Chap. 2, we have seen that, in some cases, standard algorithm design techniques, such as local search or greedy techniques, although inadequate to obtain the optimal solution of NP-hard optimization problems, are powerful enough to reach good ap- proximate solutions in polynomial time. In this chapter and in the following one, we will formally introduce an important type of approximation algorithms. Given an instance of an NP-hard optimization problem, such algorithms provide a solution whose performance ratio is guaranteed to be bounded by a suitable function of the input size. This type of approximation is usually called performance guarantee approximation. In particular, while in the next chapter we will deal with slowly increasing bounding functions, we will here consider the case in which the function is a constant. An example of this kind is the greedy algorithm for MAXIMUM KNAPSACK, which we have already met in Sect. 2.1, that efficiently finds a solution whose value is always at least one half of the optimal one. After giving the basic definitions related to the notion of performance guarantee approximation, we will state both positive results, showing that several computationally hard problems allow efficient, arbitrarily good ap-

Upload: others

Post on 26-Aug-2021

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Chapter 3 · In Chap. 2, we have seen that, in some cases, standard algorithm design techniques, such as local search or greedy techniques, although inadequate to obtain the optimal

Chapter

3Approximation Classes

IN THE first chapter we have seen that, due to their inherent complexity,NP-hard optimization problems cannot be efficiently solved inan exact

way, unless P= NP. Therefore, if we want to solve an NP-hard optimiza-tion problem by means of an efficient (polynomial-time) algorithm, wehave to accept the fact that the algorithm does not always return an optimalsolution but rather an approximate one. In Chap. 2, we have seen that, insome cases, standard algorithm design techniques, such as local search orgreedy techniques, although inadequate to obtain the optimal solution ofNP-hard optimization problems, are powerful enough to reach good ap-proximate solutions in polynomial time.

In this chapter and in the following one, we will formally introducean important type of approximation algorithms. Given an instance of anNP-hard optimization problem, such algorithms provide a solution whoseperformance ratio is guaranteed to be bounded by a suitable function ofthe input size. This type of approximation is usually calledperformanceguarantee approximation. In particular, while in the next chapter we willdeal with slowly increasing bounding functions, we will here consider thecase in which the function is a constant. An example of this kind is thegreedy algorithm for MAXIMUM KNAPSACK, which we have already metin Sect. 2.1, that efficiently finds a solution whose value is always at leastone half of the optimal one.

After giving the basic definitions related to the notion of performanceguarantee approximation, we will state both positive results, showing thatseveral computationally hard problems allow efficient, arbitrarily good ap-

Page 2: Chapter 3 · In Chap. 2, we have seen that, in some cases, standard algorithm design techniques, such as local search or greedy techniques, although inadequate to obtain the optimal

Chapter 3

APPROXIMATION

CLASSES

proximation algorithms, and negative results, showing that for other prob-lems, by contrast, there are intrinsic limitations to approximability.

The different behavior of NP-hard optimization problems with respect totheir approximability properties will be captured by meansof the definitionof approximation classes, that is, classes of optimization problems sharingsimilar approximability properties. We will see that, if P6= NP, then theseclasses form a strict hierarchy whose levels correspond to different degreesof approximation.

We will, finally, discuss some conditions under which optimization prob-lems allow approximation algorithms with arbitrarily goodguaranteed per-formance.

3.1 Approximate solutions with guaranteed performance

BEFORE WEformally introduce algorithms that provide approximatesolutions of optimization problems with guaranteed quality, let us

first observe that according to the general framework set up in Chap. 1,given an input instancex of an optimization problem, any feasible solutiony ∈ SOL(x) is indeed an approximate solution of the given problem. Onsuch a ground an approximation algorithm may be defined as follows.

Given an optimization problemP = (I ,SOL,m,goal), an algorithmA isDefinition 3.1Approximation algorithm

I

anapproximation algorithmfor P if, for any given instance x∈ I, it returnsanapproximate solution, that is a feasible solutionA(x) ∈ SOL(x).

3.1.1 Absolute approximation

Clearly, for all practical purposes, Def. 3.1 is unsatisfactory. What we areready to accept as an approximate solution is a feasible solution whosevalue is ‘not too far’ from the optimum. Therefore we are interested indetermining how far the value of the achieved solution is from the value ofan optimal one.

Given an optimization problemP , for any instance x and for any feasibleDefinition 3.2Absolute error

I

solution y of x, theabsolute errorof y with respect to x is defined as

D(x,y) = |m∗(x)−m(x,y)|

where m∗(x) denotes the measure of an optimal solution of instance x andm(x,y) denotes the measure of solution y.

88

Page 3: Chapter 3 · In Chap. 2, we have seen that, in some cases, standard algorithm design techniques, such as local search or greedy techniques, although inadequate to obtain the optimal

Section 3.1

APPROXIMATE

SOLUTIONS WITH

GUARANTEED

PERFORMANCE

Indeed, given an NP-hard optimization problem, it would be very satis-factory to have a polynomial-time approximation algorithmthat, for everyinstancex, is capable of providing a solution with a bounded absolute error,that is a solution whose measure is only a constant away from the measureof an optimal one.

Given an optimization problemP and an approximation algorithmA for J Definition 3.3Absolute approximationalgorithm

P , we say thatA is anabsolute approximation algorithmif there exists aconstant k such that, for every instance x ofP , D(x,A(x)) ≤ k.

Let us consider the problem of determining the minimum number of colors neededJ Example 3.1to color a planar graph. We have seen in Theorem 2.12 that a 6-coloring of a planargraph can be found in polynomial time. It is also known that establishing whetherthe graph is 1-colorable (that is, the set of edges is empty) or 2-colorable (thatis, the graph is bipartite) is decidable in polynomial time whereas the problem ofdeciding whether three colors are enough is NP-complete. Clearly, if we providean algorithm that returns either a 1- or a 2-coloring of the nodes if the graph is 1-or 2-colorable, respectively, and returns a 6-coloring in all other cases, we obtainan approximate solution with absolute error bounded by 3.

A second related (but less trivial) example, concerning theedge coloringproblem, will be considered in Chap. 4.

Unfortunately, there are few cases in which we can build absolute ap-proximation algorithms and, in general, we cannot expect such a good per-formance from an approximation algorithm. The knapsack problem is anexample of an NP-hard problem that does not allow a polynomial-timeapproximation algorithm with bounded absolute error.

UnlessP= NP, no polynomial-time absolute approximation algorithm ex-J Theorem 3.1

ists forMAXIMUM KNAPSACK.

Let X be a set ofn items with profitsp1, . . . , pn and sizesa1, . . . ,an, and let PROOF

b be the knapsack capacity. If the problem would allow a polynomial-timeapproximation algorithm with absolute errork, then we could solve thegiven instance exactly in the following way. Let us create a new instanceby multiplying all profitspi by k+1. Clearly, the set of feasible solutionsof the new instance is the same as that of the original instance. On the otherside, since the measure of any solution is now a multiple ofk+1, the onlysolution with absolute error bounded byk is the optimal solution. Hence,if we knew how to find such a solution in polynomial time, we would alsobe able to exactly solve the original instance in polynomialtime. QED

Similar arguments apply to show that most other problems, such as MIN-IMUM TRAVELING SALESPERSONand MAXIMUM INDEPENDENT SET,do not allow polynomial-time absolute approximation algorithms.

89

Page 4: Chapter 3 · In Chap. 2, we have seen that, in some cases, standard algorithm design techniques, such as local search or greedy techniques, although inadequate to obtain the optimal

Chapter 3

APPROXIMATION

CLASSES

3.1.2 Relative approximation

In order to express the quality of an approximate solution, more interest-ing and more commonly used notions are the relative error andthe perfor-mance ratio.

Given an optimization problemP , for any instance x ofP and for anyDefinition 3.4Relative error

I

feasible solution y of x, therelative errorof y with respect to x is defined as

E(x,y) =|m∗(x)−m(x,y)|

max{m∗(x),m(x,y)}.

Both in the case of maximization problems and of minimization prob-lems, the relative error is equal to 0 when the solution obtained is optimal,and becomes close to 1 when the approximate solution is very poor.

Given an optimization problemP and an approximation algorithmA forDefinition 3.5ε-approximate algorithm

I

P , we say thatA is anε-approximate algorithmfor P if, given any input in-stance x ofP , the relative error of the approximate solutionA(x) providedby algorithmA is bounded byε, that is:

E(x,A(x)) ≤ ε.

The greedy algorithm we analyzed in Sect. 2.1 for MAXIMUM KNAP-SACK is an example of a polynomial-time 1/2-approximate algorithm. Infact, such an algorithm always provides a solution whose relative error isat most 1/2.

As an alternative to the relative error, we can express the quality of theapproximation by means of a different, but related, measure.

Given an optimization problemP , for any instance x ofP and for anyDefinition 3.6Performance ratio

I

feasible solution y of x, theperformance ratioof y with respect to x definedas

R(x,y) = max

(

m(x,y)m∗(x)

,m∗(x)m(x,y)

)

.

Both in the case of minimization problems and of maximization prob-lems, the value of the performance ratio is equal to 1 in the case of an op-timal solution, and can assume arbitrarily large values in the case of poorapproximate solutions. The fact of expressing the quality of approximatesolutions by a number larger than 1 in both cases is slightly counterintu-itive, but it yields the undoubted advantage of allowing a uniform treatmentof minimization and maximization problems.

90

Page 5: Chapter 3 · In Chap. 2, we have seen that, in some cases, standard algorithm design techniques, such as local search or greedy techniques, although inadequate to obtain the optimal

Section 3.1

APPROXIMATE

SOLUTIONS WITH

GUARANTEED

PERFORMANCE

Clearly the performance ratio and the relative error are related. In fact,in any case, the relative error of solutiony on inputx is equal toE(x,y) =1−1/R(x,y).

As in the case of the relative error, also for the performanceratio it is in-teresting to consider situations in which such a quality measure is boundedby a constant for all input instances.

Given an optimization problemP and an approximation algorithmA for J Definition 3.7r-approximate algorithmP , we say thatA is an r-approximate algorithmfor P if, given any input

instance x ofP , the performance ratio of the approximate solutionA(x) isbounded by r, that is:

R(x,A(x)) ≤ r.

For example, the greedy algorithm for MAXIMUM KNAPSACK is an exam-ple of a 2-approximate algorithm since it always provides a solution whosevalue is at least one half of the optimal value.

Notice that, according to our definition, if, for a given optimization prob-lemP and a given algorithmA for P , we have that, for all instancesx of P ,mA(x,y)≤ rm∗(x)+k we do not say that algorithmA is r-approximate, butthat it is at mostr + k-approximate. In the literature it is widely acceptedthat, in such case, the algorithm is calledr-approximate, under an asymp-totic point of view. For example, Theorem 2.9 states that, given an instancex of M INIMUM BIN PACKING, First Fit Decreasingreturns a solution suchthatmFFD(x) ≤ 3

2m∗(x)+1. Such an algorithm is indeed usually known asa 3

2-approximate algorithm. The asymptotic point of view in theevaluationof the performance ratio of algorithms will be taken into consideration inChap. 4.

As we have seen, in order to qualify the degree of approximationachieved by an approximation algorithm we may refer either to the boundε on its relative error (and speak of anε-approximate algorithm) or to thebound r on its performance ratio (and speak of anr-approximate algo-rithm). In the following, we will mainly refer to the performance ratio inorder to estimate the quality of the computed solutions: however, sincethe relative error is always smaller than 1 and the performance ratio is al-ways larger than or equal to 1, it will be always clear which approximationquality measure we are referring to.

The existence of polynomial-time approximation algorithms qualifiesdifferent kinds of NP-hard optimization problems.

An NP-hard optimization problemP is ε-approximable(respectively, r- J Definition 3.8ε-approximable problemapproximable) if there exists a polynomial-timeε-approximate (respec-

tively, r-approximate) algorithm forP .

91

Page 6: Chapter 3 · In Chap. 2, we have seen that, in some cases, standard algorithm design techniques, such as local search or greedy techniques, although inadequate to obtain the optimal

Chapter 3

APPROXIMATION

CLASSES

Program 3.1: Greedy Sat

input SetC of disjunctive clauses on a set of variablesV;output Truth assignmentf : V 7→ {TRUE,FALSE};begin

for all v∈V do f (v) := TRUE;repeat

Let l be the literal that occurs in the maximum number ofclauses inC (solve ties arbitrarily);

LetCl be the set of clauses in whichl occurs;LetCl be the set of clauses in whichl occurs;Let vl be the variable corresponding tol ;if l is positivethenbegin

C := C−Cl ;Deletel from all clauses inCl ; Delete all empty clauses inC

endelsebegin

f (vl ) := FALSE; C := C−Cl ;Deletel from all clauses inCl ; Delete all empty clauses inC

enduntil C = /0;return f

end.

MAXIMUM KNAPSACK is an example of a 2-approximable problem. Inthe previous chapter, we have seen several other examples ofapproximableproblems, and more examples will be shown in this chapter andin thefollowing ones.

Let us now consider MAXIMUM SATISFIABILITY . For this problem,we have already shown in Sect. 2.6 a randomized algorithm whose ex-pected performance ratio is bounded by 2. We now show a deterministic2-approximate algorithm for MAXIMUM SATISFIABILITY which runs inpolynomial time (namely, Program 3.1), that is a simple example of apply-ing the greedy technique and can be considered as a “derandomized” ver-sion of the algorithm shown in the previous chapter (a different approachbased on the local search technique can also be followed in order to obtaina similar result, as stated in Exercise 3.1).

Program 3.1 is a polynomial-time 2-approximate algorithm for MAXI -Theorem 3.2 I

MUM SATISFIABILITY .

Given an instance withc clauses, we prove, by induction on the number ofPROOF

92

Page 7: Chapter 3 · In Chap. 2, we have seen that, in some cases, standard algorithm design techniques, such as local search or greedy techniques, although inadequate to obtain the optimal

Section 3.1

APPROXIMATE

SOLUTIONS WITH

GUARANTEED

PERFORMANCE

variables, that Program 3.1 always satisfies at leastc/2 clauses. Since nooptimal solution can have value larger thanc, the theorem will follow.

The result is trivially true in the case of one variable. Let us assume thatit is true in the case ofn−1 variables(n > 1) and let us consider the casein which we haven variables. Letv be the variable corresponding to theliteral which appears in the maximum number of clauses. Letc1 be thenumber of clauses in whichv appears positive andc2 be the number ofclauses in whichv appears negative. Without loss of generality supposethat c1 ≥ c2, so that the algorithm assigns the valueTRUE to v. Afterthis assignment, at leastc− c1 − c2 clauses, onn− 1 variables, must bestill considered. By inductive hypothesis, Program 3.1 satisfies at least(c−c1−c2)/2 such clauses. Hence, the overall number of satisfied clausesis at leastc1 +(c−c1−c2)/2≥ c/2. QED

Within the class NPO, the class of problems that allow polynomial-timer-approximate algorithms (or, equivalently,ε-approximate algorithms)plays a very important role. In fact, the existence of a polynomial-timer-approximate algorithm for an NP-hard optimization problem shows that,despite the inherent complexity of finding the exact solution of the prob-lem, such a solution can somehow be approached.

APX is the class of allNPO problemsP such that, for some r≥ 1, there J Definition 3.9Class APXexists a polynomial-time r-approximate algorithm forP .

As shown above and in the previous chapter, MAXIMUM SATISFIABIL -ITY , MAXIMUM KNAPSACK, MAXIMUM CUT, M INIMUM BIN PACK-ING, M INIMUM GRAPH COLORING restricted to planar graphs, MINI -MUM SCHEDULING ON IDENTICAL MACHINES, and MINIMUM VERTEX

COVER are all in APX.The definition of the class APX provides a first important notion for char-

acterizing NPO problems with respect to their degree of approximability.For several important NPO problems, in fact, it can be shown that they donot allow anyr-approximate algorithm, unless P= NP. In other words,for these problems, approximate solutions with guaranteedperformanceare as hard to determine as the optimal solutions. This meansthat, underthe hypothesis that P6= NP, the class APX is strictly contained in the classNPO.

In the next subsection we will show that MINIMUM TRAVELING

SALESPERSONis a problem for which determining approximate solutionswith constant bounded performance ratio is computationally intractable.Other NPO problems that do not belong to APX, such as MAXIMUM

CLIQUE and MAXIMUM INDEPENDENT SET, will be seen in Chap. 6,where some techniques needed to prove such results will alsobe provided.

93

Page 8: Chapter 3 · In Chap. 2, we have seen that, in some cases, standard algorithm design techniques, such as local search or greedy techniques, although inadequate to obtain the optimal

Chapter 3

APPROXIMATION

CLASSES

3.1.3 Approximability and non-approximability of TSP

M INIMUM TRAVELING SALESPERSONis an important example of an op-timization problem that cannot ber-approximated, no matter how large isthe performance ratior.

If M INIMUM TRAVELING SALESPERSONbelongs toAPX, thenP= NP.Theorem 3.3 I

The result is proved by reduction from the HAMILTONIAN CIRCUITPROOF

decision problem. HAMILTONIAN CIRCUIT is the problem of decid-ing whether a directed graph admits a circuit which passes exactly oncethrough every node: this problem is known to be NP-complete. LetG = (V,E) be an instance of HAMILTONIAN CIRCUIT with |V| = n. Forany r ≥ 1, we construct an instance of MINIMUM TRAVELING SALES-PERSONsuch that if we had a polynomial-timer-approximate algorithmfor M INIMUM TRAVELING SALESPERSON, then we could decide whetherthe graphG has a Hamiltonian circuit in polynomial time. From this con-struction the theorem will then follow.

Given G = (V,E), the instance of MINIMUM TRAVELING SALESPER-SON is defined on the same set of nodesV and with distances

d(vi ,v j) =

{

1 if (vi ,v j) ∈ E,1+nr otherwise.

This instance of MINIMUM TRAVELING SALESPERSONhas a solution ofmeasuren if and only if the graphG has a Hamiltonian circuit: in thatcase, the next smallest approximate solution has measure atleastn(1+ r)and its performance ratio is hence greater thanr. Besides, ifG has noHamiltonian circuit, then the optimal solution has measureat leastn(1+r).Therefore, if we had a polynomial-timer-approximate algorithm for MIN-IMUM TRAVELING SALESPERSON, we could use it to decide whetherGhas a Hamiltonian circuit in the following way: we apply the approxima-tion algorithm to the instance of MINIMUM TRAVELING SALESPERSON

corresponding toG and we answerYES if and only if it returns a solutionof measuren.QED

If P 6= NP, thenAPX ⊂ NPO.Corollary 3.4 I

The hardness of approximating MINIMUM TRAVELING SALESPERSON

significantly reduces if we make suitable assumptions on theproblem in-stances. In particular, recall that MINIMUM METRIC TRAVELING SALES-PERSONis defined as MINIMUM TRAVELING SALESPERSONrestricted toinstances that satisfy the triangular inequality (see Sect. 2.1.3). Note also

94

Page 9: Chapter 3 · In Chap. 2, we have seen that, in some cases, standard algorithm design techniques, such as local search or greedy techniques, although inadequate to obtain the optimal

Section 3.1

APPROXIMATE

SOLUTIONS WITH

GUARANTEED

PERFORMANCE

that, as a particular case, all instances of MINIMUM TRAVELING SALES-PERSONwhich make use of the Euclidean distance satisfy the triangularinequality.

From a complexity point of view, MINIMUM TRAVELING SALESPER-SON does not really become easier when the triangular inequality is sat-isfied: indeed, it remains NP-hard. From an approximation point ofview the situation is quite different and MINIMUM METRIC TRAVELING

SALESPERSONcan be shown to be, in a sense, “easier” than MINIMUM

TRAVELING SALESPERSON. In fact, we now define a 3/2-approximatepolynomial-time algorithm for MINIMUM METRIC TRAVELING SALES-PERSON, calledChristofides’ algorithm.

To this aim, let us first introduce some definitions and preliminary resultsthat are needed for understanding and analyzing the algorithm.

A multigraph is a pairM = (V,F) whereV is a finite set of nodes andF is a multiset of edges. Aweighted multigraphis a multigraph where aweight c(e) is associated to each edgee∈ F. A walk on a multigraph isa sequence of nodes(v1, . . . ,vm), where each node may appear more thanonce and such that, for everyi with 1≤ i < m, there is an edge connectingvi andvi+1. A walk (v1, . . . ,vm) is said to beclosedif v1 = vm. An Eulerianwalk is a closed walk in which each node is visited at least once andeachedge is traversed exactly once. A multigraph isEulerian if it admits anEulerian walk. For example, the multigraph of Fig. 3.1 is an Euleriangraph since the walk

(v1,v2,v3,v5,v6,v4,v3,v2,v1,v6,v5,v4,v1)

is Eulerian.

v1

v2 v3

v4

v5v6Figure 3.1An Eulerian multigraph

It is well-known that a polynomial-time algorithm exists that, given ininput a multigraphM, decides whetherM is Eulerian and, eventually, re-turns an Eulerian walk onM (see Bibliographical notes). Christofides’

95

Page 10: Chapter 3 · In Chap. 2, we have seen that, in some cases, standard algorithm design techniques, such as local search or greedy techniques, although inadequate to obtain the optimal

Chapter 3

APPROXIMATION

CLASSES

algorithm is based on this fact and on the possibility of extracting a tourfrom an Eulerian walk, as stated in the following lemma.

Let G= (V,E) be a complete weighted graph satisfying the triangular in-Lemma 3.5 I

equality and let M= (V,F) be any Eulerian multigraph over the same setof nodes such that all edges between two nodes u and v in M have thesame weight as the edges(u,v) in G. Then, we can find in polynomial timea tour I in G whose measure is at most equal to the sum of the weights ofthe edges in M.

Let w be any Eulerian walk overM. Since all nodesv1, . . . ,vn ap-PROOF

pear at least once in the walk, there must exist at least one permutationπ(1), . . . ,π(n) of the integers in{1, . . . ,n} such thatw can be writtenas(vπ(1),α1,vπ(2),α2, . . . ,vπ(n),αn,vπ(1)) where the symbolsα1, . . . ,αn de-note (possibly empty) sequences of nodes (for example, sucha permutationcan be obtained by considering the first occurrences of all nodes). Dueto the triangular inequality, the weight of any edge(vπ( j),vπ( j+1)), with1≤ j < n, is no greater than the total weight of the path(vπ( j),α j ,vπ( j+1))and the weight of the edge(vπ(n),vπ(1)) is no greater than the total weightof the path(vπ(n),αn,vπ(1)). Hence, if we consider the tourI correspondingto permutationπ, the measure ofI is at most equal to the total weight ofthe Eulerian walkw, that is, the sum of the weights of the edges inM.QED

Given an instanceG of M INIMUM METRIC TRAVELING SALESPER-SON, a general approach to approximately solve this instance could thenconsists of the following steps: (1) compute a spanning treeT of G in orderto visit all nodes, (2) starting fromT, derive a multigraphM satisfying thehypothesis of the previous lemma, (3) compute an Eulerian walk w on M,and (4) extract fromw a tour according to the proof of the lemma.

The only unspecified step of this approach is how the multigraph M isderived fromT. A simple way to perform this step consists of just doublingall edges inT: that is, for each edge(u,v) in T, M contains two copiesof this edge with the same weight. It can be easily shown that such analgorithm returns a tour whose performance ratio is boundedby 2 (seeExercise 3.5).

A more sophisticated application of this approach is shown in Pro-gram 3.2 where the multigraphM is obtained by adding toT the edgesof a minimum weight perfect matching among the vertices inT of odddegree. The following result shows that this new algorithm provides a sen-sibly better performance ratio.

Given an instance G ofM INIMUM METRIC TRAVELING SALESPERSON,Theorem 3.6 I

96

Page 11: Chapter 3 · In Chap. 2, we have seen that, in some cases, standard algorithm design techniques, such as local search or greedy techniques, although inadequate to obtain the optimal

Section 3.1

APPROXIMATE

SOLUTIONS WITH

GUARANTEED

PERFORMANCE

Program 3.2: Christofides

input Weighted complete graphG = (V,E);output Tour I ;begin

Find a minimum spanning treeT = (V,ET) in G;Let C be the set of nodes inT with odd degree;Find a minimum weight perfect matchingH in the subgraph ofG induced byC;Create a multigraphM = (V,ET ∪H);Find a Eulerian walkw in M;Extract a tourI from w (according to the proof of Lemma 3.5);return I

end.

Christofides’ algorithm returns, in polynomial time, a solution of G whoseperformance ratio is at most 3/2.

Let us consider the multigraphM = (V,ET ∪H) and an Eulerian walkw PROOF

on M. Let us denote byc(T) and c(H) the sums of the weights of theedges belonging toT and H, respectively. SinceM clearly satisfies thehypothesis of Lemma 3.5, we can find in polynomial time a tourI suchthat

m(G, I) ≤ c(T)+c(H). (3.1)

We now prove the following two facts.

Fact 1: m∗(G)≥ 2c(H). Let (vi1, . . . ,vi2|H|) be the sequence of odd-degree

vertices ofT in the order in which they appear in an optimal tourI∗.Let H1 andH2 be the following two matchings:

H1 = {(vi1,vi2),(vi3,vi4), . . . ,(vi2|H|−1,vi2|H|

)}

andH2 = {(vi2,vi3), . . . ,(vi2|H|

,vi1)}.

By making use of the triangular inequality, we have thatm∗(G) ≥c(H1)+ c(H2), wherec(Hi) denotes the sum of the weights of theedges inHi, for i = 1,2. SinceH is a minimum weight perfectmatching, we have that bothc(H1) and c(H2) are greater than orequal toc(H) and, hence,m∗(G) ≥ 2c(H).

Fact 2: c(T) ≤ m∗(G). In order to prove this fact, it is enough to observethat a tour is also a spanning tree (plus one additional edge): sinceTis a minimum spanning tree, we havec(T) ≤ m∗(G).

97

Page 12: Chapter 3 · In Chap. 2, we have seen that, in some cases, standard algorithm design techniques, such as local search or greedy techniques, although inadequate to obtain the optimal

Chapter 3

APPROXIMATION

CLASSES

From Eq. 3.1 and from the above two facts, we then have thatm(G, I)≤m∗(G)+m∗(G)/2 = 3m∗(G)/2.

As far as the running time is concerned, it is easy to see that the mostexpensive step is the computation of the minimum weight perfect match-ing. This task can, indeed, be performed in polynomial time by means ofa primal-dual algorithm (see Bibliographical notes).QED

Let us consider the instanceG of M INIMUM METRIC TRAVELING SALESPER-Example 3.2 I

SON consisting of eight cities (i.e., Amsterdam, Berlin, Geneva, Milan, Prague,Rome, Warsaw, and Wien) with distances shown in Fig. 3.2 (these distances arethe real road-distances between the specified cities).

685 925 1180 960 1755 1235 1180

1160 1105 340 1530 585 630

325 950 880 1575 1025

870 575 1495 830

1290 625 290

1915 1130

795

AMS

BER

GEN

MIL

PRA

ROM

WAR

WIE

Figure 3.2An instance of MINIMUM

METRIC TRAVELINGSALESPERSON

In Fig. 3.3(a) the minimum spanning treeT of G computed in the first stepof Christofides’ algorithm is shown: note that, in this tree,there are six odd-degree nodes (that is, Amsterdam, Berlin, Geneva, Milan, Rome, and Warsaw).A minimum weight perfect matchingH among these six nodes consists of edgesAmsterdam-Geneva, Berlin-Warsaw, and Milan-Rome. In Fig.3.3(b) the multi-graphM obtained by joiningT andH is given: clearly, this is an Eulerian graphsatisfying the hypothesis of Lemma 3.5. An Eulerian walk onM starting fromAmsterdam is

AMS-BER-WAR-BER-PRA-WIE-MIL-ROM-MIL-GEN-AMS.

By considering only the first occurrence of each city in the walk, we obtain theapproximate tour shown in Fig 3.3(c) whose measure is 5395. In Fig 3.3(d) theoptimal tour is given: the corresponding optimal measure is5140, that is, about5% better than the measure of the approximate tour.

As a consequence of Theorem 3.6, we have that MINIMUM METRIC

TRAVELING SALESPERSONbelongs to the class APX. The next exampleshows that the bound of the theorem is tight: that is, there exists a familyof weighted complete graphs such that Christofides’ algorithm returns asolution whose measure is asymptotically 50% greater than the measure ofan optimal tour.

98

Page 13: Chapter 3 · In Chap. 2, we have seen that, in some cases, standard algorithm design techniques, such as local search or greedy techniques, although inadequate to obtain the optimal

Section 3.1

APPROXIMATE

SOLUTIONS WITH

GUARANTEED

PERFORMANCE

Amsterdam Berlin Warsaw

Prague

Wien

Milan

Rome

Geneva

(a) The spanning tree T

Amsterdam Berlin Warsaw

Prague

Wien

Milan

Rome

Geneva

(b) The multigraph M

Amsterdam Berlin Warsaw

Prague

Wien

Milan

Rome

Geneva

(c) The approximate tour I

Amsterdam Berlin Warsaw

Prague

Wien

Milan

Rome

Geneva

(d) The optimal tour I*

Figure 3.3A sample application ofChristofides’ algorithm

For any positive integern, let us consider the instanceGn of M INIMUM METRIC J Example 3.3TRAVELING SALESPERSONshown in Fig. 3.4(a), where all distances that are notexplicitly specified must be assumed to be computed according to the Euclideandistance. It is easy to see that one possible minimum spanning tree is the tourshown in the figure without the edge(a1,an+1). If Christofides’ algorithm choosesthis spanning tree, then the approximate tour shown in Fig. 3.4(a) results: notethat this tour has measure 3n+2ε. On the contrary, the optimal tour is shown inFig. 3.4(b) and has measure 2n+1+4ε. As n grows to infinity, the ratio betweenthese two measures approaches the bound 3/2.

Until now Christofides’ algorithm is the best known approximation al-gorithm for MINIMUM METRIC TRAVELING SALESPERSON. While inthe Euclidean case arbitrarily good polynomial-time approximation al-gorithms can be found (see Bibliographical notes), no polynomial-timeapproximation algorithm with a better guaranteed performance ratio isknown for MINIMUM METRIC TRAVELING SALESPERSON, neither it isknown whether the existence of any such algorithm would imply P= NP.

99

Page 14: Chapter 3 · In Chap. 2, we have seen that, in some cases, standard algorithm design techniques, such as local search or greedy techniques, although inadequate to obtain the optimal

Chapter 3

APPROXIMATION

CLASSES...

1

11

1+ε

a1

a2 a3 a4 an

an+1

bnb1 b2 b3

(a) The approximate tour

...

a1a2 a3 a4 an

an+1

bnb1 b2 b3

(b) The optimal tour

...

1+ε

1+ε 1+ε

1

11+ε 1+εFigure 3.4

Worst case of Christofides’algorithm

3.1.4 Limits to approximability: The gap technique

From the point of view of practical applications, it may be observed thatknowing that a problem belongs to APX, while interesting in itself, is onlypartially satisfactory. In fact, in some cases, the existence of guaranteedapproximate solutions with large relative errors (e.g., a 50% error as inthe case of MAXIMUM SATISFIABILITY or MINIMUM VERTEX COVER)may not be enough for practical purposes. We may be interested in findingstronger approximations, with much smaller relative errors (say 1%). Withrespect to this need, the optimization problems that belongto APX maybehave quite differently. For some problems, not only we canfind tightapproximate solutions but we can even find arbitrarily good approximatesolutions. For such problems we can construct particular polynomial-timealgorithms, called polynomial-time approximation schemes (see Sects. 2.5and 3.2), that, given an instancex of the problem and a constantr > 1, pro-duce anr-approximate solution forx. For other problems (unfortunately,the vast majority of problems in APX) the performance ratio can only bereduced up to a certain point: sometimes the approximation techniquescan even lead to very tight approximate solutions, but then athresholdtexists such thatr-approximability, withr < t, becomes computationallyintractable.

100

Page 15: Chapter 3 · In Chap. 2, we have seen that, in some cases, standard algorithm design techniques, such as local search or greedy techniques, although inadequate to obtain the optimal

Section 3.1

APPROXIMATE

SOLUTIONS WITH

GUARANTEED

PERFORMANCE

In order to prove this latter type of result, a simple but powerful tech-nique is frequently used. Such technique is known asgap techniqueand isstrictly related to the technique that we have used for proving the non-approximability of MINIMUM TRAVELING SALESPERSON. The tech-nique will now be described in the case of minimization problems but itcan also be applied to maximization problems by performing simple mod-ifications to our exposition.

Let P′ be anNP-complete decision problem and letP be anNPO min- J Theorem 3.7

imization problem. Let us suppose that there exist two polynomial-timecomputable functions f: IP ′ 7→ IP and c: IP ′ 7→ IN and a constantgap> 0,such that, for any instance x ofP

′,

m∗( f (x)) =

{

c(x) if x is a positive instance,c(x)(1+gap) otherwise.

Then no polynomial-time r-approximate algorithm forP with r < 1+gap

can exist, unlessP= NP.

Suppose we have a polynomial-timer-approximate algorithmA with r < PROOF

1+ gap for problemP . We can make use of this algorithm for solvingproblemP

′ in polynomial time in the following way. Given an instancexof P

′, we computef (x) and then we apply the approximation algorithmA

to f (x). Let us distinguish the following two cases.

1. x is a negative instance. By hypothesis, in this casem∗( f (x)) ≥c(x)(1+gap) and,a fortiori, m( f (x),A(x)) ≥ c(x)(1+gap).

2. x is a positive instance. In this case, sinceA is an r-approximatealgorithm, we have that

m( f (x),A(x))m∗( f (x))

≤ r < 1+gap.

By hypothesis,m∗( f (x)) = c(x). Hence,m( f (x),A(x)) < c(x)(1+gap).

Therefore,x is a positive instance ofP ′ if and only if m( f (x),A(x)) <c(x)(1+ gap), and we would be able to solve problemP ′ in polynomialtime. SinceP

′ is NP-complete, this would imply P= NP. QED

Let us consider MINIMUM GRAPH COLORING. For this problem, the gap tech-J Example 3.4nique can be applied by reduction from the coloring problem for planar graphs.In fact, while a well-known result states that any planar graph is colorable with

101

Page 16: Chapter 3 · In Chap. 2, we have seen that, in some cases, standard algorithm design techniques, such as local search or greedy techniques, although inadequate to obtain the optimal

Chapter 3

APPROXIMATION

CLASSES

at most four colors (see Bibliographical notes), the problem of deciding whethera planar graph is colorable with at most three colors is NP-complete. Hence, inthis case, the gap is 1/3 and we can hence conclude that no polynomial-timer-approximate algorithm for MINIMUM GRAPH COLORING can exist withr < 4/3,unless P= NP. Actually, much stronger results hold for the graph coloring prob-lem: it has been proved that, if P6= NP, then no polynomial-time algorithm canprovide an approximate solution whatsoever (that is, MINIMUM GRAPH COLOR-ING belongs to NPO−APX).

The considerations of the previous example can be extended to showthat, for any NPO minimization problemP , if there exists a constantksuch that it is NP-hard to decide whether, given an instancex, m∗(x) ≤ k,then no polynomial-timer-approximate algorithm forP with r < (k+1)/kcan exist, unless P= NP (see Exercise 3.8). Another application of thegap technique has been shown in the proof of Theorem 3.3: in that case,actually, we have seen that the constantgap can assume any value greaterthan 0. Other results which either derive bounds on the performance ratiothat can be achieved for particular optimization problems or prove that aproblem does not allow a polynomial-time approximation scheme can beobtained by means of a sophisticated use of the gap technique. Such resultswill be discussed in Chap. 6.

3.2 Polynomial-time approximation schemes

AS WE noticed before, for most practical applications, we need toap-proach the optimal solution of an optimization problem in a stronger

sense than it is allowed by anr-approximate algorithm. Clearly, if theproblem is intractable, we have to restrict ourselves to approximate solu-tions, but we may wish to find better and better approximationalgorithmsthat bring us as close as possible to the optimal solution. Then, in orderto obtainr-approximate algorithms with better performances, we may bealso ready to pay the cost of a larger computation time, a costthat, as wemay expect, will increase with the inverse of the performance ratio.

LetP be anNPOproblem. An algorithmA is said to be apolynomial-timeDefinition 3.10Polynomial-time

approximation scheme

I

approximation scheme (PTAS) for P if, for any instance x ofP and any ra-tional value r> 1, A when applied to input(x, r) returns an r-approximatesolution of x in time polynomial in|x|.

While always being polynomial in|x|, the running time of a PTAS mayalso depend on 1/(r −1): the better is the approximation, the larger maybe the running time. In most cases, we can indeed approach theoptimal so-lution of a problem arbitrarily well, but at the price of a dramatic increase

102

Page 17: Chapter 3 · In Chap. 2, we have seen that, in some cases, standard algorithm design techniques, such as local search or greedy techniques, although inadequate to obtain the optimal

Section 3.2

POLYNOMIAL -TIME

APPROXIMATION

SCHEMES

Problem 3.1: Minimum Partition

INSTANCE: Finite setX of items, for eachxi ∈ X a weightai ∈ Z+.

SOLUTION: A partition of the items into two setsY1 andY2.

MEASURE: max{∑xi∈Y1ai ,∑xi∈Y2

ai}.

Program 3.3: Partition PTAS

input Set of itemsX with integer weightsai , rationalr > 1;output Partition ofX into two setsY1 andY2;begin

if r ≥ 2 then return X, /0elsebegin

Sort items in non-increasing order with respect to their weight;(*Let (x1, . . . ,xn) be the obtained sequence*)k(r) := d(2− r)/(r −1)e;(* First phase *)Find an optimal partitionY1, Y2 of x1, . . . ,xk(r);(* Second phase *)for j := k(r)+1 to n do

if ∑xi∈Y1ai ≤ ∑xi∈Y2

ai thenY1 := Y1∪{x j}

elseY2 := Y2∪{x j};

return Y1,Y2

end;end.

in the computation cost. In other cases, we may construct approximationschemes whose running time is polynomial both in the size of the instanceand in the inverse of the required degree of approximation. In such casesthe possibility of approaching the optimal solution in practice with arbi-trarily small error is definitely more concrete. Problems that allow thisstronger form of approximation are very important from the practical pointof view and will be discussed in the Sect. 3.3.

Let us now consider MINIMUM PARTITION, that is, Problem 3.1: a sim-ple approach to obtain an approximate solution for this problem is basedon the greedy technique. Such an approach consists in sorting items innon-increasing order and then inserting them into setY1 or into setY2 ac-cording to the following rule: always insert the next item inthe set ofsmaller overall weight (breaking ties arbitrarily). It is possible to show

103

Page 18: Chapter 3 · In Chap. 2, we have seen that, in some cases, standard algorithm design techniques, such as local search or greedy techniques, although inadequate to obtain the optimal

Chapter 3

APPROXIMATION

CLASSES

that this procedure always returns a solution whose performance ratio isbounded by 7/6 and that this bound is indeed tight (see Theorem 2.7, in thecasep = 2, and Exercise 2.6).

Program 3.3 basically consists in deriving an optimal solution of thesubinstance including thek heaviest items and, subsequently, extendingthis solution by applying the greedy approach previously described. Thenext result shows that this algorithm provides a stronger approximation forM INIMUM PARTITION.

Y1 Y2

ah

w(Y1)

w(Y2)

L

w(Y1)-ah

at most ah/2

Figure 3.5The analysis of Program 3.3

Program 3.3 is a polynomial-time approximation scheme forM INIMUMTheorem 3.8 I

PARTITION.

Let us first prove that, given an instancex of M INIMUM PARTITION andPROOF

a rationalr > 1, the algorithm provides an approximate solution(Y1,Y2)whose performance ratio is bounded byr. If r ≥ 2, then the solution(X, /0)is clearly anr-approximate solution since any feasible solution has mea-sure at least equal to half of the total weightw(X) = ∑xi∈X ai . Let us thenassume thatr < 2 and letw(Yi) = ∑xj∈Yi

a j , for i = 1,2, andL = w(X)/2.Without loss of generality, we may assume thatw(Y1) ≥ w(Y2) and thatxh

is the last item that has been added toY1 (see Fig. 3.5). This implies thatw(Y1)−ah ≤ w(Y2). By addingw(Y1) to both sides and dividing by 2 weobtain that

w(Y1)−L ≤ah

2.

If xh has been inserted inY1 during the first phase of the algorithm, thenit is easy to see that the obtained solution is indeed an optimal solution.Otherwise (that is,xh has been inserted during the second phase), we have

104

Page 19: Chapter 3 · In Chap. 2, we have seen that, in some cases, standard algorithm design techniques, such as local search or greedy techniques, although inadequate to obtain the optimal

Section 3.2

POLYNOMIAL -TIME

APPROXIMATION

SCHEMES

thatah ≤ a j , for any j with 1≤ j ≤ k(r), and that 2L ≥ ah(k(r)+1). Sincew(Y1) ≥ L ≥ w(Y2) andm∗(x) ≥ L, the performance ratio of the computedsolution is

w(Y1)

m∗(x)≤

w(Y1)

L≤ 1+

ah

2L≤ 1+

1k(r)+1

≤ 1+1

2−rr−1 +1

= r.

Finally, we prove that the algorithm works in timeO(nlogn+ nk(r)).In fact, we need timeO(nlogn) to sort then items. Subsequently, thefirst phase of the algorithm requires time exponential ink(r) in order toperform an exhaustive search for the optimal solution over thek(r) heaviestitems x1, . . . ,xk(r) and all other steps have a smaller cost. Sincek(r) isO(1/(r −1)), the theorem follows. QED

3.2.1 The class PTAS

Let us now define the class of those NPOproblems for which we can obtainan arbitrarily good approximate solution in polynomial time with respectto the size of the problem instance.

PTAS is the class ofNPO problems that admit a polynomial-time approxi-J Definition 3.11Class PTASmation scheme.

The preceding result shows that MINIMUM PARTITION belongs toPTAS. Let us now see other examples of problems in PTAS. The first exam-ple will also show another application of the algorithmic technique of Pro-gram 3.3, which essentially consists of optimally solving a“subinstance”and, then, extending the obtained solution by applying a polynomial-timeprocedure.

Problem 3.2 models a variant of MAXIMUM KNAPSACK in which thereis a set of types of items and we can take as many copies as we like ofan item of a given type, provided the capacity constraint is not violated(observe that this problem is equivalent to Problem 2.8 withd = 1).

MAXIMUM INTEGER KNAPSACK belongs to the classPTAS. J Theorem 3.9

Given an instanceI of MAXIMUM INTEGER KNAPSACK, we first notice PROOF

that if we relax the integrality constraint on the values of functionc (thatis, if we allow fractions of items to be included in the knapsack), then theoptimal solution can be easily computed as follows. Letxmd be a typeof item with maximal value/size ratio: then, the optimal assignment forthe relaxed problem is given bycr(xmd) = b/amd and cr(xi) = 0 for all

105

Page 20: Chapter 3 · In Chap. 2, we have seen that, in some cases, standard algorithm design techniques, such as local search or greedy techniques, although inadequate to obtain the optimal

Chapter 3

APPROXIMATION

CLASSES

Problem 3.2: Maximum Integer Knapsack

INSTANCE: Finite setX of types of items, for eachxi ∈ X, valuepi ∈ Z+

and sizeai ∈ Z+, positive integerb.

SOLUTION: An assignmentc : X 7→ IN such that∑xi∈X aic(xi) ≤ b.

MEASURE: Total value of the assignment, i.e.,∑xi∈X pic(xi).

Program 3.4: Integer Knapsack Scheme

input SetX of n types of items, valuespi , sizesai , b∈ IN, rationalr > 1;output Assignmentc : X 7→ IN such that∑xi∈X aic(xi) ≤ b;begin

δ := d 1r−1e;

Sort types of items in non-increasing order with respect to their values;(* Let (x1,x2, . . . ,xn) be the sorted sequence *)for i := 1 to n do c(xi) := 0;F := { f | f : X 7→ IN∧∑n

i=1 f (xi) ≤ δ∧∑ni=1ai f (xi) ≤ b};

for all f in F dobegin

k := maximumi such thatf (xi) 6= 0;bk := b−∑k

i=1ai f (xi);Let xmd be the type of items with maximal value/size ratio in{xk, . . . ,xn};f (xmd) := f (xmd)+ bbk/amdc;if ∑xi∈X pi f (xi) ≥ ∑xi∈X pic(xi) then

for i := 1 to n do c(xi) := f (xi);end;return c

end.

other types of items. For any type of itemx, let c(x) = bcr(x)c: sincem∗(I) ≤ bpmd/amd, we have that functionc is a feasible solution ofI suchthat the following holds:

m∗(I)−m(I ,c) ≤ bpmd/amd− pmdbb/amdc ≤ pmd ≤ pmax

wherepmax is the maximal value.The approximation scheme described in Program 3.4 makes useof the

above observation in order to extend a partial solution. Letus first showthat, for any instanceI of MAXIMUM INTEGER KNAPSACK and for anyr > 1, the algorithm indeed returns anr-approximate solution ofI . Let c∗

be an optimal solution ofI . If ∑x∈X c∗(x) ≤ δ, thenm(I ,c) = m∗(I) wherec is the solution returned by the algorithm.

106

Page 21: Chapter 3 · In Chap. 2, we have seen that, in some cases, standard algorithm design techniques, such as local search or greedy techniques, although inadequate to obtain the optimal

Section 3.2

POLYNOMIAL -TIME

APPROXIMATION

SCHEMES

Otherwise (that is,∑x∈X c∗(x) > δ), let (x1,x2, . . . ,xn) be the sequence oftypes of items sorted in non-increasing order with respect to their valuesand letc∗δ be an assignment defined as follows:

c∗δ(xi) =

c∗(xi) if ∑ij=1c∗(x j) ≤ δ,

δ−∑i−1j=1c∗(x j) if ∑i−1

j=1c∗(x j) ≤ δ and∑ij=1 c∗(x j) > δ,

0 otherwise.

Let k be the maximum indexi such thatc∗δ(xi) 6= 0: observe thatc∗δ(xk) ≤ c∗(xk). Clearly, c∗δ ∈ F since ∑n

j=1c∗δ(x j) = δ. Let bk = b−

∑ki=1 aic∗δ(xi), and letxmd be the type of items with maximal value/size

ratio among{xk, . . . ,xn}. Then, m(I ,c) ≥ m(I ,c∗δ) + pmdbbk/amdc andm∗(I) ≤ m(I ,c∗δ)+bkpmd/amd. Therefore,

m∗(I)m(I ,c)

≤m(I ,c∗δ)+bkpmd/amd

m(I ,c∗δ)+ pmdbbk/amdc

≤m(I ,c∗δ)+ (bk/amd−bbk/amdc) pmd

m(I ,c∗δ)

= 1+(bk/amd−bbk/amdc) pmd

m(I ,c∗δ)

≤ 1+pk

δpk=

δ+1δ

,

where the last inequality is due to the fact that(bk/amd−bbk/amdc) pmd≤pmd ≤ pk and thatm(I ,c∗δ) ≥ δpk. From the definition ofδ, it follows thatthe performance ratio is at mostr.

Finally, let us estimate the running time of Program 3.4. Since |F| =O(nδ) (see Exercise 3.9), the overall time is clearlyO(n1+δ), that is,

O(n1+ 1r−1 ). QED

The last example of a polynomial-time approximation schemethat weconsider is a scheme for computing approximate solutions ofMAXIMUM

INDEPENDENT SET restricted to planar graphs. The algorithm is basedon the fact that MAXIMUM INDEPENDENT SET is polynomial-time solv-able when restricted to a special class of graphs, calledk-outerplanar anddefined below.

Given a planar embedding of a planar graphG, the level of a node isinductively defined as follows:

1. All nodes that lie on the border of the exterior face are at level 1.

2. For anyi > 1, if we remove from the embedding all nodes of levelj with 1≤ j < i, then all nodes (if any) that lie on the border of theexterior face of the remaining embedding are at leveli.

107

Page 22: Chapter 3 · In Chap. 2, we have seen that, in some cases, standard algorithm design techniques, such as local search or greedy techniques, although inadequate to obtain the optimal

Chapter 3

APPROXIMATION

CLASSES

A planar graph is said to bek-outerplanar if it admits a k-outerplanarembedding, that is, a planar embedding with maximal node level at mostk.

The embedding shown in Fig. 3.6 is a 6-outerplanar embedding. Indeed, fori =Example 3.5 I

1, . . . ,18, the level of nodevi is di/3e.

v16

v17 v18

v13

v14 v15

v11

v8

v5

v2

v12

v9

v6

v3

v10

v7

v4

v1

Figure 3.6An example of a

6-outerplanar embedding

The following result, whose proof is here omitted (see Bibliographicalnotes), will be used by the approximation scheme.

For any k, MAXIMUM INDEPENDENT SET restricted to k-outerplanarTheorem 3.10 I

graphs can be solved optimally in time O(8kn) where n is the number ofnodes.

The approximation scheme for MAXIMUM INDEPENDENT SET re-stricted to planar graphs exploits this result by considering a cover of theoriginal graph formed byk-outerplanar graphs, where the parameterk de-pends on the required approximation ratio. In particular, the approximationscheme works in the following way (see Program 3.5).

108

Page 23: Chapter 3 · In Chap. 2, we have seen that, in some cases, standard algorithm design techniques, such as local search or greedy techniques, although inadequate to obtain the optimal

Section 3.2

POLYNOMIAL -TIME

APPROXIMATION

SCHEMES

Program 3.5: Independent Set Scheme

input Planar graphG = (V,E), rationalr > 1;output Independent setI ⊆V;begin

k := d1/(r −1)e;Compute a planar embedding ofG (see Bibliographical notes);Compute node levels;(* Let Vi be the set of nodes of leveli *)for i := 0 to k do

beginLetV i be the union of all setsVj with j ≡ i (modk+1);Let Gi be the subgraph ofG induced byV −V i ;(* Gi is k-outerplanar *)Compute a maximal independent setIi onGi ;

endI := Im such that|Im| = max0≤i≤k(|Ii |);return I

end.

Let r be the required approximation ratio andk = d1/(r −1)e. Given aplanar embedding of a planar graphG, for all i with 0≤ i ≤ k, letV i be theset of nodes whose level is congruent toi modulok+ 1 and letGi be thesubgraph ofG induced by all nodes not inV i . Since we have deleted at leastone level everyk+ 1 levels, it is easy to verify thatGi is a k-outerplanargraph: indeed,Gi is a collection of connected components, each with ak-outerplanar embedding. Therefore, we can compute the maximal inde-pendent setIi of Gi in time O(8kn). Let Im be the maximal cardinalityindependent set among{I0, . . . , Ik}.

If I∗ denotes a maximal independent set ofG, then there must exist aninteger r with 0 ≤ r ≤ k such that|Vr ∩ I∗| ≤ |I∗|/(k + 1). Hence, themaximal independent setIr of Gr contains at leastk|I∗|/(k + 1) nodes.Since|Im| ≥ |Ir |, we have that the performance ratio ofIm is at most(k+1)/k ≤ r.

The running time of the algorithm isO(8kkn), since we applyk+1 timesthe exact algorithm fork-outerplanar graphs implied by Theorem 3.10.Hence, we have proved the following result.

MAXIMUM INDEPENDENTSET restricted to planar graphs belongs to theJ Theorem 3.11

classPTAS.

Let us consider the graphG in Fig. 3.6 and assume we wish to find an in-J Example 3.6dependent set onG with performance ratio 3/2. By applying the algorithmdescribed in Program 3.5, we obtaink = 2, which implies that we obtain

109

Page 24: Chapter 3 · In Chap. 2, we have seen that, in some cases, standard algorithm design techniques, such as local search or greedy techniques, although inadequate to obtain the optimal

Chapter 3

APPROXIMATION

CLASSES

three setsV0 = {v7,v8,v9,v16,v17,v18}, V1 = {v1,v2,v3,v10,v11,v12}, andV2 ={v4,v5,v6,v13,v14,v15}. Three possible corresponding maximal independent setsof Gi are I0 = {v1,v5,v10,v14}, I1 = {v4,v8,v13,v18}, andI2 = {v1,v7,v11,v16}.Hence, we obtain that the solution returned by the algorithmcontains 4 nodes.Clearly,m∗(G) = 6: indeed, we can choose exactly one node for every triangleformed by nodes of leveli, for i = 1, . . . ,6. As a consequence, we have thatm∗(G)/m(G, I) = 6/4 = r.

3.2.2 APX versus PTAS

By definition, it is clear that the class PTAS is contained in the class APX.Henceforth, those problems that do not belong to APX, such as MINIMUM

TRAVELING SALESPERSON, a fortiori cannot have a polynomial-time ap-proximation scheme. A natural question hence arises at thispoint: Doesthere exist any NP optimization problem that for some value ofr can ber-approximated in polynomial time, but which does not allow a polynomial-time approximation scheme? In other words the question is whether PTAS

is strictly contained in APX. The answer is yes, provided that P6= NP.Again the main technique for proving the non-existence of a PTAS for anNPO problem is the gap technique.

If P 6= NP, then M INIMUM BIN PACKING does not belong to the classTheorem 3.12 I

PTAS.

We show that, if P6= NP, then nor-approximate algorithm for MINIMUMPROOF

BIN PACKING can be found withr ≤ 3/2− ε, for anyε > 0. To this aim,let us consider the PARTITION decision problem which consists in decid-ing whether a given set of weighted items can be partitioned into two setsof equal weight: this problem is NP-complete (see Bibliographical notesof Chap. 2). Given an instancex of PARTITION, let B be the sum of theweights of all items. We then define the corresponding instancex′ of M IN-IMUM BIN PACKING as follows: for each item ofx of weightw, x′ has anitem of size 2w/B (observe that we can always assumew≤B/2 since, oth-erwise,x is a negative instance). Ifx is a positive instance, thenm∗(x′) = 2.Otherwise,m∗(x′) = 3. From Theorem 3.7, it then follows the 3/2 lowerbound on the approximability of MINIMUM BIN PACKING. Therefore,unless P= NP, M INIMUM BIN PACKING does not admit a PTAS.QED

Since in Sect. 2.2.2 we have shown that MINIMUM BIN PACKING be-longs to the class APX, the next corollary immediately follows.

If P 6= NP, thenPTAS ⊂ APX.Corollary 3.13 I

110

Page 25: Chapter 3 · In Chap. 2, we have seen that, in some cases, standard algorithm design techniques, such as local search or greedy techniques, although inadequate to obtain the optimal

Section 3.3

FULLY

POLYNOMIAL -TIME

APPROXIMATION

SCHEMES

Other examples of problems that belong to APX but do not admit a PTAS

are MAXIMUM SATISFIABILITY , MAXIMUM CUT, and MINIMUM MET-RIC TRAVELING SALESPERSON. Actually, the negative results on the ex-istence of a PTAS for these problems make use of the gap technique in amore sophisticated way, as we will see in later chapters.

3.3 Fully polynomial-time approximation schemes

THE RUNNING time of the approximation schemes we have describedin Chap. 2 and in this chapter depends on both the size of the input

x and the inverse of the desired degree of approximationr −1: the betterthe approximation, the greater the running time. While, by definition ofa PTAS, the running time must be polynomial in the size of the inputx,the dependency on the quality of approximation may be very heavy. Forexample, in the case of MINIMUM PARTITION and MAXIMUM INDEPEN-DENT SET restricted to planar graphs, the dependency of the running timeon the performance ratio has been shown to be exponential in 1/(r −1).

In some cases, such bad behavior strongly hampers the advantages ofhaving a polynomial-time approximation scheme. In fact, the increase inthe running time of the approximation scheme with the degreeof approxi-mation may prevent any practical use of the scheme.

3.3.1 The class FPTAS

A much better situation arises when the running time is polynomial bothin the size of the inputand in the inverse of the performance ratio.

LetP be anNPOproblem. An algorithmA is said to be afully polynomial- J Definition 3.12Fully polynomial-timeapproximation scheme

time approximation scheme (FPTAS) for P if, for any instance x ofP andfor any rational value r> 1, A with input (x, r) returns an r-approximatesolution of x in time polynomial both in|x| and in1/(r −1).

MAXIMUM KNAPSACK is an example of an optimization problem thatadmits an FPTAS: Program 2.9, in fact, is a fully polynomial-time approxi-mation scheme for this problem, since its running time isO(r|x|3/(r −1)).

FPTAS is the class ofNPO problems that admit a fully polynomial-timeJ Definition 3.13Class FPTASapproximation scheme.

111

Page 26: Chapter 3 · In Chap. 2, we have seen that, in some cases, standard algorithm design techniques, such as local search or greedy techniques, although inadequate to obtain the optimal

Chapter 3

APPROXIMATION

CLASSES

Clearly, the class FPTAS is contained in the class PTAS. Henceforth,those problems that do not belong to PTAS (such as MINIMUM TRAVEL-ING SALESPERSON, which is not even in APX, or MINIMUM BIN PACK-ING, which is in APX but not in PTAS) a fortiori cannot have a fullypolynomial-time approximation scheme.

The existence of a FPTAS for an NP-hard combinatorial optimizationproblems provides evidence that, for such a problem, despite the difficultyof finding an optimal solution, for most practical purposes the solution canbe arbitrarily and efficiently approached.

3.3.2 The variable partitioning technique

In Sect. 2.5 we have shown how to derive a FPTAS for MAXIMUM KNAP-SACK. Let us now consider the related MAXIMUM PRODUCT KNAPSACK

problem in which the measure function is the product of the values of thechosen items. We will prove that also MAXIMUM PRODUCT KNAPSACK

admits a FPTAS. In order to prove the result, we introduce a new technique,called variable partitioning, which is a variant of the fixed partitioningtechnique that we described in Sect. 2.5.

Observe that, in the case of MAXIMUM PRODUCT KNAPSACK, thevalue of the objective function can be as large aspn

max, wherepmax is themaximum value andn is the number of items. Therefore, if we make useof the fixed partitioning technique, it is possible to see that, when we di-vide the range into a polynomial number of equal size intervals (in orderto obtain a polynomial-time algorithm), the relative errorof the obtainedsolution cannot be bounded by any constant smaller than 1. The idea of thevariable partitioning technique then consists in dividingthe range of possi-ble measures into a suitable collection of polynomially many variable sizeintervals.

More precisely, given an arbitrary instancex and given a rationalr > 1,we divide the range of possible measures into the following intervals:

{(0,δ1],(δ1,δ2], . . . ,(δt−1,δt ]},

whereε = (r −1)/r andδ j = (1+ ε2n) j for j = 1, . . . , t. Notice that, since

the range of the possible measures is(0, pnmax], t is the smallest integer such

that(1+ε/(2n))t ≥ pnmax. Hence,t is O(n2

ε log pmax) and the algorithm has

time complexityO(n3

ε logpmax).Concerning the approximation, letY be the solution returned by the al-

gorithm and assume thatm(x,Y) ∈ (δi−1,δi ]: hence, the optimal measuremust be contained in(δi−1,δi+n−1]. It is then possible to show thatY sat-

112

Page 27: Chapter 3 · In Chap. 2, we have seen that, in some cases, standard algorithm design techniques, such as local search or greedy techniques, although inadequate to obtain the optimal

Section 3.3

FULLY

POLYNOMIAL -TIME

APPROXIMATION

SCHEMES

isfies the following inequality:

m∗(x)−m(x,Y)

m∗(I)≤ ε =

r −1r

(see Exercise 3.11), which implies that the performance ratio of Y is atmostr. Thus the following theorem derives.

MAXIMUM PRODUCT KNAPSACK belongs to the classFPTAS. J Theorem 3.14

3.3.3 Negative results for the class FPTAS

We now present some negative results which show that, unfortunately,many problems are not in FPTAS.

Actually, a first general result drastically reduces the class of combinato-rial problems in PTAS which admit a FPTAS since it excludes the existenceof a fully polynomial-time approximation scheme for all those optimiza-tion problems for which the value of the optimal measure is polynomiallybounded with respect to the length of the instance. This result, in turn, willallow us to show that the containment of FPTAS in PTAS is proper.

An optimization problem ispolynomially boundedif there exists a poly-J Definition 3.14Polynomially boundedoptimization problem

nomial p such that, for any instance x and for any y∈ SOL(x), m(x,y) ≤p(|x|).

No NP-hard polynomially bounded optimization problem belongs to the J Theorem 3.15

classFPTAS unlessP= NP.

Let P be an NP-hard polynomially bounded maximization problem (the PROOF

minimization case would lead to a similar proof). Suppose wehad a FPTAS

A for P which, for any instancex and for any rationalr > 1, runs in timebounded byq(|x|,1/(r −1)) for a suitable polynomialq. SinceP is poly-nomially bounded, there exists a polynomialp such that, for any instancex, m∗(x) ≤ p(|x|). If we chooser = 1+1/p(|x|), thenA(x, r) provides anoptimal solution ofx. Indeed, sinceA is a FPTAS, we have that

m∗(x)m(x,A(x, r))

≤ r =p(|x|)+1

p(|x|),

that is,

m(x,A(x, r)) ≥ m∗(x)p(|x|)

p(|x|)+1= m∗(x)−

m∗(x)p(|x|)+1

> m∗(x)−1,

113

Page 28: Chapter 3 · In Chap. 2, we have seen that, in some cases, standard algorithm design techniques, such as local search or greedy techniques, although inadequate to obtain the optimal

Chapter 3

APPROXIMATION

CLASSES

where the last inequality is due to the fact thatm∗(x) ≤ p(|x|). Fromthe integrality constraint on the measure functionm, it follows thatm(x,A(x, r)) = m∗(x), that is,A(x, r) is an optimal solution.

Since the running time ofA(x, r) is bounded byq(|x|, p(|x|)), we havethat P is solvable in polynomial time. From the NP-hardness ofP , thetheorem thus follows.QED

If P 6= NP, thenFPTAS⊂ PTAS.Corollary 3.16 I

As we have seen in Sect. 3.2.1, MAXIMUM INDEPENDENTSET restrictedPROOF

to planar graphs belongs to class PTAS. On the other side, this problemis clearly polynomially bounded and by the previous theoremit does notbelong to the class FPTAS (unless P= NP).QED

3.3.4 Strong NP-completeness and pseudo-polynomiality

We conclude this section by giving another general condition that assuresthat a problem is not in FPTAS. Let us first introduce some definitionswhich are intrinsically interesting because they allow us to relate the ap-proximability properties of a problem to its combinatorialstructure. Inparticular, we are going to study the different ways in whichnumbers playa role in an NPO problem.

Let us consider, for example, MAXIMUM CUT. This problem is NP-hard: since no number appears in its instances (but the vertex indices), wemay conclude that it is the combinatorial structure of MAXIMUM CUT, i.e.the property that the graph has to satisfy, that makes the problem hard.

When we consider other problems the situation is somewhat different.Let us consider MAXIMUM KNAPSACK. As we already noted in Sect. 2.5,by using a dynamic programming algorithm, we can solve this problemin time O(n2pmax): moreover, sincepmax is an integer contained in theinstance whose encoding requiresdlogpmaxe bits, this algorithm is not apolynomial-time one. However, if we restrict ourselves to instances inwhich the numberspi have values bounded by a polynomial in the lengthof the instance, we obtain a polynomial-time algorithm. This means thatthe complexity of MAXIMUM KNAPSACK is essentially related to the sizeof the integers that appear in the input.

For any NPO problemP and for any instancex of P , let max(x) de-note the value of the largest number occurring inx. We note that, froma formal point of view, the definition of the function max depends on theencoding of the instance. However, we can repeat for the function max

114

Page 29: Chapter 3 · In Chap. 2, we have seen that, in some cases, standard algorithm design techniques, such as local search or greedy techniques, although inadequate to obtain the optimal

Section 3.3

FULLY

POLYNOMIAL -TIME

APPROXIMATION

SCHEMES

the same kind of considerations that are usually made when consideringthe computational complexity of a problem assuming the length of the in-stance as the main parameter. In fact, if we choose two different functionsmax and max′ for the same problem, the results we are going to present donot change in the case that these two functions are polynomially related,that is, two polynomialsp andq exist such that, for any instancex, bothmax(x) ≤ p(max′(x)) and max′(x) ≤ q(max(x)) hold.

For the NPO problems we are interested in, all the intuitive max func-tions we can think of are polynomially related. Thus, the concept of maxis sufficiently flexible to be used in practice without any limitation.

An NPO problemP is pseudo-polynomialif it can be solved by an algo-J Definition 3.15Pseudo-polynomial problemrithm that, on any instance x, runs in time bounded by a polynomial in |x|

and inmax(x).

In the case of MAXIMUM KNAPSACK, the max function can be defined as J Example 3.7

max(x) = max(a1, . . . ,an, p1, . . . , pn,b).

The dynamic programming algorithm for MAXIMUM KNAPSACK thus shows thatthis problem is pseudo-polynomial. Indeed, for any instance x, the running timeof this algorithm isO(n2pmax) and, hence,O(n2max(x)).

The following result shows an interesting relationship between the con-cepts of pseudo-polynomiality and full approximability.

Let P be anNPO problem inFPTAS. If a polynomial p exists such that,J Theorem 3.17

for every input x, m∗(x) ≤ p(|x|,max(x)), thenP is a pseudo-polynomialproblem.

Let A be a fully polynomial-time approximation scheme forP . We will PROOF

now exhibit an algorithmA′ that solves any instancex of P in time poly-

nomial both in|x| and in max(x). This algorithm is simply defined as:

A′(x) = A

(

x,1+1

p(|x|,max(x))+1

)

.

Since the optimal measure is bounded byp(|x|,max(x)), A′(x) must be an

optimal solution. Regarding the running time ofA′, recall thatA operates

within time q(|x|,1/(r −1)), for some polynomialq. Therefore,A ′ oper-ates in timeq(|x|, p(|x|,max(x))+1), that is, a polynomial in both|x| andmax(x). QED

115

Page 30: Chapter 3 · In Chap. 2, we have seen that, in some cases, standard algorithm design techniques, such as local search or greedy techniques, although inadequate to obtain the optimal

Chapter 3

APPROXIMATION

CLASSES

Let P be an NPO problem and letp be a polynomial. We denote byP

max,p the problem obtained by restrictingP to only those instancesx forwhich max(x) ≤ p(|x|). The following definition formally introduces thenotion of an optimization problem whose computational hardness does notdepend on the values of the numbers included in its instances.

An NPO problemP is said to bestrongly NP-hardif a polynomial p existsDefinition 3.16StronglyNP-hard problem

I

such thatP max,p is NP-hard.

If P 6= NP, then no stronglyNP-hard problem can be pseudo-polynomial.Theorem 3.18 I

Let us assume thatP is a strongly NP-hard problem, which is also pseudo-PROOF

polynomial. This means that an algorithm exists that solvesP in timeq(|x|,max(x)) for a suitable polynomialq. Then, for any polynomialp,P

max,p can be solved in timeq(|x|, p(|x|)). From the strong NP-hardnessof P , it also follows that a polynomialp exists such thatP max,p is NP-hard.Hence, P= NP and the theorem follows.QED

MAXIMUM CUT is an example of strongly NP-hard problem. Indeed, it is suffi-Example 3.8 I

cient to consider the polynomialp(n) = n. Therefore, unless P= NP, MAXIMUM

CUT is not pseudo-polynomial.

From Theorems 3.17 and 3.18, the following result can be immediatelyderived.

Let P be a stronglyNP-hard problem that admits a polynomial p suchCorollary 3.19 I

that m∗(x) ≤ p(|x|,max(x)), for every input x. IfP 6= NP, thenP does notbelong to the classFPTAS.

The concepts of pseudo-polynomiality and strong NP-hardness allow usto classify NPO problems in different classes. Once we have shown that anNPO problem is pseudo-polynomial, we can think that it is computation-ally easier than a problem that is strongly NP-hard (see Theorem 3.18).On the other hand, we can capture some connections of these conceptswith the approximability properties. Also from this point of view, evenif we only have partial relationships, it is clear that pseudo-polynomialityis linked to well-approximable problems (see Theorem 3.17)while strongNP-hardness seems to be one of the characteristics of problemsthat behavebadly with respect to approximability (see Corollary 3.19).

3.4 Exercises

Exercise 3.1 Define a polynomial-time local search algorithm for MAX -IMUM SATISFIABILITY . Prove that the algorithm finds a solution withmeasure at least one half of the optimum.

116

Page 31: Chapter 3 · In Chap. 2, we have seen that, in some cases, standard algorithm design techniques, such as local search or greedy techniques, although inadequate to obtain the optimal

Section 3.4

EXERCISESProgram 3.6: Gavril

input GraphG = (V,E);output Vertex coverV ′;begin

V ′ := /0;repeat

Choose any edgee= (vi ,v j) ∈ E;V ′ := V ′∪{vi,v j};E := E−{e′ | e′ ∈ E incident tovi or v j};

until E = /0;return V ′

end.

Problem 3.3: Maximum k-Dimensional Matching

INSTANCE: SetM ⊆ X1×X2× . . .×Xk whereX1,X2, . . . ,Xk are disjointsets having the same numberq of elements.

SOLUTION: SubsetM′ ⊆ M such that no two elements ofM′ agree inany coordinate.

MEASURE: Cardinality ofM′.

Exercise 3.2 Prove that Program 3.1 can be extended to the case in whicheach clause has an associated weight preserving the performance ratio.

Exercise 3.3 Show that Program 3.6, also known asGavril’s algorithm,is a 2-approximate algorithm for MINIMUM VERTEX COVER. (Hint: ob-serve that the algorithm computes a maximal matching of the input graph.)

Exercise 3.4 Consider Problem 3.3. Show that, for anyk ≥ 3, MAXI -MUM k-DIMENSIONAL MATCHING is k-approximable. (Hint: considermaximal matchings, that is, matchings that cannot be extended withoutviolating the feasibility constraints.)

Exercise 3.5 Consider the following variant of Christofides’ algorithm(known as the tree algorithm for MINIMUM TRAVELING SALESPERSON):after finding the minimum spanning treeT, create the multigraphM byusing two copies of each edge ofT. Show that this algorithm is 2-approximate and that the bound 2 is tight.

Exercise 3.6 Consider Problem 3.4. Prove that a minimum spanning treeon S is a 2-approximate solution for this problem.

117

Page 32: Chapter 3 · In Chap. 2, we have seen that, in some cases, standard algorithm design techniques, such as local search or greedy techniques, although inadequate to obtain the optimal

Chapter 3

APPROXIMATION

CLASSES

Problem 3.4: Minimum Metric Steiner Tree

INSTANCE: Complete graphG= (V,E), edge weight functionw : E 7→ INsatisfying the triangle inequality, and subsetS⊆V of required vertices.

SOLUTION: A Steiner treeT, i.e., a subgraph ofG that is a tree andincludes all the vertices inS.

MEASURE: The sum of the weights of the edges inT.

Problem 3.5: Minimum Knapsack

INSTANCE: Finite setX of items, for eachxi ∈ X, valuepi ∈ Z+ and sizeai ∈ Z+, positive integerb.

SOLUTION: A set of itemsY ⊆ X such that∑xi∈Y pi ≥ b.

MEASURE: Total size of the chosen items, i.e.,∑xi∈Y ai .

Exercise 3.7 Show that the greedy heuristic for MINIMUM VERTEX

COVER based on repeatedly choosing a vertex with highest degree doesnot provide a constant approximation ratio.

Exercise 3.8 Prove that, for any NPO minimization problemP , if thereexists a constantk such that it is NP-hard to decide whether, given an in-stancex, m∗(x) ≤ k, then no polynomial-timer-approximate algorithm forP with r < (k+1)/k can exist, unless P= NP.

Exercise 3.9 Prove that, for any integerc and for any rationalδ > 0, thenumber of ways of choosingc positive integers whose sum is less thanδ is

equal to

(

c+ bδcbδc

)

.

Exercise 3.10 By making use of a technique similar to the one used forM INIMUM PARTITION, show that, for any integerk, there is ak/(k+ 1)-approximate algorithm for MAXIMUM KNAPSACK.

Exercise 3.11 Fill in all the details of the proof of Theorem 3.14.

Exercise 3.12 Construct a FPTAS for M INIMUM KNAPSACK (see Prob-lem 3.5) by making use of the variable partitioning technique.

Exercise 3.13 An NPO problemP is simpleif, for every positive integerk, the problem of deciding whether an instancex of P has optimal mea-sure at mostk is in P. Prove that MAXIMUM CLIQUE is simple and thatM INIMUM GRAPH COLORING is not simple (unless P= NP).

118

Page 33: Chapter 3 · In Chap. 2, we have seen that, in some cases, standard algorithm design techniques, such as local search or greedy techniques, although inadequate to obtain the optimal

Section 3.5

BIBLIOGRAPHICAL

NOTES

Exercise 3.14 Prove that a problem is simple if it belongs to the classPTAS.

Exercise 3.15 An NPOmaximization problemP satisfies theboundednesscondition if an algorithmA and a positive integer constantb exist suchthat the following hold: (a) for every instancex of P and for every positiveintegerc, A(x,c) is a feasible solutiony of xsuch thatm∗(x)≤m(x,y)+cb,and (b) for every instancex of P and for every positive integerc, the timecomplexity ofA(x,c) is a polynomial in|x| whose degree depends only onthe valuem(x,A(x,c))/c. Prove that MAXIMUM KNAPSACK verifies theboundedness condition.

Exercise 3.16 (*) Prove that an NPO maximization problemP admits aPTAS if and only if it is simple and satisfies the boundedness condition.

Exercise 3.17 An NPO problemP is p-simpleif, for every positive integerk, the problem of deciding whether an instancex of P has optimal measureat mostk is solvable in time bounded by a polynomial in|x| andk. Provethat MAXIMUM KNAPSACK is p-simple.

Exercise 3.18 An NPO maximization problemP satisfies thepolynomialboundedness conditionif an algorithmA and a univariate polynomialpexist such that the following hold: (a) for every instancex of P and forevery positive integerc, A(x,c) is a feasible solutiony of x such thatm∗(x) ≤ m(x,y) + cp(|x|), and (b) for every instancex of P and for ev-ery positive integerc, the time complexity ofA(x,c) is a polynomial in|x| whose degree depends only on the valuem(x,A(x,c))/c. Prove thatMAXIMUM KNAPSACK verifies the polynomial boundedness condition.

Exercise 3.19 (*) Prove that an NPO maximization problemP admits aFPTAS if and only if it is p-simple and satisfies the polynomial bounded-ness condition.

3.5 Bibliographical notes

THE CONCEPTof approximation algorithm with “guaranteed perfor-mance” was introduced in the 1970s in the context of the first at-

tempts to provide a formal analysis of computer heuristics for the solutionof difficult optimization problems. The problem of designing efficient al-gorithms capable of achieving “good” feasible solutions ofoptimizationproblems in those cases in which the exact solution could notbe achievedunless running exponential-time algorithms, has, of course, been addressedsince the beginning of computational studies in operationsresearch. But

119

Page 34: Chapter 3 · In Chap. 2, we have seen that, in some cases, standard algorithm design techniques, such as local search or greedy techniques, although inadequate to obtain the optimal

Chapter 3

APPROXIMATION

CLASSES

it was not until the late 1960s that people started to perceive the need togo beyond computational experiments and to provide the formal analysisof the performance of an approximation algorithm in terms ofquality ofapproximation. One of the first papers in which the performance af an ap-proximation algorithm was analyzed is [Graham, 1966] whichdeals withmultiprocessor scheduling.

In the subsequent years the study of approximation algorithms started tobecome more systematic. Among the papers that are considered to havelaid down the first basic concepts relative to approximationalgorithms,we may refer the reader to [Garey, Graham, and Ullman, 1972, Sahni,1973, Johnson, 1974a, Nigmatullin, 1976]. In particular, in Johnson’s pa-per the first examples off (n)-approximate algorithms (that is with non-constant approximation ratio), and the first examples of approximationschemes are shown. In [Garey and Johnson, 1976b] the first survey with acomplete view of the earliest results concerning approximation algorithmsis provided.

In the late 1970s a large body of literature on approximationalgorithmsand on classes of approximability already existed. In [Horowitz and Sahni,1978, Garey and Johnson, 1979] the authors provide the basicconcepts andthe related terminology (approximate algorithm, polynomial-time approx-imation scheme, fully polynomial-time approximation scheme). Thosebooks have been the common ground for all work in the field.

The greedy algorithm for MAXIMUM SATISFIABILITY is due to [John-son, 1974a]: a careful analysis of this algorithm is given in[Chen, Friesen,and Zheng, 1997] where it is shown that its performance ratiois at most3/2. The approximation algorithm for MINIMUM VERTEX COVER basedon the matching construction (see Exercise 3.3) is due to Gavril.

The proof that MINIMUM TRAVELING SALESPERSON is not approx-imable unless P= NP appears in [Sahni and Gonzalez, 1976] where thefirst examples of NP-hardness of approximation are presented. Note thatsuch problems are called P-complete, a terminology never used afterwardswith this meaning. The 2-approximate algorithm for the MINIMUM MET-RIC TRAVELING SALESPERSONbased on the spanning tree construction(see Exercise 3.5) appears for the first time in [Korobkov andKrichevskii,1966]. In [Rosenkrantz, Stearns, and Lewis, 1977] several heuristics forM INIMUM METRIC TRAVELING SALESPERSONare analyzed and vari-ous 2-approximate algorithms are shown. The 1.5-approximate algorithm(that is, Christofides’ algorithm) appears in [Christofides, 1976]. It is worthnoting that in the metric case this is still the best result known in terms ofapproximation ratio.

The primal-dual algorithm for the minimum weight perfect matchingwhich is used in the proof of Theorem 3.6 is due to [Gabow, 1990]. Cur-

120

Page 35: Chapter 3 · In Chap. 2, we have seen that, in some cases, standard algorithm design techniques, such as local search or greedy techniques, although inadequate to obtain the optimal

Section 3.5

BIBLIOGRAPHICAL

NOTES

rently, the best known algorithm for finding a minimum weightmaximalmatching in a graph satisfying the triangular inequality isdue to [Vaidya,1990] and takes timeO(n2.5(logn)4). Since in the case of Christofides’algorithm we have exactly this type of instances, we may alsoapplyVaidya’s algorithm and the overall time of Christofides’ algorithm becomesO(n2.5(logn)4).

The gap technique has been implicitly used for some time (forexample,in the cited results on NP-hardness of approximation of MINIMUM TRAV-ELING SALESPERSON). The first proof of hardness of approximability (upto ratio 2) for the MINIMUM GRAPH COLORING problem, based on thegap technique, appeared in [Garey and Johnson, 1976a].

For a long time only a few problems admitting a PTAS were known.Among them there was MAXIMUM INDEPENDENT SET restricted to pla-nar graphs (several drawing algorithms for planar graphs are described in[Di Battista et al., 1999]). A PTAS for this problem was due to [Lipton andTarjan, 1980] and, independently, to [Chiba, Nishizeki, and Saito, 1982].In [Baker, 1994], by means of a new technique, it is proved a more generalresult for such problem. The author proved that the MAXIMUM INDE-PENDENT SET can be solved in polynomial time fork-outerplanar graphsand, as a consequence, showed that several problems restricted to planargraphs admit a PTAS: beside MAXIMUM INDEPENDENT SET, such prob-lems include MINIMUM VERTEX COVER and MINIMUM DOMINATING

SET.More recently, by means of new techniques, polynomial-timeapproxi-

mation schemes have been designed for a large group of geometric prob-lems in the Euclidean plane by [Arora, 1997]. Among them, themost rele-vant are MINIMUM TRAVELING SALESPERSONand MINIMUM STEINER

TREE. Notice that the result is remarkable, because in [Papadimitriou andYannakakis, 1993] it is proved that in the general metric case MINIMUM

TRAVELING SALESPERSONdoes not allow a PTAS.One of the first examples of a fully polynomial-time approximation

scheme, namely the FPTAS for the knapsack problem, was given by [Ibarraand Kim, 1975]. Both notions are extensively discussed in [Horowitz andSahni, 1978] where more examples of problems in PTAS and FPTAS areshown.

The technique of variable partitioning used in the FPTAS for MAXIMUM

PRODUCT KNAPSACK has been introduced in [Marchetti-Spaccamela andRomano, 1985].

The strict inclusion of FPTAS in the class PTAS was proved in [Korte, andSchrader, 1981] by showing that MAXIMUM INTEGER m-DIMENSIONAL

KNAPSACK (previously shown to be in PTAS by [Chandra, Hirschberg,and Wong, 1976]) is not in FPTAS. In the same paper, necessary and suf-

121

Page 36: Chapter 3 · In Chap. 2, we have seen that, in some cases, standard algorithm design techniques, such as local search or greedy techniques, although inadequate to obtain the optimal

Chapter 3

APPROXIMATION

CLASSES

ficient conditions for showing the existence of PTAS and FPTAS (basedon generalizations of the dominance rules introduced for knapsack-typeproblems) were presented. Other necessary and sufficient conditions, ofmore general applicability, were provided by [Paz and Moran, 1981]. In[Ausiello, Marchetti-Spaccamela, and Protasi, 1980] it isshown that theseconditions are strictly related to the notions of strong NP-completeness andpseudo-polynomiality introduced by [Garey and Johnson, 1978].

Finally it is worth noting that even though the standard approach tothe study of approximation algorithms was based on the notions of rel-ative error and performance ratio, as defined in Sect. 3.1.2,in [Hsu andNemhauser, 1979, Ausiello, Marchetti-Spaccamela, and Protasi, 1980, De-mange and Pascos, 1996] it is suggested to consider the so-called “differ-ential performance measure” which relates the error made byan algorithmto the range of possible values of the measure.

122