Keywords

1 Introduction

In [1, 2, 4, 5] the proximity of the optimal value of the (one-dimensional) knapsack problem to the optimal value of the problem with the cardinality constraints was studied. The cardinality constraint is the additional restriction that only k type of items is allowed to include in the solution (i.e. that only k coordinates of the optimal solution vector can be non-zero). Different upper and lower bounds for the guaranteed precision, i.e. for the infinum of the ratio of the optimal value for the objective functions of the problem with the cardinality constraints and without them, were obtained. Also, in some cases the classes of worst problems were constructed.

The importance of such kind of research is due to the fact that some algorithms for solving the knapsack problems require to find an optimal solution to that problem with the cardinality constraints; see, for example [4, 5], where this approach is used for constructing greedy heuristics for the integer knapsack problem. Moreover, the results of research can be potentially useful for constructing new fully polynomial approximation schemes.

Here, from this point of view, we consider the m-dimensional knapsack problem. The solution to that problem with the additional constraint that only 1 coordinate can be non-zero is called the approximate solution. We derive exact and asymptotic formulas for the precision of such approximation. In particular, we prove that the precision tends to \(0.59136\dots /m\) if \(n\rightarrow \infty \) and m is fixed. Also, we give a class of worst multi-dimensional knapsack problems for which the bound is attained.

2 Definitions

Denote by \({\mathbb {Z}}_+\), \({\mathbb {R}}_+\) the sets of all non-negative integer and real numbers respectively. Let

$$ L(A, b) = \left\{ x\in {\mathbb {Z}}_+^n:~ Ax\le b\right\} , \qquad A=(a_{ij})\in {\mathbb {R}}_+^{m\times n}, \qquad b=(b_i) \in {\mathbb {R}}_+^m. $$

The integer m-dimensional knapsack problem is to find x such that

$$\begin{aligned} cx \rightarrow \max \qquad \text {s.t. } x\in L(A,b), \end{aligned}$$
(1)

where \(c=(c_j)\in {\mathbb {R}}_+^n\) [3, 6].

Denote by \(v^{(j)}\) (\(j=1,2,\dots ,n\)) a point in L(Ab), all of whose coordinates \(v^{(j)}_i\) are 0, except for of \(v^{(j)}_j\), which is

$$ v^{(j)}_j = \min _{i:~a_{ij} > 0} \left\lfloor b_i/a_{ij} \right\rfloor . $$

It is not hard to see that \(v^{(j)}\in L(A,b)\) and \(cv^{(j)}=c_jv^{(j)}_j\). Denote \(V(A,b) = \left\{ v^{(1)},\dots ,v^{(n)}\right\} \). A point \(v^{(j)}\), on which the maximum

$$ \max _j cv^{(j)} $$

attained is called an approximate solution to the problem (1). The precision of the approximate solution is

$$ \alpha (A,b,c) = \frac{\max \limits _{x\in V(A,b)}cx}{\max \limits _{x\in L(A,b)}cx}. $$

In this paper we study the value

$$ \alpha _{mn} = \inf _{\begin{array}{c} A\in {\mathbb {R}}_+^{m\times n}\\ b\in {\mathbb {R}}_+^m,~ c\in {\mathbb {R}}_+^n \end{array}} \alpha (A,b,c). $$
Table 1. Values of \(\delta _n\), \(\varepsilon _n\) and \(\alpha _{1n}\) for small n

3 Previous Work

The precision of the approximate solution to the 1-dimensional (\(m=1\)) knapsack problem was studied in [1, 2, 4, 5]. In particular, in [2, 4] it was proven that

$$ \delta _n=\delta _{n-1}(\delta _{n-1}+1), \qquad \varepsilon _n=1+\varepsilon _{n-1}(\delta _{n-1}+1), \qquad \delta _1=\varepsilon _1=1. $$

The sequence \(\left\{ \delta _n\right\} \) is the A007018 sequence in On-Line Encyclopedia of Integer Sequences (OEIS)  [7]. The sequence \(\left\{ \epsilon _n\right\} \) is currently absent in OEIS.

The sequence \(\alpha _{1n}=\delta _n/\varepsilon _n\) decreases monotonously and tends to the value \(\alpha _{1\infty } = 0.591355492056890\dots \) The values for \(\delta _n\), \(\varepsilon _n\) and \(\alpha _{1n}\) for small n are presented in Table 1.

In [4, 5] these results are used in constructing the approximate scheme for the integer knapsack problem. Note that \(\alpha _{1n}\) is even higher than the guaranteed precision 0.5 of the greedy algorithm [6].

The infinum for \(\alpha _{1n}\) is achieved on the problem (the worst case)

$$ \sum _{j=1}^n \frac{x_j}{\delta _j} \rightarrow \max $$

s.t.

$$ \sum _{j=1}^n \frac{x_j}{\delta _j+\mu _n} \le 1, $$

where \(0\le \mu _n<1\) and . In particular,

$$ \mu _1 = 1, \quad \mu _2 = \frac{\sqrt{5}-1}{2} = 0.61803\dots , \quad \mu _3 = 0.93923\dots , \quad \mu _4 = 0.99855\dots $$

The optimal solution vector to this problem is \((1,1,\dots ,1)\) and the optimal solution value is \(\varepsilon _n/\delta _n\), whereas the approximate solution vectors are

$$ (1,0,0\dots ,0),\quad (0,\delta _2,0,\dots ,0),\quad (0,0,\delta _3,\dots ,0),\quad \dots ,\quad (0,0,0,\dots ,\delta _n) $$

and the corresponding value of the objective function is 1.

Lower and upper bounds for the guaranteed precision for \(k\ge 2\) are obtained in [2].

In this paper we obtain formulas for \(\alpha _{mn}\) for \(m \ge 1\). In particular, we prove that if \(n\rightarrow \infty \) and m is fixed.

4 Preliminaries

Lemma 1

For any fixed m the sequence \(\left\{ \alpha _{mn}\right\} \) decreases monotonously.

Proof

Let \(A\in {\mathbb {R}}_+^{m\times n}\), \(h,b\in {\mathbb {R}}_+^m\), \(c\in {\mathbb {R}}_+^n\) and \(h>b\). Consider a matrix \(A'=(A \mid h)\in {\mathbb {R}}_+^{m\times (n+1)}\) and a vector \(c' = (c, 0)\in {\mathbb {R}}_+^{n+1}\). It is not hard to see that all points in \(L(A',b)\) are obtained from the points in L(Ab) by writing the zero component to the end. Hence \(\alpha (A,b,c)=\alpha (A',b,c')\ge \alpha _{m,n+1}\). Due to the arbitrariness of A, b, c, we get \(\alpha _{mn} \ge \alpha _{m,n+1}\).

Lemma 2

\(\alpha (A,b,c) = \alpha (A',b,c)\) for some \(A' \le A\), where each column of \(A'\) contains at least one non-zero element.

Proof

Let for some s, t we have \(a_{st} > 0\) and for all \(i\ne s\)

$$ \left\lfloor \frac{b_s}{a_{st}} \right\rfloor \le \left\lfloor \frac{b_i}{a_{it}} \right\rfloor $$

(if there are no such s, t, then put \(A'=A\) and \(A'\) has the required form). From the matrix A we construct a matrix \(A'\) by setting \(a'_{it} = 0\) for all \(i\ne s\) and \(a'_{ij}=a_{ij}\) otherwise.

For all \(x\in {\mathbb {R}}_+^n\) we have \(A'x \le Ax\). Hence \(L(A,b)\subseteq L(A',b)\). Hence

$$ \max _{x\in L(A,b)} cx \le \max _{x\in L'(A,b)} cx. $$

But

$$ \min _{k:~a_{kj}>0} \left\lfloor \frac{b_k}{a_{kj}} \right\rfloor = \min _{k:~a'_{kj}>0} \left\lfloor \frac{b_k}{a'_{kj}} \right\rfloor \qquad (j=1,2,\dots ,n), $$

hence \(V(A,b) = V(A',b)\). Now we have

$$ \alpha (A,b,c) = \frac{\max \limits _{x\in V(A,b)} cx}{\max \limits _{x\in L(A,b)} cx} \ge \frac{\max \limits _{x\in V(A',b)} cx}{\max \limits _{x\in L(A',b)} cx} = \alpha (A',b,c). $$

To complete the proof we note that the procedure described above can be performed until the matrix \(A'\) acquires the required form.

From Lemma 2 it follows that to study \(\alpha _{mn}\) it is enough to consider only multi-dimensional knapsack problems with constraints

that can be called a direct product of m knapsack problems. All inequalities \(0\le b_i\) have to be deleted due to Lemma 1. Denote \(n_i = l_i - l_{k-1}\), where \(l_0=0\), \(l_m=n\) (\(i=1,2,\dots ,m\)). Thus, we have proved the following.

Lemma 3

For each m, n the infimum \(\alpha _{mn}\) is attained on the direct product of knapsack problems.

5 The Main Result

The main result of the paper is formulated in the following theorem.

Theorem 1

For each m, n

(2)

where \(n=qm+r\), \(q = \left\lfloor n/m \right\rfloor \).

The theorem follows from two lemmas below.

Lemma 4

For each m, n

Proof

Thanks to Lemma 3, it is enough to consider only direct products of m knapsack problems. Let \(\tau _i = \gamma _i/\beta _i\) be the precision of approximate solution to the i-th knapsack problem \((i=1,2,\dots ,m)\), where \(\gamma _i\) is the approximate solution value, \(\beta _i\) is the optimal solution value. For their product we have

The inequality turns into equality if and only if \(\gamma _1=\gamma _2=\dots =\gamma _m\). Since \(\tau _s\ge \alpha _{1n_1}\) then

Thus, we obtain the problem to find \(n_1,n_2,\dots ,n_m\) such that

(3)

The sequence

$$ \frac{1}{\alpha _{1,n+1}} - \frac{1}{\alpha _{1n}} = \frac{\varepsilon _{n+1}}{\delta _{n+1}} - \frac{\varepsilon _n}{\delta _n} = \frac{1+\varepsilon _n(\delta _n+1)}{\delta _{n+1}} - \frac{\varepsilon _n(\delta _n+1)}{\delta _{n+1}} = \frac{1}{\delta _{n+1}} $$

decreases monotonously as \(n\rightarrow \infty \), hence

$$ \frac{1}{\alpha _{1,n+2}} + \frac{1}{\alpha _{1n}} \le \frac{2}{\alpha _{1,n+1}}. $$

We conclude that the minimum for (3) is reached if \(n_1=\dots = n_r = q+1\), \(n_{r+1} = \dots = n_m = q\). Thus,

In the following lemma we construct a class of (worst) multi-dimensional knapsack problems on which the bound (2) is attained.

Lemma 5

For each m and n

where \(n=qm+r\), \(q = \left\lfloor n/m \right\rfloor \).

Proof

Consider the direct product of r knapsack problems of the form

$$ \max \sum _{j=1}^{q+1}\frac{x_j}{\delta _j} \rightarrow \max \qquad \text {s.t. } \sum _{j=1}^{q+1}\frac{x_j}{\delta _j+\mu _{q+1}}\le 1 $$

and \(m-r\) knapsack problems of the form

$$ \max \sum _{j=1}^q\frac{x_j}{\delta _j} \rightarrow \max \qquad \text {s.t. } \sum _{j=1}^q\frac{x_j}{\delta _j+\mu _q}\le 1. $$

The precision of the approximate solutions to these problems is \(\alpha _{1q}\) and \(\alpha _{1,q+1}\) respectively (see Sect. 3). For the product of these problems the optimal solution value is

$$ r\, \frac{\varepsilon _{q+1}}{\delta _{q+1}} + (m-r)\, \frac{\varepsilon _q}{\delta _q} = \frac{r}{\alpha _{1,q+1}} + \frac{m-r}{\alpha _{1q}} $$

and the approximate solution value is 1, hence the precision of the approximate solution is

Corollary 1

Proof

The first inequality obviously follows from (2). Let us prove the second one. If \(r=0\) then

If \(0<r<m\) then

From Corollary 1 we obtain the following.

Corollary 2

If \(n\rightarrow \infty \), \(m=o(n)\) then .

Corollary 3

If \(n\rightarrow \infty \) and m is fixed then .

6 Conclusion

In this paper we derived exact and asymptotic formulas for the precision of approximate solutions to the m-dimensional knapsack problem. In particular, we proved that the precision tends to \(0.59136\dots /m\) if \(n\rightarrow \infty \) and m is fixed. The proof of the attainability of the obtained bounds for the precision is constructive.

In the future, our results can be base for new fully polynomial time approximation schemes.