cs0305002/cs0305002
1: 
2: \documentclass[a4paper,eepic,11pt]{article}
3: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4: \usepackage{amssymb}
5: \usepackage{graphicx}
6: \usepackage{amsmath}
7: 
8: \setcounter{MaxMatrixCols}{10}
9: %TCIDATA{OutputFilter=LATEX.DLL}
10: %TCIDATA{Version=4.00.0.2321}
11: %TCIDATA{LastRevised=Monday, April 14, 2003 17:25:22}
12: %TCIDATA{<META NAME="GraphicsSave" CONTENT="32">}
13: %TCIDATA{Language=American English}
14: %TCIDATA{CSTFile=article.cst}
15: 
16: \newtheorem{theorem}{Theorem}
17: \newtheorem{acknowledgement}[theorem]{Acknowledgement}
18: \newtheorem{algorithm}[theorem]{Algorithm}
19: \newtheorem{axiom}[theorem]{Axiom}
20: \newtheorem{case}[theorem]{Case}
21: \newtheorem{claim}[theorem]{Claim}
22: \newtheorem{conclusion}[theorem]{Conclusion}
23: \newtheorem{condition}[theorem]{Condition}
24: \newtheorem{conjecture}[theorem]{Conjecture}
25: \newtheorem{corollary}[theorem]{Corollary}
26: \newtheorem{criterion}[theorem]{Criterion}
27: \newtheorem{definition}[theorem]{Definition}
28: \newtheorem{example}{Example}
29: \newtheorem{exercise}[theorem]{Exercise}
30: \newtheorem{lemma}[theorem]{Lemma}
31: \newtheorem{notation}[theorem]{Notation}
32: \newtheorem{problem}[theorem]{Problem}
33: \newtheorem{proposition}{Proposition}
34: \newtheorem{transformation}{Transformation}
35: \newtheorem{remark}{Remark}
36: \newtheorem{solution}[theorem]{Solution}
37: \newtheorem{summary}[theorem]{Summary}
38: \newenvironment{proof}[1][Proof]{\textbf{#1.} }{\ \rule{0.5em}{0.5em}}
39: 
40: \begin{document}
41: 
42: \title{Hybrid Rounding Techniques for Knapsack Problems\thanks{%
43: Supported by the \textquotedblleft Metaheuristics Network\textquotedblright
44: , grant HPRN-CT-1999-00106, by Swiss National Science Foundation project
45: 20-63733.00/1, \textquotedblleft Resource Allocation and Scheduling in
46: Flexible Manufacturing Systems\textquotedblright , and by SNF grant
47: 2000-61847.00 to J\"{u}rgen Schmidhuber.}}
48: \author{Monaldo Mastrolilli and Marcus Hutter \\
49: %EndAName
50: {\small IDSIA, Galleria 2, 6928 Manno, Switzerland,} {\small \{monaldo,
51: marcus\}@idsia.ch}}
52: \maketitle
53: 
54: \begin{abstract}
55: We address the classical knapsack problem and a variant in which an upper
56: bound is imposed on the number of items that can be selected. We show that
57: appropriate combinations of rounding techniques yield novel and powerful
58: ways of rounding. As an application of these techniques, we present a
59: linear-storage Polynomial Time Approximation Scheme (PTAS) and a Fully
60: Polynomial Time Approximation Scheme (FPTAS) that compute an approximate
61: solution, of any fixed accuracy, in linear time. This linear complexity
62: bound gives a substantial improvement of the best previously known
63: polynomial bounds \cite{Caprara:1998:NFP}.
64: \end{abstract}
65: 
66: \section{Introduction}
67: 
68: In the classical \textit{Knapsack Problem} (KP) we have a set $N:=\{1,\ldots
69: ,n\}$ of items and a knapsack of limited capacity. To each item we associate
70: a positive profit $p_{j}$ and a positive weight $w_{j}$. The problem calls
71: for selecting the set of items with maximum overall profit among those whose
72: total weight does not exceed the knapsack capacity $c>0$. KP has the
73: following Integer Linear Programming (ILP) formulation:
74: 
75: \begin{gather}
76: \text{maximize \ \ \ }\sum_{j\in N}p_{j}x_{j}\text{ \ \ \ \ \ \ \ }
77: \label{eq:ILP1} \\
78: \text{subject to \ \ }\sum_{j\in N}w_{j}x_{j}\leq c  \label{eq:ILP2} \\
79: \text{ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }x_{j}\in \{0,1\},%
80: \text{ \ \ }j\in N,  \label{eq:ILP3}
81: \end{gather}%
82: where each binary variable $x_{j}$, $j\in N$, is equal to 1 if and only if
83: item $j$ is selected. In general, we cannot take all items because the total
84: weight of the chosen items cannot exceed the knapsack capacity $c$. In the
85: sequel, without loss of generality, we assume that $\sum_{j\in N}w_{j}>c$
86: and $w_{j}\leq c$ for every $j\in N$.
87: 
88: The \textit{k-item Knapsack Problem} (kKP), is a KP in which an upper bound
89: of $k$ is imposed on the number of items that can be selected in a solution.
90: The problem can be formulated as (\ref{eq:ILP1})-(\ref{eq:ILP3}) with the
91: additional constraint
92: 
93: \begin{equation}
94: \sum_{j\in N}x_{j}\leq k,  \label{eq:ILP4}
95: \end{equation}
96: with $1\leq k\leq n$.
97: 
98: KP has widely been studied in the literature, see the book of Martello and
99: Toth \cite{MarToth90} for a comprehensive illustration of the problem. kKP
100: is the subproblem to be solved when instances of the Cutting Stock Problem
101: with cardinality constraints are tackled by column generation techniques.
102: kKP also appears in processor scheduling problems on computers with $k$
103: processors and shared memory. Furthermore, kKP could replace KP in the
104: separation of cover inequalities, as outlined in \cite{Caprara:1998:NFP}.
105: 
106: Throughout our paper let $OPT$ denote the optimal solution value to the
107: given instance and $w(F)=\sum_{j\in F}w_{j}$ and $p(F)=\sum_{j\in F}p_{j}$,
108: where $F\subseteq N$. An algorithm $A$ with solution value $z^{A}$ is called
109: a $(1-\varepsilon )$-\textit{approximation algorithm}, $\varepsilon \in
110: (0,1) $, if $z^{A}\geq (1-\varepsilon )OPT$ holds for all problem instances.
111: We will also call $\varepsilon $ the \textit{performance ratio} of $A$.
112: 
113: \paragraph{Known Results}
114: 
115: It is well known that KP is NP-hard but pseudopolynomially solvable through
116: dynamic programming, and the same properties hold for kKP \cite%
117: {Caprara:1998:NFP}. Basically, the developed approximation approaches for KP
118: and kKP can be divided into three groups:
119: 
120: \begin{enumerate}
121: \item \textit{Approximation algorithms}. For KP the classical $\frac{1}{2}$%
122: -approximation algorithm (see e.g. \cite{app:Lawler:77}) needs only $O(n)$
123: running time. A performance ratio of $\frac{1}{2}$ can be obtained also for
124: kKP by rounding the solution of the linear programming relaxation of the
125: problem (see \cite{Caprara:1998:NFP}); this algorithm can be implemented to
126: run in linear time when the LP relaxation of kKP is solved by using the
127: method by Megiddo and Tamir \cite{MegTam:93}.
128: 
129: \item \textit{Polynomial time approximation schemes} (PTAS) reach any given
130: performance ratio and have a running time polynomial in the length of the
131: encoded input. The best schemes currently known requiring linear space are
132: given in Caprara et al. \cite{Caprara:1998:NFP}: they yield a performance
133: ratio of $\varepsilon $ within $O(n^{\left\lceil 1/\varepsilon \right\rceil
134: -2}+n\log n)$ and $O(n^{\left\lceil 1/\varepsilon \right\rceil -1})$ running
135: time, for KP and kKP respectively.
136: 
137: \item \textit{Fully polynomial time approximation schemes} (FPTAS) also
138: reach any given performance ratio and have a running time polynomial in the
139: length of the encoded input and in the reciprocal of the performance ratio.
140: This improvement compared to 1. and 2. is usually paid off by larger space
141: requirements, which increases rapidly with the accuracy $\varepsilon $. The
142: first FPTAS for KP was proposed by Ibarra and Kim \cite{IbarraKim:1975},
143: later on improved by Lawler \cite{app:Lawler:77} and Kellerer and Pferschy
144: \cite{Kellerer:1998:NFP}. In Caprara et al. \cite{Caprara:1998:NFP} it is
145: shown that kKP admits an FPTAS that runs in $O(nk^{2}/\varepsilon )$ time.
146: \end{enumerate}
147: 
148: \paragraph{New Results}
149: 
150: Rounding the input is a widely used technique to obtain polynomial time
151: approximation schemes \cite{H95}. Among the developed rounding techniques,
152: arithmetic or geometric rounding are the most successfully and broadly used
153: ways of rounding to obtain a simpler instance that may be solved in
154: polynomial time (see Sections \ref{Sect:arithmetic rounding} and \ref%
155: {Sect:Geometric rounding} for an application of these techniques to kKP). We
156: contribute by presenting a new technical idea. We show that appropriate
157: combinations of arithmetic and geometric rounding techniques yield novel and
158: powerful rounding methods. To the best of our knowledge, these techniques
159: have never been combined together. By using the described rounding
160: techniques, we present a PTAS for kKP requiring linear space and running
161: time $O(n+k\cdot (1/\varepsilon )^{O(1/\varepsilon )})$. Our algorithm is
162: clearly superior to the one in \cite{Caprara:1998:NFP}, and it is worth
163: noting that the running time contains no exponent on $n$ dependent on $%
164: \varepsilon $. Since KP is a special case of kKP, we also speed up the
165: previous result for KP to $O(n\cdot (1/\varepsilon )^{O(1/\varepsilon )})$.
166: Finally we present a faster FPTAS for kKP that runs in $O(n+k/\varepsilon
167: ^{4}+1/\varepsilon ^{5})$ time and has a bound of $O(n+1/\varepsilon ^{4})$
168: on space requirements.
169: 
170: \section{Rounding techniques for kKP\label{Sect:reduced N}}
171: 
172: The aim of this section is to transform any input into one with a smaller
173: size and a simpler structure without dramatically decreasing the objective
174: value. We discuss several transformations of the input problem. Some
175: transformations may potentially decrease the objective function value by a
176: factor of $1-O(\varepsilon )$, so we can perform a constant number of them
177: while still staying within $1-O(\varepsilon )$ of the original optimum.
178: Others are transformations which do not decrease the objective function
179: value. When we describe the first type of transformation, we shall say it
180: produces $1-O(\varepsilon )$ \textit{loss}, while the second produces
181: \textit{no} \textit{loss}.
182: 
183: Let $P^{H}$ denote the solution value obtained in $O(n)$ time by employing
184: the $1/2$-approximation algorithm $H^{\frac{1}{2}}$ for kKP described in
185: \cite{Caprara:1998:NFP}. In \cite{Caprara:1998:NFP}, it is shown that
186: \begin{equation}
187: 2P^{H}\geq P^{H}+p_{\max }\geq OPT\geq P^{H},  \label{Eq:ineq}
188: \end{equation}
189: where $p_{\max }=\max_{j}p_{j}$.
190: 
191: Throughout this section we restrict our attention to feasible solutions with
192: at most $\gamma $ items, where $\gamma $ is a positive integer not greater
193: than $k$. The first observation is that at most an $\varepsilon $-fraction
194: of the optimal profit $OPT$ is lost by discarding all items $j$ where $%
195: p_{j}\leq \varepsilon P^{H}/\gamma $, since at most $\gamma $ items can be
196: selected and $P^{H}\leq OPT$. From now on, consider the reduced set of items
197: with profit values greater than $\varepsilon P^{H}/\gamma $, with $%
198: 1-\varepsilon $ loss.
199: 
200: In order to reduce further the set of items, a useful insight is that when
201: profits are identical we pick items in non-decreasing order of weight. Since
202: the optimal profit is at most $2P^{H}$, for each fixed $\bar{p}\in \left\{
203: p_{1},...,p_{n}\right\} $, we can keep the first $\bar{n}=\min \left\{
204: \gamma ,\left\lfloor \frac{2P^{H}}{\bar{p}}\right\rfloor \right\} $ items
205: with the smallest weights, and discard the others with no loss. Of course,
206: we cannot hope to obtain a smaller instance if all profits are different. In
207: the following, we show how the number of different profits can be reduced by
208: rounding the original profits. We revise two rounding techniques and show
209: that an appropriate combination of both yields to a better result. We call a
210: profit value $\bar{p}$ \textit{large} if $\bar{p}>\frac{2P^{H}}{\gamma }$,
211: and \textit{small} otherwise.
212: 
213: \subsection{Arithmetic rounding\label{Sect:arithmetic rounding}}
214: 
215: A sequence $a_{1},a_{2},...$ is called an \textit{arithmetic sequence} if,
216: and only if, there is a constant $d$ such that $a_{i}=a_{1}+d\cdot (i-1)$,
217: for all integers $i\geq 1$. Let us consider the arithmetic sequence $%
218: S_{a}(\gamma )$ obtained by setting $a_{1}=d=\varepsilon P^{H}/\gamma $. We
219: transform the given instance into a more structured one by rounding each
220: profit down to the nearest value in $S_{a}(\gamma )$. Since in the rounded
221: instance the profit of each item is decreased by at most $\varepsilon
222: P^{H}/\gamma $, and at most $\gamma $ items can be selected, the solution
223: value of the transformed instance potentially decreases by $\varepsilon
224: P^{H} $. Of course, by restoring the original profits we cannot decrease the
225: objective function value, and therefore, with $1-\varepsilon $ loss, we can
226: assume that every possible profit is equal to $a_{i}=\frac{\varepsilon P^{H}%
227: }{\gamma }\cdot i$ for some $i\geq 1$. Furthermore, since $p_{\max
228: }=\max_{j\in N}p_{j}\leq P^{H}$, the number of different profits is now
229: bounded by $\left\lfloor \frac{\gamma p_{\max }}{\varepsilon P^{H}}%
230: \right\rfloor \leq \left\lfloor \frac{\gamma }{\varepsilon }\right\rfloor $.
231: 
232: The largest number $n_{i}$ of items with profit $a_{i}$, for $%
233: i=1,...,\left\lfloor \frac{\gamma }{\varepsilon }\right\rfloor $, that can
234: be involved in any feasible solution is bounded by
235: \begin{equation*}
236: n_{i}\leq \min \{\gamma ,\left\lfloor \frac{OPT}{\frac{\varepsilon P^{H}}{%
237: \gamma }i}\right\rfloor \}\leq \min \{\gamma ,\left\lfloor \frac{2\gamma }{%
238: \varepsilon i}\right\rfloor \},
239: \end{equation*}
240: and we can keep the first $n_{i}$ items with the smallest weights, and
241: discard the others with no loss. Now, the number of items with profit $a_{i}$
242: is at most $\gamma $, if $a_{i}$ is a small profit (i.e. when $%
243: i=1,...,\left\lfloor \frac{2}{\varepsilon }\right\rfloor $), and at most $%
244: \left\lfloor \frac{2\gamma }{\varepsilon i}\right\rfloor $ otherwise ($%
245: i=\left\lfloor \frac{2}{\varepsilon }\right\rfloor +1,...,\left\lfloor \frac{%
246: \gamma }{\varepsilon }\right\rfloor $). Thus, by applying the described
247: arithmetic rounding we have at most $\left\lfloor 2/\varepsilon
248: \right\rfloor \gamma $ items with small profits and $\allowbreak
249: \sum_{i=\left\lfloor \frac{2}{\varepsilon }\right\rfloor +1}^{\left\lfloor
250: \frac{\gamma }{\varepsilon }\right\rfloor }\left\lfloor \frac{2\gamma }{%
251: \varepsilon i}\right\rfloor $ with large profits. Recall that when a
252: summation can be expressed as $\sum_{k=x}^{y}f(k)$, where $f(k)$ is a
253: monotonically decreasing function, we can approximate it by an integral
254: (see, e.g. \cite{CLR92} p. 50): $\int_{x}^{y+1}f(k)dk\leq
255: \sum_{k=x}^{y}f(k)\leq \int_{x-1}^{y}f(k)dk$. Furthermore, we are assuming
256: that $0<\varepsilon <1$, and recall that $\ln (1+x)\geq x/(1+x)$, for $x>-1$%
257: . Therefore, the total number of items in the transformed instance is
258: bounded by
259: \begin{eqnarray*}
260: \left\lfloor \frac{2}{\varepsilon }\right\rfloor \gamma
261: +\sum_{i=\left\lfloor \frac{2}{\varepsilon }\right\rfloor +1}^{\left\lfloor
262: \frac{\gamma }{\varepsilon }\right\rfloor }\left\lfloor \frac{2\gamma }{%
263: \varepsilon i}\right\rfloor &\leq &\frac{2}{\varepsilon }\gamma +\frac{2}{%
264: \varepsilon }\gamma \sum_{i=\left\lfloor \frac{2}{\varepsilon }\right\rfloor
265: +1}^{\left\lfloor \frac{\gamma }{\varepsilon }\right\rfloor }\frac{1}{i} \\
266: &\leq &\frac{2\gamma }{\varepsilon }(1+\int_{\frac{2}{\varepsilon }-1}^{%
267: \frac{\gamma }{\varepsilon }}\frac{di}{i})=\allowbreak \frac{2\gamma }{%
268: \varepsilon }(1+\ln \gamma -\ln \left( 2-\varepsilon \right) ) \\
269: &\leq &\frac{2\gamma }{\varepsilon }(1+\ln \gamma )=O(\frac{\gamma }{%
270: \varepsilon }\ln \gamma ).
271: \end{eqnarray*}
272: We see that by applying the described arithmetic rounding we have at most $%
273: 2\gamma /\varepsilon $ items with small profits and $\allowbreak \frac{%
274: 2\gamma }{\varepsilon }\ln \gamma $ with large profits.
275: 
276: A natural question is to see if the provided bound is tight. Consider an
277: instance having $\gamma $ items for each distinct profit $\frac{\varepsilon
278: P^{H}}{\gamma }\cdot i$, where $i=1,...,\left\lfloor \frac{\gamma }{%
279: \varepsilon }\right\rfloor $. Observe that by applying the described
280: arithmetic rounding, we have exactly $\left\lfloor 2/\varepsilon
281: \right\rfloor \gamma $ items with small profits and $\allowbreak
282: \sum_{i=\left\lfloor \frac{2}{\varepsilon }\right\rfloor +1}^{\left\lfloor
283: \frac{\gamma }{\varepsilon }\right\rfloor }\left\lfloor \frac{2\gamma }{%
284: \varepsilon i}\right\rfloor $ with large profits. What remains to be shown
285: is to bound the number of items to be $\Omega (\frac{\gamma }{\varepsilon }%
286: \ln \gamma )$:
287: 
288: \begin{eqnarray*}
289: \left\lfloor \frac{2}{\varepsilon }\right\rfloor \gamma
290: +\sum_{i=\left\lfloor \frac{2}{\varepsilon }\right\rfloor +1}^{\left\lfloor
291: \frac{\gamma }{\varepsilon }\right\rfloor }\left\lfloor \frac{2\gamma }{%
292: \varepsilon i}\right\rfloor &\geq &\frac{2}{\varepsilon }\gamma -1+\sum_{i=%
293: \frac{2}{\varepsilon }+1}^{\frac{\gamma }{\varepsilon }-1}(\frac{2\gamma }{%
294: \varepsilon i}-1) \\
295: &\geq &\frac{2}{\varepsilon }\gamma -1+\frac{2}{\varepsilon }\gamma \sum_{i=%
296: \frac{2}{\varepsilon }+1}^{\frac{\gamma }{\varepsilon }-1}\frac{1}{i}-(\frac{%
297: \gamma }{\varepsilon }-2) \\
298: &\geq &\frac{\gamma }{\varepsilon }(1+2\int_{\frac{2}{\varepsilon }+1}^{%
299: \frac{\gamma }{\varepsilon }}\frac{di}{i})=\allowbreak \frac{\gamma }{%
300: \varepsilon }(1+2\ln \gamma -2\ln \left( 2+\varepsilon \right) ) \\
301: &=&\Omega (\frac{\gamma }{\varepsilon }\ln \gamma ).
302: \end{eqnarray*}
303: 
304: \subsection{Geometric rounding\label{Sect:Geometric rounding}}
305: 
306: A sequence $a_{1},a_{2},...$ is called a \textit{geometric sequence} if, and
307: only if, there is a constant $r$ such that $a_{i}=a_{1}\cdot r^{i-1}$, for
308: all integers $i\geq 1$. Let us consider the geometric sequence $S_{g}(\gamma
309: )$ obtained by setting $a_{1}=\varepsilon P^{H}/\gamma $ and $r=\frac{1}{%
310: 1-\varepsilon }$. We round each profit down to the nearest value among those
311: of $S_{g}(\gamma )$. Since $a_{i}=(1-\varepsilon )a_{i+1}$, for $i\geq 1$,
312: each item profit is at most decreased by a factor\footnote{%
313: This is true only for profits larger than $a_{1}$; recall that we are
314: assuming, with $1-\varepsilon $ loss, that all profits are larger than $a_{1}
315: $.} of $1-\varepsilon $, and consequently, the solution value of the
316: transformed instance potentially decreases by the same factor of $%
317: 1-\varepsilon $. Therefore, with $1-2\varepsilon $ loss, we can assume that
318: every possible profit is equal to $a_{i}=\frac{\varepsilon P^{H}}{\gamma }%
319: \cdot (\frac{1}{1-\varepsilon })^{i-1}$ for some $i\geq 1$. Furthermore,
320: since $p_{\max }\leq P^{H}$, the number of different profits is bounded by
321: the biggest integer $\beta $ such that
322: \begin{equation*}
323: \frac{\varepsilon P^{H}}{\gamma }\cdot (\frac{1}{1-\varepsilon })^{\beta
324: -1}\leq P^{H}.
325: \end{equation*}%
326: Since $\ln (\frac{1}{1-\varepsilon })\geq \varepsilon $, we have $\beta
327: -1\leq \frac{\ln (\gamma /\varepsilon )}{\ln (\frac{1}{1-\varepsilon })}\leq
328: \frac{1}{\varepsilon }\ln \frac{\gamma }{\varepsilon }$. In any feasible
329: solution, the largest number $n_{i}$ of items with profit $a_{i}$, for $%
330: i=1,...,\beta $, is bounded by
331: \begin{equation*}
332: n_{i}\leq \min \{\gamma ,\left\lfloor \frac{OPT}{\frac{\varepsilon P^{H}}{%
333: \gamma }\cdot (\frac{1}{1-\varepsilon })^{i-1}}\right\rfloor \}\leq \min
334: \{\gamma ,\left\lfloor \frac{2\gamma }{\varepsilon }(1-\varepsilon
335: )^{i-1}\right\rfloor \},
336: \end{equation*}%
337: and we can keep the first $n_{i}$ items with the smallest weights, and
338: discard the others with no loss. Let $\alpha =\left\lfloor \frac{\ln
339: \left\lfloor 2/\varepsilon \right\rfloor }{\ln \frac{1}{1-\varepsilon }}%
340: \right\rfloor +1$. Again, the number of items with profit $a_{i}$ is at most
341: $\gamma $, if $a_{i}$ is a small profit (i.e. when $1\leq i\leq \alpha $),
342: and at most $\left\lfloor \frac{2\gamma }{\varepsilon }(1-\varepsilon
343: )^{i-1}\right\rfloor $ otherwise ($i=\alpha +1,...,\beta $). Therefore, the
344: total number of items in the transformed instance is bounded by
345: \begin{equation*}
346: \alpha \gamma +\sum_{i=\alpha +1}^{\beta }\left\lfloor \frac{2\gamma }{%
347: \varepsilon }(1-\varepsilon )^{i-1}\right\rfloor \leq (\frac{1}{\varepsilon }%
348: \ln (2/\varepsilon )+1)\gamma +\allowbreak \frac{2\gamma }{\varepsilon }=O(%
349: \frac{\gamma }{\varepsilon }\ln \frac{1}{\varepsilon }).
350: \end{equation*}%
351: Moreover, we can easily show that this bound is tight. Consider an instance
352: having $\gamma $ items for each distinct profit $\frac{\varepsilon P^{H}}{%
353: \gamma }\cdot (\frac{1}{1-\varepsilon })^{i-1}$, where $i=1,...,\beta $. By
354: applying the described geometric rounding technique, we have exactly $\alpha
355: \gamma $ items with small profits and $\allowbreak \sum_{i=\alpha +1}^{\beta
356: }\left\lfloor \frac{2\gamma }{\varepsilon }(1-\varepsilon
357: )^{i-1}\right\rfloor $ with large profits. What remains to be shown is to
358: bound the number of items to be $\Omega (\frac{\gamma }{\varepsilon }\ln
359: \frac{1}{\varepsilon })$:
360: \begin{eqnarray*}
361: \alpha \gamma +\sum_{i=\alpha +1}^{\beta }\left\lfloor \frac{2\gamma }{%
362: \varepsilon }(1-\varepsilon )^{i-1}\right\rfloor  &\geq &\alpha \gamma \geq
363: \frac{\ln \left\lfloor 2/\varepsilon \right\rfloor }{\ln \frac{1}{%
364: 1-\varepsilon }}\gamma  \\
365: &\geq &\gamma \frac{1-\varepsilon }{\varepsilon }\ln \frac{2-\varepsilon }{%
366: \varepsilon }=\Omega (\frac{\gamma }{\varepsilon }\ln \frac{1}{\varepsilon }%
367: ).
368: \end{eqnarray*}
369: 
370: We see that by applying the geometric rounding we have at most $\gamma
371: /\varepsilon $ items with large profit, while $O(\frac{\gamma }{\varepsilon }%
372: \ln \frac{1}{\varepsilon })$ items with small profits. Contrary to
373: arithmetic rounding, the set of items that has been reduced most is the set
374: with large profits. This suggests us to combine the described rounding
375: techniques as described in the following subsection.
376: 
377: \subsection{Parallel Arithmetic \& Geometric rounding\label{Sect:arith_geo}}
378: 
379: We use arithmetic rounding for the set of items with small profits and
380: geometric rounding for large items. Let us say that these two techniques are
381: applied in \textquotedblleft parallel\textquotedblright . More formally, let
382: us consider the \textit{hybrid }sequence $S_{ag}(\gamma )=(a_{1},a_{2},...)$
383: defined by setting
384: \begin{equation*}
385: a_{i}=\frac{\varepsilon P^{H}}{\gamma }\cdot \left\{
386: \begin{array}{l}
387: i \\
388: (\frac{1}{1-\varepsilon })^{\alpha +i-\left\lfloor 2/\varepsilon
389: \right\rfloor -1}%
390: \end{array}%
391: \right.
392: \begin{array}{l}
393: \text{for }i=1,...,\left\lfloor 2/\varepsilon \right\rfloor \text{,} \\
394: \text{otherwise.}%
395: \end{array}%
396: \end{equation*}%
397: We round each profit down to the nearest value among those of $S_{ag}(\gamma
398: )$. Now, consider each set $Z_{i}$ of items with the same rounded profit
399: value $a_{i}$, and take the first
400: \begin{equation*}
401: n_{i}=\left\{
402: \begin{array}{l}
403: \gamma \\
404: \left\lfloor \frac{2\gamma }{\varepsilon }(1-\varepsilon )^{\alpha
405: +i-\left\lfloor 2/\varepsilon \right\rfloor -1}\right\rfloor%
406: \end{array}%
407: \right.
408: \begin{array}{l}
409: \text{for }i=1,...,\left\lfloor 2/\varepsilon \right\rfloor \text{,} \\
410: \text{otherwise,}%
411: \end{array}%
412: \end{equation*}%
413: items with the smallest weights we get in $Z_{i}$. Selecting the first $%
414: n_{i} $ items with the smallest weights can be done in $O(|Z_{i}|)$ time.
415: That is, $O(|Z_{i}|)$ time is sufficient to select the $n_{i}$-th item with
416: the smallest weight (see \cite{median-finding}) and only $O(|Z_{i}|)$
417: comparisons are needed to extract the $n_{i}-1$ items with smaller weights.
418: Therefore the amortized time is linear.
419: 
420: By using the arithmetic rounding technique for small items, we have at most $%
421: 2\gamma /\varepsilon $ small items with $1-\varepsilon $ loss (see Section %
422: \ref{Sect:arithmetic rounding}). While, by using the geometric rounding
423: technique described in Section \ref{Sect:Geometric rounding} for large
424: items, we have at most $\gamma /\varepsilon $ large items with $%
425: 1-\varepsilon $ loss. The resulting transformed instance has at most $%
426: 3\gamma /\varepsilon $ items with $1-2\varepsilon $ loss. Furthermore, let $%
427: \psi =\beta -\alpha +\left\lfloor 2/\varepsilon \right\rfloor +1$. Observe
428: that the $\psi $-th element of $S_{ag}(\gamma )$ is larger than $P^{H}$,
429: i.e. $a_{\psi }>P^{H}$. Consider any subset $S\subseteq N$ of items with at
430: most $\gamma $ items, and let $x_{i}$ denote the total number of items from $%
431: S$ with profit in interval $[a_{i},a_{i+1})$, $i=1,2,...\psi -1$. Let us
432: call vector $(x_{1},x_{2},...,x_{\psi -1})$ an $S$\textit{-configuration}.
433: It is easy to see that by using the reduced set of items it is always
434: possible to compute a solution having the same $S$-configuration, as any set
435: $S\subseteq N$ with $\gamma $ items. Summarizing:
436: 
437: \begin{lemma}
438: \label{Lemma: gamma}For any positive integer $\gamma \leq k$, it is possible
439: to compute in linear time a reduced set $N_{\gamma }\subseteq N$ of items
440: with at most $3\gamma /\varepsilon $ items, such that, for any subset $%
441: S\subseteq N$ with at most $\gamma $ items, there exists a subset $S_{\gamma
442: }\subseteq N_{\gamma }$ such that $S_{\gamma }$ is the subset of $N$ having
443: the same configuration as $S$ and with the least weights.
444: \end{lemma}
445: 
446: \begin{corollary}
447: \label{Corollary: gamma}For any subset $S\subseteq N$ with at most $\gamma $
448: items, there exists a subset $S_{\gamma }\subseteq N_{\gamma }$ with $%
449: w(S_{\gamma })\leq w(S)$, $|S_{\gamma }|=|S|$ and $p(S_{\gamma })\geq
450: p(S)-2\varepsilon \cdot OPT$.
451: \end{corollary}
452: 
453: \section{An improved PTAS for kKP}
454: 
455: Our PTAS for kKP improves the scheme of Caprara et al. \cite%
456: {Caprara:1998:NFP}, and in fact it strongly builds on their ideas. However,
457: there are several differences where a major one is the use of two reduced
458: sets of items instead of the entire set $N$: let $\ell :=\min \{\lceil
459: 1/\varepsilon \rceil -2,k\}$, where $\varepsilon \leq 1/2$ is an arbitrary
460: small rational number; our algorithm uses sets $N_{k}$ and $N_{\ell }$
461: computed by using the Arithmetic \& Geometric rounding technique (see Lemma %
462: \ref{Lemma: gamma}) when $\gamma :=k$ and $\gamma :=\ell $, respectively.
463: 
464: For any given instance of kKP, the approximation scheme performs the
465: following five steps (S-1)-(S-5).
466: 
467: \begin{enumerate}
468: \item[(S-1)] Initialize the solution $A$ to be the empty set and set the
469: corresponding value $P^{A}$ to $0$.
470: 
471: \item[(S-2)] Compute the reduced sets $N_{k}$ and $N_{\ell }$.
472: 
473: \item[(S-3)] Compute $P^{H}$, i.e. the solution value returned by $H^{\frac{1%
474: }{2}}$ when applied to the whole set of instances.
475: 
476: \item[(S-4)] Consider each $L\subseteq N_{\ell }$ such that $|L|\leq \ell $.
477: If $w(L)\leq c$, consider sequence $S_{ag}(\ell )=(a_{1},a_{2},...)$ and let
478: $h$ be the smallest integer such that $\min_{j\in L}p_{j}<a_{h+1}$ (assume $%
479: \min_{j\in L}p_{j}=0$ if $L=\varnothing $). Apply algorithm $H^{\frac{1}{2}}$
480: to the subinstance $S$ defined by item set $\{i\in N_{k}\backslash
481: L:p_{i}<a_{h+1}\}$, by capacity $c-w(L)$ and by cardinality upper bound $%
482: k-\ell $. Let $T$ and $P^{H}(S)$ denote the solution and the solution value
483: returned by $H^{\frac{1}{2}}$ when applied to $S$, respectively. If $%
484: p(L)+P^{H}(S)>P^{A}$ let $A:=L\cup T$ and $P^{A}:=p(L)+P^{H}(S)$.
485: 
486: \item[(S-5)] Return solution $A$ of value $P^{A}$.
487: \end{enumerate}
488: 
489: Observe that in step (S-4), subsets $L$ are computed by considering just the
490: items from $N_{\ell }$. On the other hand, in step (S-4), we remark that the
491: subinstances $S$ are defined by using items from $N_{k}$.
492: 
493: \subsection{Analysis of the Algorithm}
494: 
495: Step (S-2) can be performed in $O(n)$ time by Lemma \ref{Lemma: gamma}. Step
496: (S-3) runs in $O(n)$ time \cite{Caprara:1998:NFP}. In step (S-4) the
497: algorithm considers $O(|N_{\ell }|+|N_{\ell }|^{2}+...+|N_{\ell }|^{\ell
498: })=O(|N_{\ell }|^{\ell })$ subsets. For each $L$ the definition of
499: subinstance $S$ requires $O(|N_{k}|\cdot \ell )$ time. Algorithm $H^{\frac{1%
500: }{2}}$ applied to subinstance $S$ runs in $O(|S|)=O(|N_{k}|)$ time \cite%
501: {Caprara:1998:NFP}. By Lemma \ref{Lemma: gamma}, $|N_{k}|=O(k/\varepsilon )$
502: and $|N_{\ell }|=O(\ell /\varepsilon )$. Therefore, step (S-4) is performed
503: in $O(|N_{\ell }|^{\ell }\cdot |N_{k}|\cdot \ell )=O(k\cdot (\frac{\ell }{%
504: \varepsilon })^{\ell +1})=k\cdot (1/\varepsilon )^{O(1/\varepsilon )}$. It
505: follows that the overall running time of the algorithm is $O(n+k\cdot
506: (1/\varepsilon )^{O(1/\varepsilon )})$, and it is not difficult to check
507: that steps (S-1)-(S-5) require linear space. What remains to be shown is
508: that steps (S-1)-(S-5) return a $(1-O(\varepsilon ))$-approximate solution.
509: 
510: Consider sequence $S_{ag}(\ell )=(a_{1},a_{2},...)$. Let $\left\{
511: j_{1},...,j_{\ell },...\right\} $ be the set of items in an optimal solution
512: ordered so that $p_{j_{1}}\geq ...\geq p_{j_{\ell }}\geq ...$, and let $%
513: \lambda \leq \ell $ be the largest integer such that $p_{j_{\lambda }}\geq
514: a_{1}$ (if there is no item in the optimal solution with profit $\geq a_{1}$
515: then set $\lambda =0$). Let $L^{\ast }=\left\{ j_{1},...,j_{\lambda
516: }\right\} $ be the subset (possibly empty) obtained by picking the first $%
517: \lambda $ items with the largest profits. Consider subinstance $S^{\ast }$
518: defined by item set
519: \begin{equation*}
520: I_{S^{\ast }}=\{i\in N\backslash L^{\ast }\left\vert
521: \begin{array}{l}
522: p_{i}\leq \min_{j\in L^{\ast }}p_{j}\text{ if }L^{\ast }\neq \varnothing \\
523: p_{i}<a_{1}\text{, \ otherwise.}%
524: \end{array}%
525: \right\} ,
526: \end{equation*}%
527: by capacity $c-w(L^{\ast })$ and by cardinality upper bound $k-\lambda $.
528: Clearly,
529: \begin{equation}
530: p(L^{\ast })+OPT_{S^{\ast }}=OPT,  \label{Eq:ineq0}
531: \end{equation}%
532: where $OPT_{S^{\ast }}$ denotes the optimal value of instance $S^{\ast }$.
533: Now, consider the reduced set $N_{k}$ and subinstance $S_{k}^{\ast }$
534: defined by item set
535: \begin{equation}
536: I_{S_{k}^{\ast }}=\{i\in N_{k}\backslash L^{\ast }\left\vert
537: \begin{array}{l}
538: p_{i}\leq \min_{j\in L^{\ast }}p_{j}\text{ if }L^{\ast }\neq \varnothing \\
539: p_{i}<a_{1}\text{, \ otherwise.}%
540: \end{array}%
541: \right\} ,  \label{Def:Isk}
542: \end{equation}%
543: by capacity $c-w(L^{\ast })$ and by cardinality upper bound $k-\lambda $. By
544: Corollary \ref{Corollary: gamma}, we have
545: \begin{equation}
546: OPT_{S_{k}^{\ast }}\geq OPT_{S^{\ast }}-2\varepsilon OPT,  \label{Eq:ineq1}
547: \end{equation}%
548: where $OPT_{S_{k}^{\ast }}$ denotes the optimal value of instance $%
549: S_{k}^{\ast }$.
550: 
551: Let us use $L$ to denote the set of items having the same configuration as $%
552: L^{\ast }$ and the least weights. By Lemma \ref{Lemma: gamma}, in one of the
553: iterations of step (S-4), set $L$ is considered. In the remainder, let us
554: focus on this set $L$, and consider the corresponding subinstance $S$
555: defined in step (S-4). By Corollary \ref{Corollary: gamma}, we have
556: \begin{equation}
557: p(L)\geq p(L^{\ast })-2\varepsilon OPT.  \label{Eq:ineq2}
558: \end{equation}%
559: We need to show that the optimal solution value $OPT_{S}$ of instance $S$
560: cannot be smaller than $OPT_{S_{k}^{\ast }}$.
561: 
562: \begin{lemma}
563: \label{Lemma:Z}$OPT_{S}\geq $ $OPT_{S_{k}^{\ast }}$.
564: \end{lemma}
565: 
566: \begin{proof}
567: Assume $L$ having the same configuration as $L^{\ast }$. Recall that the
568: subinstance $S$ is defined by item set $I_{S}=\{i\in N_{k}\backslash
569: L:p_{i}<a_{h+1}\}$, where $a_{h+1}$ is the term of sequence $S_{ag}(\ell
570: )=(a_{1},a_{2},...)$ such that $h$ is the smallest integer with $\min_{j\in
571: L}p_{j}<a_{h+1}$ (see step (S-4)). On the other hand, the subinstance $%
572: S_{k}^{\ast }$ is defined by item set $I_{S_{k}^{\ast }}$ (see (\ref{Def:Isk}%
573: )). If $L^{\ast }=\varnothing $ then $S=S_{k}^{\ast }$ and the claim follows.
574: 
575: Otherwise ($L^{\ast }\neq \varnothing $), since we are assuming that $L$ has
576: the same configuration as $L^{\ast }$, there are no items from $L^{\ast }$
577: with profit in intervals $[a_{i},a_{i+1})$, for $i<h$. Therefore, we have $%
578: \min_{j\in L^{\ast }}p_{j}\geq a_{h}$ and $\{i\in N_{k}\backslash
579: L:p_{i}\leq a_{h}\}=\{i\in N_{k}\backslash L^{\ast }:p_{i}\leq a_{h}\}$.
580: Furthermore, since there is at least one item from $L$ with profit in
581: interval $[a_{h},a_{h+1})$ (recall we are assuming $L^{\ast }\neq
582: \varnothing $), and since $L^{\ast }$ has the same configuration as $L$,
583: there exists an item from $L^{\ast }$ with profit $p_{j}<$ $a_{h+1}$ and,
584: therefore, $\min_{j\in L^{\ast }}p_{j}<a_{h+1}$. It follows that $%
585: I_{S_{k}^{\ast }}\subseteq \{i\in N_{k}\backslash L^{\ast }:p_{i}<a_{h+1}\}$.
586: 
587: By the previous arguments, the items of $S_{k}^{\ast }$, except those
588: belonging to $A_{h}=\{i\in N_{k}\cap L:a_{h}\leq p_{i}<a_{h+1}\}$, are also
589: items of $S$, i.e.,
590: \begin{equation*}
591: I_{S_{k}^{\ast }}\subseteq I_{S}\cup A_{h}.
592: \end{equation*}
593: 
594: If there exists an optimal solution for $S_{k}^{\ast }$ such that no one of
595: the items from $A_{h}$ is selected, then $OPT_{S}\geq $ $OPT_{S_{k}^{\ast }}$%
596: , since the knapsack capacity of $S_{k}^{\ast }$ is not greater than the one
597: of $S$, i.e. $c-w(L)\geq c-w(L^{\ast })$ (recall that $L$ is the subset
598: having the same configuration as $L^{\ast }$ with the smallest weights).
599: 
600: Otherwise, let $G_{1}$ be the subset of items from $A_{h}$ in an optimal
601: solution for $S_{k}^{\ast }$, and let $g:=|G_{1}|$. Let $G_{2}$ be any
602: subset of $\{i\in L^{\ast }\backslash L:a_{h}\leq p_{i}<a_{h+1}\}$
603: containing exactly $g$ items. It is easy to see that $G_{2}$ exists (recall
604: that $L$ and $L^{\ast }$ have the same configurations and $A_{h}\subseteq L$%
605: ). Furthermore, since $G_{2}\subseteq L^{\ast }$ and $G_{1}\subseteq
606: I_{S_{k}^{\ast }}$, we have
607: \begin{equation}
608: \min_{j\in G_{2}}p_{j}\geq \max_{j\in G_{1}}p_{j}.  \label{eq:G1G2}
609: \end{equation}%
610: Observe that $w(L^{\ast })-w(L)\geq w(G_{2})-w(G_{1})$. Therefore, the
611: knapsack capacity $c-w(L)$ of $S$ cannot be smaller than $c-w(L^{\ast
612: })+w(G_{2})-w(G_{1})$. The solution $G_{12}$ obtained from the optimal
613: solution for $S_{k}^{\ast }$ by replacing the items from $G_{1}$ with those
614: from $G_{2}$, requires a knapsack of capacity bounded by $c-w(L^{\ast
615: })+w(G_{2})-w(G_{1})$. Therefore, $G_{12}$ is a feasible solution for $S$
616: since the capacity of $S$ is greater than the capacity of $S_{k}^{\ast }$ by
617: at least $w(G_{2})-w(G_{1})$. Finally, from inequality (\ref{eq:G1G2}), the
618: solution value of $G_{12}$ is not smaller than $OPT_{S_{k}^{\ast }}$ and the
619: claim follows.
620: \end{proof}
621: 
622: Let $P^{H}(S)$ denote the solution value returned by $H^{\frac{1}{2}}$ when
623: applied to $S$. Then we have the following
624: 
625: \begin{lemma}
626: $p(L)+P^{H}(S)\geq (1-4\varepsilon )OPT$.
627: \end{lemma}
628: 
629: \begin{proof}
630: Observe that by Lemma \ref{Lemma:Z} and inequality (\ref{Eq:ineq1}), we have
631: \begin{equation}
632: OPT_{S}\geq OPT_{S^{\ast }}-2\varepsilon OPT.  \label{Eq:ineq3}
633: \end{equation}
634: We distinguish between two cases.
635: 
636: \begin{enumerate}
637: \item If \bigskip $p(L^{\ast })\geq (1-\varepsilon )OPT$ then by
638: inequalities (\ref{Eq:ineq}), (\ref{Eq:ineq0}), (\ref{Eq:ineq2}) and (\ref%
639: {Eq:ineq3}), we have
640: \begin{eqnarray*}
641: p(L)+P^{H}(S) &\geq &p(L^{\ast })-2\varepsilon OPT+\frac{1}{2}OPT_{S} \\
642: &\geq &(1-\varepsilon )OPT-2\varepsilon OPT=(1-3\varepsilon )OPT.
643: \end{eqnarray*}
644: 
645: \item If $p(L^{\ast })<(1-\varepsilon )OPT$ then each item profit in $%
646: S^{\ast }$ is smaller than $\frac{(1-\varepsilon )}{\ell }OPT$. Indeed, if $%
647: \lambda =\ell $ then the smallest item profit in $L^{\ast }$, and hence each
648: item profit in $S^{\ast }$, must be smaller than $\frac{(1-\varepsilon )}{%
649: \ell }OPT$ (otherwise $p(L^{\ast })\geq (1-\varepsilon )OPT$); else ($%
650: \lambda <\ell $) by definition of $\lambda $, there are at most $\lambda $
651: items with profits not smaller than $a_{1}$ and therefore, each item profit
652: in $S^{\ast }$, must be smaller than $a_{1}=\frac{\varepsilon }{\ell }%
653: P^{H}\leq $ $\frac{\varepsilon }{\ell }OPT\leq \frac{(1-\varepsilon )}{\ell }%
654: OPT$ (since $\varepsilon \leq 1/2$). Now, we claim that the largest profit
655: in $S$ is at most $\frac{(1-\varepsilon )}{\ell }OPT+\frac{\varepsilon P^{H}%
656: }{\ell }$. Indeed, since by definition of $h$ we have $a_{h}\leq \frac{%
657: (1-\varepsilon )}{\ell }OPT\leq (1-\varepsilon )\frac{2P^{H}}{\ell }\leq
658: (\left\lfloor \frac{2}{\varepsilon }\right\rfloor -1)\frac{\varepsilon P^{H}%
659: }{\ell }$, it turns out that $h\leq \left\lfloor \frac{2}{\varepsilon }%
660: \right\rfloor -1$, and by definition of $S_{ag}(\ell )$, we have that $%
661: a_{h+1}=a_{h}+\frac{\varepsilon P^{H}}{\ell }$. Therefore, for each item $j$
662: belonging to $S$, profit $p_{j}$ is bounded by
663: \begin{equation*}
664: p_{j}\leq \frac{\varepsilon }{\ell }P^{H}+\frac{(1-\varepsilon )}{\ell }%
665: OPT\leq \frac{OPT}{\ell }.
666: \end{equation*}%
667: Since $OPT_{S}-P^{H}(S)\leq \max_{j\in S}p_{j}$ (see inequality (\ref%
668: {Eq:ineq})), we have
669: \begin{eqnarray*}
670: p(L)+P^{H}(S)+\frac{OPT}{\ell } &\geq &p(L)+OPT_{S} \\
671: &\geq &p(L^{\ast })+OPT_{S^{\ast }}-4\varepsilon \cdot OPT=(1-4\varepsilon
672: )OPT.
673: \end{eqnarray*}
674: \end{enumerate}
675: \end{proof}
676: 
677: By the previous lemma, steps (S-1)-(S-5) return a solution that cannot be
678: worse than $(1-4\varepsilon )OPT$. Thus, we have proved the following
679: 
680: \begin{theorem}
681: There is an PTAS for the k-item knapsack problem requiring linear space and $%
682: O(n+k\cdot (1/\varepsilon )^{O(1/\varepsilon )})$ time.
683: \end{theorem}
684: 
685: To compare our algorithm with the one provided in \cite{Caprara:1998:NFP}
686: notice that the running time complexity of the latter is $O(n^{\lceil
687: 1/\varepsilon \rceil -1})$, whereas our scheme is linear. As in \cite%
688: {Caprara:1998:NFP}, our algorithm can be easily modified to deal with the
689: \textit{Exact k-item Knapsack Problem}, that is a kKP in which the number of
690: items in a feasible solution must be exactly equal to $k$. The time and
691: space complexities, and the analysis of the resulting algorithm are
692: essentially the same as the one described above.
693: %
694: Compare also with the general problem solver developed in
695: \cite{Hutter:01fast}, where the elimination of a multiplicative
696: constant (here $1/\varepsilon$) led to a larger additive constant (here
697: $(1/\varepsilon)^{O(1/\varepsilon)}$).
698: %%% Local Variables:
699: %%% mode: latex
700: %%% TeX-master: "thesis"
701: %%% End:
702: 
703: \section{An improved FPTAS for kKP}
704: 
705: The main goal of this section is to present a different combination of
706: arithmetic and geometric rounding techniques. Moreover we propose an
707: improved fully polynomial time approximation scheme that runs in $%
708: O(n+k/\varepsilon ^{4}+1/\varepsilon ^{5})$ time. First we discuss
709: separately the different steps in details, then we state the main algorithm
710: and summarize the results in Section \ref{Sect:FPTASsmall}.
711: 
712: We start partitioning the set of items in two subsets $\mathcal{L}=\left\{
713: j:p_{j}>\varepsilon P^{H}\right\} $ and $\mathcal{S}=\left\{ j:p_{j}\leq
714: \varepsilon P^{H}\right\} $. Let us say that $\mathcal{L}$ is the set of
715: \emph{large} items, while $\mathcal{S}$ the set of \emph{small} items.
716: Observe that the number of large items in any feasible solutions is not
717: greater than $\lambda =\min \left\{ k,\left\lfloor 2/\varepsilon
718: \right\rfloor \right\} $, since $OPT\leq 2P^{H}$.
719: 
720: \subsection{Dynamic programming for large items}
721: 
722: In principle, an optimal solution could be obtained in the following way.
723: Enumerate all different solutions for items in $\mathcal{L}$, i.e., consider
724: all different sets $U\subseteq \mathcal{L}$ such that $w(U)\leq c$ and $%
725: |U|\leq k$. For each of these $U$, compute a set $T\subseteq \mathcal{S}$
726: such that $w(T)+w(U)\leq c$, $|U|+|T|\leq k$ and $p(T)$ is maximized. Select
727: from these solutions one with the largest overall profit. One of the
728: problems with this approach is that constructing all possible solutions for
729: items in $\mathcal{L}$ would require considering $n^{O(1/\varepsilon )}$
730: cases. To avoid the exponential dependence on $1/\varepsilon $ (our aim is
731: to obtain a fully polynomial approximation scheme), we will not treat
732: separately all of these solutions. We begin with the description of a basic
733: procedure that generates a list of all ``interesting'' feasible combinations
734: of profit and number of selected large items. Each such combination is
735: represented by a pair $(a,l)$, for which there is a subset of items $%
736: U\subseteq \mathcal{L}$ with $p(U)=a$, $|U|=l$ and $w(U)\leq c$. Moreover $%
737: w(U)$ is the smallest attainable weight for a subset of large items with
738: profit at least equal to $a$ and cardinality at most $l$. This list of all
739: ``interesting'' feasible combinations is computed by using a
740: pseudopolynomial dynamic programming scheme. Clearly, an optimal solution
741: can be computed by using only the subsets $U$ of large jobs associated to
742: each pair $(a,l)$. The time complexity will be then reduced, with $1-O\left(
743: \varepsilon \right) $ loss, by applying arithmetic and geometric rounding
744: techniques, as described in Section \ref{Sect:serialGeoArith}.
745: 
746: Let $\alpha $ be the number of large items, and let $\beta $ denote the
747: number of all distinct feasible solution values obtained by considering only
748: large items, i.e. $\beta $ is the size of set
749: \begin{equation*}
750: V=\left\{ p(U)|U\subseteq \mathcal{L}\text{ and }w(U)\leq c\ \text{and }%
751: |U|\leq k\right\} .
752: \end{equation*}%
753: A straightforward dynamic programming recursion which has time complexity $%
754: O(\alpha \beta \lambda )$ and space complexity $O(\lambda ^{2}\beta )$ (see
755: \cite{Caprara:1998:NFP}), can be stated as follows. Let us renumber the set
756: of items such that the first $1,...,|L|$ items are large. Denote by function
757: $g_{i}(a,l)$ for $i=1,...,|L|$, $a\in V$, $l=1,...,\lambda $, the optimal
758: solution of the following problem:
759: \begin{equation*}
760: g_{i}(a,l)=\min \sum_{j=1}^{i}w_{j}x_{j}:\left\vert
761: \begin{array}{l}
762: \sum_{j=1}^{i}p_{j}x_{j}=a; \\
763: \sum_{j=1}^{i}x_{j}=l; \\
764: x_{j}\in \left\{ 0,1\right\} ,j=1,...,i.%
765: \end{array}%
766: \right\}
767: \end{equation*}%
768: One initially sets $g_{0}(a,l)=+\infty $ for all $l=0,...,\lambda $, $a\in V$%
769: , and then $g_{0}(0,0)=0$. Then, for $i=1,...,|L|$ the entries for $g_{i}$
770: can be computed from those of $g_{i-1}$ by using the formula
771: \begin{equation*}
772: g_{i}(a,l)=\min \left\{
773: \begin{array}{l}
774: g_{i-1}(a,l), \\
775: g_{i-1}(a-p_{i},l-1)+w_{i}\text{ \ \ if }l>0\text{ and }a\geq p_{i}%
776: \end{array}%
777: \right\} .
778: \end{equation*}
779: 
780: Since $\beta =O(P^{H})$ the described dynamic programming algorithm is only
781: pseudopolynomial. In order to reduce the time complexity, we first
782: preprocess large items by using a combination of arithmetic and geometric
783: rounding techniques, then we apply the above dynamic programming scheme. We
784: start analyzing the two rounding techniques separately, then we show how to
785: combine them.
786: 
787: \subsubsection{Geometric rounding}
788: 
789: The time complexity of the described dynamic programming can be reduced by
790: decreasing the number $\alpha $ of large items and the number $\beta $ of
791: distinct solution values.
792: 
793: We observed in Section \ref{Sect:reduced N} that if we want to reduce as
794: much as possible the number of large items it is convenient to use geometric
795: rounding. Consider the geometric sequence $S_{g}(\gamma )$ described in
796: Section \ref{Sect:Geometric rounding}. By applying the geometric rounding
797: technique with $\gamma =\lambda $, the number $\alpha $ of large items can
798: be reduced from $O(n)$ to $O(1/\varepsilon ^{2})$ with $1-\varepsilon $ loss.
799: 
800: The next step is to compute the number of possible solution values after
801: geometric rounding, i.e. the cardinality $\beta $ of set $V$ after that all
802: profit values of large items have been geometrically rounded. The main
803: result of this section is stated as follows.
804: 
805: \begin{theorem}
806: \label{Th:GeoSumBounds}The number of solution values after geometric
807: rounding can be exponential in ${\frac{1}{\varepsilon }}$.
808: \end{theorem}
809: 
810: By the above theorem it follows that the running time of dynamic programming
811: after geometric rounding is a constant that may depend exponentially on ${%
812: \frac{1}{\varepsilon }}$. Therefore, to avoid this exponential dependence on
813: ${\frac{1}{\varepsilon }}$, we will look at other rounding techniques.
814: 
815: \paragraph{Proof of Theorem \protect\ref{Th:GeoSumBounds}.}
816: 
817: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
818: 
819: In the remaining part of this subsection we prove Theorem \ref%
820: {Th:GeoSumBounds}. The goal is to derive a lower bound on the number of
821: possible solution values after geometric rounding, i.e.\ a lower bound on $%
822: |V|$. Recall that we defined the geometric sequence $a_{i}={\frac{%
823: \varepsilon P^{H}}{\lambda }}({\frac{1}{1-\varepsilon }})^{i-1}$ in Section %
824: \ref{Sect:Geometric rounding}, and here we assume that $\gamma =\lambda $.
825: We focus on worst-case analysis. With this aim let us consider an instance $%
826: I $ that after geometric rounding has at least $\left\lfloor
827: P^{H}/a_{i}\right\rfloor $ items for each distinct profit value $a_{i}$.
828: Moreover, we assume that $w_{j}=p_{j}$ for every $j\in \mathcal{L}$, $%
829: c=P^{H} $ and $k\geq 1/\varepsilon $. By definition of instance $I$ we see
830: that every subset $U$ with $p(U)<P^{H}$ is a feasible solution. Indeed, we
831: have $w(U)<P^{H}=c$ and $|U|<p(U)/(\min_{j\in \mathcal{L}}p_{j})<1/%
832: \varepsilon \leq k$. By the previous arguments we see that $|V|$ is bounded
833: by below by the number of solution values $y=\sum_{i=0}^{\infty
834: }c_{i}a_{i+1}<P^{H}$ with $\mathbf{c}=(c_{0},c_{1},...)\in
835: I\!\!N_{0}^{\infty }$, where $I\!\!N_{0}^{\infty }$ is the set of sequences
836: with non-negative integer components. Inserting $a_{i}$ and $\varepsilon ={%
837: \frac{\varepsilon ^{\prime }}{1+\varepsilon ^{\prime }}}$ this is equivalent
838: to
839: \begin{equation}
840: \sum_{i=0}^{\infty }c_{i}\varepsilon ^{\prime }(1+\varepsilon ^{\prime
841: })^{i}<\lambda (1+\varepsilon ^{\prime }).  \label{cleqgam}
842: \end{equation}
843: Clearly
844: \begin{equation}
845: \sum_{i=0}^{\infty }c_{i}\varepsilon ^{\prime }(1+\varepsilon ^{\prime
846: })^{i}<1.  \label{cleq1}
847: \end{equation}
848: implies (\ref{cleqgam}), since $\lambda (1+\varepsilon ^{\prime })>1$.
849: 
850: For simplicity of notation we replace $\varepsilon ^{\prime }$ with $%
851: \varepsilon $, and we focus on the cardinality of sets of the form
852: \begin{equation*}
853: R_{\varepsilon }^{d}\;:=\;\left\{ y<1:y=\sum_{i=0}^{d-1}c_{i}\varepsilon
854: (1+\varepsilon )^{i},\quad \mathbf{c}\in I\!\!N_{0}^{d}\right\} ,
855: \end{equation*}
856: where $I\!\!N_{0}^{d}$ is the set of $d$-dimensional vectors $\mathbf{c}%
857: =(c_{0},c_{1},...,c_{d-1})$ with non-negative integer components. It is more
858: easy to find lower bounds on the set of vectors
859: \begin{equation}
860: S_{\varepsilon }^{d}\;:=\;\left\{ \mathbf{c}\in
861: I\!\!N_{0}^{d}:\sum_{i=0}^{d-1}c_{i}\varepsilon (1+\varepsilon
862: )^{i}<1\right\}  \label{Sdef}
863: \end{equation}
864: itself. To consider $|S_{\varepsilon }^{d}|$ instead of $|R_{\varepsilon
865: }^{d}|$ is justified by the following Lemma.
866: 
867: \begin{lemma}
868: \label{lemOnto} For rational and for transcendental $\varepsilon >0$, the
869: sets $R_{\varepsilon }^{d}$ and $S_{\varepsilon }^{d}$ have the same
870: cardinality, i.e.\ the mapping $f:S_{\varepsilon }^{d}\rightarrow
871: R_{\varepsilon }^{d}$ with $f(\mathbf{c})=\sum_{i=0}^{d-1}c_{i}\varepsilon
872: (1+\varepsilon )^{i}$ is one-to-one and onto.
873: \end{lemma}
874: 
875: \begin{proof}[\textbf{Proof for transcendental $\protect\varepsilon$}]
876: \begin{equation*}
877: y=y^{\prime }\quad \Leftrightarrow \quad \sum_{i=0}^{d-1}b_{i}x^{i}=0\quad
878: \text{with}\quad b_{i}:=c_{i}-c_{i}^{\prime }\in Z\!\!\!Z\quad \text{and}%
879: \quad x:=1+\varepsilon
880: \end{equation*}
881: A real number is said to be transcendental if it is not the root of a
882: polynomial with integer coefficients. For transcendental $\varepsilon $ also
883: $x$ is transcendental, which implies $b_{i}\equiv 0$. Hence, $y=y^{\prime }$
884: implies $\mathbf{c}=\mathbf{c}^{\prime }$. Obviously $\mathbf{c}=\mathbf{c}%
885: ^{\prime }$ implies $y=y^{\prime }$. This proves that $S_{\varepsilon }^{d}$
886: has the same cardinality as $R_{\varepsilon }^{d}$ for transcendental $%
887: \varepsilon $.
888: 
889: \textbf{Proof for rational $\varepsilon$.} Assume by contradiction that
890: there are two different vectors $\mathbf{c}\neq \mathbf{c}^{\prime }\in {%
891: I\!\!N}_{0}^d$ with same solution value $y=y^{\prime }$. Let $n$ be the
892: largest index $i$ such that $c_{i}\neq c_{i}^{\prime }$. Furthermore, let $%
893: \varepsilon ={\frac{p}{q}}-1>0$ be rational with $p>q\in{I\!\!N} $ having no
894: common factors. With $\mathbf{b}:=\mathbf{c}-\mathbf{c}^{\prime } $ we have
895: \begin{eqnarray*}
896: 0\; &=&\;[y-y^{\prime }]\;=\;\sum_{i=0}^{d-1}b_{i}\varepsilon(1+\varepsilon
897: )^{i}\; \\
898: &=&\;\varepsilon\sum_{i=0}^{n}b_{i}{\frac{p^{i}}{q^{i}}}\;=\;{\frac{%
899: \varepsilon}{q^{n}}}\Big[b_{n}p^{n}+q\overbrace{%
900: \sum_{i=0}^{n-1}[b_{i}p^{i}q^{n-i-1}]}^{integer}\Big]
901: \end{eqnarray*}
902: Since the last term $q\sum [...]$ is a multiple of $q$, $y-y^{\prime }$ can
903: only be zero if also $b_{n}p^{n}$ is a multiple of $q$. With $p$ also $p^{n}$
904: has no common factor with $q$, hence $b_{n}$ must itself be a multiple of $q$%
905: . The sum in (\ref{Sdef}) can only be less than 1 if each term is less than
906: 1, i.e.\ $c_{i}\varepsilon (1+\varepsilon )^{i}<1$. This implies
907: \begin{equation}
908: c_{i}<\varepsilon ^{-1}(1+\varepsilon )^{-i}\leq \varepsilon ^{-1}\quad
909: \text{for all}\quad i.  \label{ckbnd}
910: \end{equation}
911: Together we get
912: \begin{equation*}
913: 0\leq c_{n}^{_{(}}{\!\displaystyle^{\prime }}^{_{)}}<{\frac{1}{\varepsilon }}%
914: ={\frac{q}{p-q}}<q \;\Rightarrow\; |b_{n}|=|c_{n}-c_{n}^{\prime }|<q
915: \;\Rightarrow\; b_{n}=0 \;\Rightarrow\; c_{n}=c_{n}^{\prime }
916: \end{equation*}
917: which contradicts our assumption $c_{n}\neq c_{n}^{\prime }$. Hence, $%
918: y=y^{\prime }$ implies $\mathbf{c}=\mathbf{c}^{\prime }$. Again, that $%
919: \mathbf{c}=\mathbf{c}^{\prime }$ implies $y=y^{\prime }$ is obvious. This
920: shows that $S_{\varepsilon }$ has the same cardinality as $R_{\varepsilon }$
921: for rational $\varepsilon $.
922: \end{proof}
923: 
924: We don't know whether Lemma \ref{lemOnto} also holds for algebraic $%
925: \varepsilon$. The following Lemma lower bounds $S_\varepsilon^\infty$.
926: 
927: \begin{lemma}
928: \label{lemGeoBnd} $|S_\varepsilon^\infty| \;\geq\; Ce^{B/\varepsilon} \quad%
929: \text{with}\quad B=0.3172... \quad\text{and}\quad C=0.3200... $
930: \end{lemma}
931: 
932: \begin{proof}
933: From (\ref{ckbnd}) we see that all $c_{i}$ are zero for too large $i$ ($%
934: c_{i}=0\,\forall i\geq d_{max}:=\lceil {\frac{\ln (1/\varepsilon )}{\ln
935: (1+\varepsilon )}}\rceil $). This shows that $|S_{\varepsilon }^{1}|\leq
936: |S_{\varepsilon }^{2}|\leq ...\leq |S_{\varepsilon
937: }^{d_{max}}|=|S_{\varepsilon }^{d_{max}+1}|=...=|S_{\varepsilon }^{\infty }|$%
938: . The main idea in the following is to relate $S_{\varepsilon }^{d}$ to the
939: volume of a $d$-dimensional simplex with volume larger than $%
940: Ce^{B/\varepsilon }$ for suitable $d$.
941: 
942: We define a $d$-dimensional subset $U_{\varepsilon }^{d}\subset {I\!\!R}^{d}$%
943: , which is the disjoint union of unit cubes $[c_{0},c_{0}+1)\times ...\times
944: \lbrack c_{d-1},c_{d-1}+1)$ for every $\mathbf{c}\in S_{\varepsilon }^{d}$.
945: This set can be represented in the following form
946: \begin{equation*}
947: U_{\varepsilon }^{d}\;:=\;\left\{ \mathbf{r}\in \lbrack 0,\infty
948: )^{d}:\sum_{i=0}^{d-1}\lfloor r_{i}\rfloor \varepsilon (1+\varepsilon
949: )^{i}<1\right\}
950: \end{equation*}
951: The volume $\text{Vol}(U_{\varepsilon }^{d})$ coincides with the cardinality
952: of set $S_{\varepsilon }^{d}$ since each point in $S_{\varepsilon }^{d}$
953: corresponds to exactly one unit cube in $U_{\varepsilon }^{d}$, each having
954: volume 1. Furthermore, let us define the $d$-dimensional (irregular)
955: tetrahedron
956: \begin{equation*}
957: T_{\varepsilon }^{d}\;:=\;\left\{ \mathbf{r}\in \lbrack 0,\infty
958: )^{d}:\sum_{i=0}^{d-1}r_{i}\varepsilon (1+\varepsilon )^{i}<1\right\}
959: \end{equation*}
960: Obviously $T_{\varepsilon }^{d}\subseteq U_{\varepsilon }^{d}$, since $%
961: \lfloor r_{i}\rfloor \leq r_{i}$. So we have $|S_{\varepsilon }^{\infty
962: }|\geq |S_{\varepsilon }^{d}|=\text{Vol}(U_{\varepsilon }^{d})\geq \text{Vol}%
963: (T_{\varepsilon }^{d}).$ The tetrahedron $T_{\varepsilon }^{d}$ is
964: orthogonal at the vertex $\mathbf{r}=0$. The edges $\mathbf{r}%
965: =(0,...,0,r_{i},0,...,0)$ have lengths $[\varepsilon (1+\varepsilon
966: )^{i}]^{-1}$, $i=0...d-1$. Hence, the volume of the tetrahedron is
967: \begin{eqnarray*}
968: \text{Vol}(T_{\varepsilon }^{d})\; &=&\;{\frac{1}{d!}}\prod_{i=0}^{d-1}[%
969: \varepsilon (1+\varepsilon )^{i}]^{-1}\;=\;[d!\,\varepsilon
970: ^{d}(1+\varepsilon )^{d(d-1)/2}]^{-1}\; \\
971: &\geq &\;e^{[-(d\varepsilon )\ln (d\varepsilon )-{\frac{1}{2}}(d\varepsilon
972: )^{2}]/\varepsilon }\;=\;e^{f(d\varepsilon )/\varepsilon }
973: \end{eqnarray*}
974: with $f(x):=-x\,\ln x-{{\frac{1}{2}}}x^{2}$. In the inequality we replaced $%
975: d-1$ by $d$ and used $d!\leq d^{d}$ and $1+\varepsilon \leq e^{\varepsilon }$%
976: . The best bound is found by maximizing $e^{f(\varepsilon d)/\varepsilon }$
977: w.r.t.\ $d$, or equivalently by maximizing $f(x)$ w.r.t.\ $x$. We have $%
978: -f^{\prime }(A)=\ln A+1+A=0$ for $A=0.2784...$. Hence, $d$ should be chosen
979: as ${\frac{A}{\varepsilon }}$, but since $d$ is integer we have to round
980: somehow, for instance $d=\lfloor {\frac{A}{\varepsilon }}\rfloor $. Note
981: that $|S_{\varepsilon }^{d}|$ increases with $d$, but our approximation
982: becomes crude for $d$ near $d_{max}$. This is the reason why the maximizing $%
983: d$ is less than $d_{max}$. For small $\varepsilon $ we have $f(\varepsilon
984: \lfloor {\frac{A}{\varepsilon }}\rfloor )\approx f(\varepsilon {\frac{A}{%
985: \varepsilon }})=f(A)=-A\,\ln A-{{\frac{1}{2}}}A^{2}=A(1+{{\frac{1}{2}}}%
986: A)=:B=0.3172...$ with corrections of order $O(\varepsilon )$. This
987: establishes an asymptotic bound $\sim e^{B/\varepsilon }$. More exactly, one
988: can show that $f(\varepsilon \lfloor {\frac{A}{\varepsilon }}\rfloor )\geq
989: f(A)(1-{\frac{\varepsilon }{A}})$ for all $\varepsilon $. This yields the
990: bound
991: \begin{equation*}
992: |S_{\varepsilon }^{\infty }|\;\geq \;\max_{d}\text{Vol}(T_{\varepsilon
993: }^{d})\;\geq \;e^{f(A)(1-{\frac{\varepsilon }{A}})/\varepsilon
994: }\;=\;Ce^{B/\varepsilon }\quad \text{with}\quad C=e^{-B/A}=0.3200...
995: \end{equation*}
996: \end{proof}
997: 
998: The coefficient $B$ can be improved to $0.7279...$ for sufficiently small $%
999: \varepsilon$ by using the more accurate Stirling approximation for $d!$.
1000: 
1001: Using Lemma \ref{lemOnto} and \ref{lemGeoBnd} it is now easy to lower bound
1002: the number of possible solution values for geometric profit distribution.
1003: >From Lemma \ref{lemGeoBnd} we know that (\ref{cleq1}) has at least $%
1004: Ce^{B/\varepsilon }$ solution vectors $\mathbf{c}$ and from Lemma \ref%
1005: {lemOnto} that (\ref{cleqgam}) has at least $Ce^{B/\varepsilon }$ solution
1006: values $y$ for rational $\varepsilon $, and the proof of Theorem \ref%
1007: {Th:GeoSumBounds} follows.
1008: 
1009: \subsubsection{Arithmetic rounding}
1010: 
1011: Alternatively, we may think to apply arithmetic rounding to the set of large
1012: items. Let us consider the arithmetic sequence $S_{a}(\gamma )$ described in
1013: Section \ref{Sect:arithmetic rounding}. By applying the arithmetic rounding
1014: technique with $\gamma =\lambda $, we observe the number of large items can
1015: be reduced to be bounded by $O(\frac{1}{\varepsilon ^{2}}\ln \frac{1}{%
1016: \varepsilon })$ with $1-\varepsilon $ loss. Moreover each element of set $V$
1017: is equal to $\frac{\varepsilon P^{H}}{\lambda }i$ for some $i=\lambda
1018: ,\lambda +1,...,2\left\lfloor \lambda /\varepsilon \right\rfloor $. It
1019: follows that the size of set $V$ is bounded by $O(1/\varepsilon ^{2})$, and
1020: the overall time of the dynamic programming algorithm is now $O(\frac{1}{%
1021: \varepsilon ^{5}}\ln \frac{1}{\varepsilon })$. We see that in comparison to
1022: the geometric rounding and although the number of large items is larger, the
1023: arithmetic rounding technique is able to reduce much more the size of set $V$%
1024: . However and again, we can take advantage from both techniques by combining
1025: them as described in the following.
1026: 
1027: \subsubsection{Serial Geometric \& Arithmetic rounding\label%
1028: {Sect:serialGeoArith}}
1029: 
1030: We first apply geometric rounding with $1-\varepsilon $ loss. This reduces
1031: the number of large items to be bounded by $O(1/\varepsilon ^{2})$. Then,
1032: with $1-\varepsilon $ loss, we apply arithmetic rounding on the reduced set
1033: of large items. Clearly the latter does not increase the number of items and
1034: each profit value is now equal to $\frac{\varepsilon P^{H}}{\lambda }i$ for
1035: some $i=\lambda ,\lambda +1,...,2\left\lfloor \lambda /\varepsilon
1036: \right\rfloor $. By using this set of items with profits rounded by using
1037: geometric first and arithmetic rounding then, the size of set $V$ has a
1038: bound of $O(1/\varepsilon ^{2})$, and the overall time of the dynamic
1039: programming algorithm is $O(1/\varepsilon ^{5})$. We call this combination a
1040: \textit{Serial Geometric \& Arithmetic rounding technique}.
1041: 
1042: \subsection{Adding small items\label{Sect:FPTASsmall}}
1043: 
1044: In the following we show how to add the small items. First, with $%
1045: 1-2\varepsilon $ loss, we reduce the number of small items to be $%
1046: O(k/\varepsilon )$ by using the Parallel Arithmetic \& Geometric rounding
1047: (see Section \ref{Sect:arith_geo}). Then, for each pair $(a,l)$ in the final
1048: list, fill in the remaining knapsack capacity $c-g_{|L|}(a,l)$ with at most $%
1049: k-l$ small items, by using algorithm $H^{\frac{1}{2}}$ for kKP \cite%
1050: {Caprara:1998:NFP}. These small items yield total profit $%
1051: P^{H}(c-g_{|L|}(a,l),k-l)$. By inequality (\ref{Eq:ineq}) and by definition
1052: of small items, we have
1053: \begin{equation}
1054: P^{H}(c-g_{|L|}(a,l),k-l)+\varepsilon P^{H}\geq OPT(c-g_{|L|}(a,l),k-l),
1055: \label{eq:ineqFPTAS}
1056: \end{equation}
1057: where $OPT(c-g_{|L|}(a,l),k-l)$ is the optimal solution value obtained by
1058: using at most $k-l$ small items and knapsack capacity $c-g_{|L|}(a,l)$. The
1059: approximate solution, a combination of large and small items, is chosen to
1060: yield profit $P$, where
1061: \begin{equation*}
1062: P=\max_{(a,l)}\left\{ a+P^{H}(c-g_{|L|}(a,l),k-l)\right\}
1063: \end{equation*}
1064: By inequality (\ref{eq:ineqFPTAS}) and since our algorithms considers all
1065: the ``interesting'' pairs $(a,l)$ with $1-O(\varepsilon )$ loss, it is easy
1066: to verify that $P$ is $1-O(\varepsilon )$ times the optimal solution.
1067: 
1068: To summarize, the steps of the FPTAS are as follows.
1069: 
1070: \begin{enumerate}
1071: \item[(S-1)] Partition the set of items into ``large'' and ``small''. Apply
1072: the Serial Geometric \& Arithmetic rounding technique to the set of large
1073: items. Apply the Parallel Arithmetic \& Geometric rounding technique to the
1074: set of small items.
1075: 
1076: \item[(S-2)] Solve for the ``large'' items using dynamic programming:
1077: generate a list of all ``interesting'' feasible combinations $(a,l)$ of
1078: profit $a$ and number $l$ of selected large items.
1079: 
1080: \item[(S-3)] For each pair $(a,l)$ in the final list, fill in the knapsack
1081: by applying algorithm $H^{\frac{1}{2}}$ with the reduced set small items.
1082: 
1083: \item[(S-4)] Return the best found solution.
1084: \end{enumerate}
1085: 
1086: Step (S-1) can be performed in $O(n)$ time. Step (S-2) takes $%
1087: O(1/\varepsilon ^{5})$ time. Algorithm $H^{\frac{1}{2}}$ applied to the
1088: reduced set of small items runs in $O(k/\varepsilon )$ time \cite%
1089: {Caprara:1998:NFP}. In step (S-3) the algorithm considers $O(1/\varepsilon
1090: ^{3})$ pairs, for each one performing operations that require $%
1091: O(k/\varepsilon )$ time. It follows that the overall running time of the
1092: algorithm is $O(n+k/\varepsilon ^{4}+1/\varepsilon ^{5})$. The space
1093: complexity has a bound of $O(n+1/\varepsilon ^{4})$, since the space
1094: required by the dynamic programming is $O(\lambda ^{2}\beta )$ where $%
1095: \lambda =O(1/\varepsilon )$ and $\beta =O(1/\varepsilon ^{2})$.
1096: 
1097: \begin{theorem}
1098: There is a fully polynomial time approximation scheme for the k-item
1099: knapsack problem requiring $O(n+k/\varepsilon ^{4}+1/\varepsilon ^{5})$ time
1100: and $O(n+1/\varepsilon ^{4})$ space.
1101: \end{theorem}
1102: 
1103: \paragraph{Acknowledgments.}
1104: 
1105: Thanks are due to Klaus Jansen for introducing us to the k-item Knapsack
1106: Problem. We are grateful to the referees who pointed out some mistakes in
1107: the early version of this paper.
1108: 
1109: \begin{thebibliography}{9}
1110: \bibitem{median-finding} M.~Blum, R.~W. Floyd, V.~Pratt, R.~Rivest, and
1111: R.~Tarjan. \newblock Time bounds for selection.
1112: \newblock {\em Journal of
1113: Computer and System Sciences}, 7:448--461, 1973.
1114: 
1115: \bibitem{Caprara:1998:NFP} A.~Caprara, H.~Kellerer, U.~Pferschy, and
1116: D.~Pisinger. \newblock Approximation algorithms for knapsack problems with
1117: cardinality constraints.
1118: \newblock {\em European Journal of Operational
1119: Research}, 123:333--345, 2000.
1120: 
1121: \bibitem{CLR92} T.~H. Cormen, C.~E. Leiserson, and R.~L. Rivest. \newblock
1122: \emph{Introduction to algorithms}. \newblock MIT Press and McGraw-Hill Book
1123: Company, 6th edition, 1992.
1124: 
1125: \bibitem{H95} D.~Hochbaum, editor.
1126: \newblock {\em Approximation Algorithms
1127: for NP-hard Problems}. \newblock ITP, 1995.
1128: 
1129: \bibitem{Hutter:01fast}
1130: M.~Hutter.
1131: \newblock The fastest and shortest algorithm for all well-defined problems.
1132: \newblock {\em International Journal of Foundations of Computer Science},
1133:   13(3):431--443, 2002.
1134: 
1135: \bibitem{IbarraKim:1975} O.~H. Ibarra and C.~E. Kim. \newblock Fast
1136: approximation algorithms for the knapsack and sum of subset problems. %
1137: \newblock {\em J. Assoc. Comput. Mach.}, 22:463--468, 1975.
1138: 
1139: \bibitem{Kellerer:1998:NFP} H.~Kellerer and U.~Pferschy. \newblock A new
1140: fully polynomial approximation scheme for the knapsack problem. \newblock
1141: \emph{APPROX'98}, LNCS 1444:123--134, 1998.
1142: 
1143: \bibitem{app:Lawler:77} E.~L. Lawler. \newblock Fast approximation
1144: algorithms for knapsack problems.
1145: \newblock {\em Proc. 18th Ann. Symp. on
1146: Foundations of Computer Science}, pages 206--218, 1977.
1147: 
1148: \bibitem{MarToth90} S.~Martello and P.~Toth.
1149: \newblock {\em Knapsack
1150: Problems}. \newblock Wiley, 1990.
1151: 
1152: \bibitem{MegTam:93} N.~Megiddo and A.~Tamir. \newblock Linear time
1153: algorithms for some separable quadratic programming problems. \newblock
1154: \emph{Operations Research Letters}, 13:203--211, 1993.
1155: \end{thebibliography}
1156: 
1157: \end{document}
1158: