Abstract
Computing high dimensional volumes is a hard problem, even for approximation. Several randomized approximation techniques for #P-hard problems have been developed in the three decades, while some deterministic approximation algorithms are recently developed only for a few #P-hard problems. Motivated by a new technique for a deterministic approximation, this paper is concerned with the volume computation of 0-1 knapsack polytopes, which is known to be #P-hard. This paper presents a new technique based on approximate convolutions for a deterministic approximation of volume computations, and provides a fully polynomial-time approximation scheme for the volume computation of 0-1 knapsack polytopes. We also give an extension of the result to multi-constrained knapsack polytopes with a constant number of constraints.
Similar content being viewed by others
1 Introduction
Computing a volume in the n-dimensional space is a hard problem, even for approximation. Lovász [17] showed that no polynomial-time deterministic algorithm can approximate with ratio \(1.999^n\) the volumes of convex bodies in the n dimensional space as given by membership oracles (see also [3, 9]).
Several randomized approximation techniques for #P-hard problems have been developed, such as the Markov chain Monte Carlo method. For the volume computation of a general convex body given by a membership oracle in the n dimensional space, Dyer et al. [8] gave the first fully polynomial-time randomized approximation scheme (FPRAS), giving a rapidly mixing Markov chain. In fact, the running time of the FPRAS is \(\mathrm {O}^*(n^{23})\) where \(\mathrm {O}^*\) ignores \(\mathrm {poly}(\log n)\) and \(1/\epsilon \) terms. After several improvements, Lovász and Vempala [18] improved the time complexity to \(\mathrm {O}^*(n^4)\), and recently Cousins and Vempala [5] gave an \(\mathrm {O}^*(n^3)\)-time algorithm.
In contrast, it is a major challenge to design deterministic approximation algorithms for #P-hard problems, and not many results seem to be known. A remarkable progress is the correlation decay argument due to Weitz [20]; he designed a fully polynomial time approximation scheme (FPTAS) for counting independent sets in graphs whose maximum degree is at least 5. A similar technique is independently presented by Bandyopadhyay and Gamarnik [2], and there are several recent developments on the technique, e.g., [4, 10, 13, 14, 16]. For counting 0-1 knapsack solutions, Gopalan et al. [11], and Stefankovic et al. [19] gave deterministic approximation algorithms based on the dynamic programming (see also [12]), in a similar way to a simple random sampling algorithm by Dyer [6]. Modifying the dynamic programming, Li and Shi [15] recently gave an FPTAS for computing a distribution function of sum of random variables, including the volume computation of 0-1 knapsack polytopes.
Motivated by a new technique of designing an FPTAS for #P-hard problems, this paper is concerned with the volume computation of 0-1 knapsack polytopes: Given a positive integer vector \({\mathbf {a}}^{\top }=(a_1,\ldots ,a_n)\in \mathbb {Z}_{> 0}^n\) and a positive integer \(b \in \mathbb {Z}_{>0}\), the 0-1 knapsack polytope is given by
Computing the volume of K is known to be #P-hard [7]. Remark that counting solutions corresponds to counting the integer points in K, and it is different from the volume computation, but closely related.
This paper presents a new technique for designing a deterministic approximation algorithm for volume computations, and provides an FPTAS for the volume computation of 0-1 knapsack polytopes, i.e., our main result is the following:
Theorem 1.1
For any \(\epsilon ~~(0<\epsilon \le 1)\), there exists an \(\mathrm {O}(n^3/\epsilon )\)-time deterministic algorithm to approximate \(\mathrm{Vol}(K)\) with approximation ratio \(1+\epsilon \).
The idea of our algorithm is based on the classical convolution, while there seems no known technique (explicitly) using approximate convolutions to design an FPTAS for #P-hard problems. Our algorithm consists of recursively approximating convolutions with \(\mathrm {O}(n^3 /\epsilon )\) iterations, meaning that the number of iterations is independent of the values of \(a_i\) and b. In comparison with Li and Shi [15], their algorithm is based on the dynamic programming by Stefankovic et al. [19], and their FPTAS requires \(\mathrm {O}\left( (n^3/\epsilon ^2)\log \left( 1/\mathrm{Vol}(K)\right) \log b\right) \) iterations, where notice that \(\mathrm{Vol}(K) \le 1\) holds by the definition of K. Thus, the number of iterations in their algorithm depends on the input values \(\log a_i\) and \(\log b\).
While a standard knapsack problem is characterized by a single nontrivial constraint, we also show in Sect. 4 that Theorem 1.1 is slightly extended to multi-constrained knapsack polytopes with a constant number of constraints, while a standard knapsack problem is characterized by a single nontrivial constraint. As far as we know, this is the first FPTAS for the problem. An extension of our technique to other polytopes is an interesting challenge.
This paper is organized as follows. In Sect. 2, we give a recursive convolution for the volume computation, to explain the idea of our algorithm. In Sect. 3, we explain our algorithm. In Sect. 4, we extend our technique to knapsack polytopes with a constant number of constraints. In Sect. 5, we give some supplemental proofs.
2 Preliminary: Convolution for \(\mathrm{Vol}(K)\)
This section presents a convolution for \(\mathrm{Vol}(K)\), to explain the basic idea of our approximation algorithm. As a preliminary step, we “normalize” the problem for the convenience of arguments in this paper. Let \(M \in \mathbb {Z}_{>0}\) be an arbitrary constant for scalingFootnote 1, and let
for \(j=1,2,\ldots ,n\). Let
then, notice that
holds.
It may be helpful to introduce a probability space in order to describe a convolution of \(\mathrm{Vol}(K)\). Let \({\mathbf {X}}=(X_1,\ldots ,X_n)\) be a uniform random variable over \([0,1]^n\), i.e., \(X_i\) (\(i=1,2,\ldots ,n\)) are (mutually) independent. Then, it is not difficult to see that \([\tilde{{\mathbf {a}}}^{\top } {\mathbf {X}} \le M]\) if and only if \([{\mathbf {X}} \in \tilde{K}]\), meaning that
holds. Let f be the uniform density function over [0, 1], i.e.,
Now, we define \(\varPhi _0(y) = 0\) for \(y \le 0\), while \(\varPhi _0(y) = 1\) for \(y > 0\). Inductively, we define for \(j=1,2,\ldots ,n\) that
for any \(y \in {\mathbb {R}}\), where the last equality follows the definition (4) of f.
Proposition 2.1
For each \(j \in \{1,2,\ldots ,n\}\) and for any \(y \in {\mathbb {R}}\),
holds.
Proof
Firstly, we prove the case of \(j=1\). Notice that \(\varPhi _0\) is an indicator function in fact, then
and we obtain the claim in the case.
Next, inductively assuming that \(\varPhi _{j-1}(y) = \Pr \left[ \tilde{a}_1X_1+\cdots +\tilde{a}_{j-1}X_{j-1} \le y\right] \) holds, we prove the case of j (\(j=1,2,\ldots ,n\)).
We obtain the claim. \(\square \)
Let \(\varPhi (M)\) denote \(\varPhi _n(M)\), for convenience. Then, Proposition 2.1, with the facts (3) and (4), suggests the following.
Corollary 2.2
\(\varPhi (M) = \mathrm{Vol}(K)\).
3 Approximation Algorithm for \(\mathrm{Vol}(K)\)
3.1 The Idea
To begin with, this subsection explains the idea of our algorithm, that is a recursive computation of approximate convolutions \(G_j(y)\), in an analogy with \(\varPhi _j(y)\). Let \(G_0(y)=\varPhi _0(y)\), i.e., \(G_0(y) = 0\) for \(y \le 0\) while \(G_0(y)=1\) for \(y > 0\). Inductively assuming \(G_{j-1}(y)\) (\(j=1,\ldots ,n\)), we define
for \(y\in {\mathbb {R}}\), for convenience. Then, let \(G_j(y)\) be a staircase approximation of \(\overline{G}_j(y)\), which is given by
for \(y \in {\mathbb {R}}\). We note the following fact, which may suggest a collateral evidence that \(\overline{G}_j\) approximates \(\varPhi _j\).
Proposition 3.1
Notice that Proposition 2.1, in the previous section, suggests the same equation for \(\varPhi _j(y)\). See Sect. 5 for the proof of Proposition 3.1.
Here we briefly comment on the computation of \(G_j\). Remark that it is sufficient to compute \(G_j(z)\) for \(z \in \mathbb {Z}\), because \(G_j(y) = G_j(\lceil y \rceil )\) holds by the definition (6) of \(G_j(y)\). Let
i.e.,
Let \(t_1,t_2,\ldots ,t_{|T|}\) denote the whole members in T such that \(t_k < t_{k+1}\) (\(k=1,\ldots ,|T|-1\)). For convenience, let \(t_0=z-\tilde{a}_j\) if \(z-\tilde{a}_j >0\), otherwise \(t_0 = 0\) \((=t_1)\). Let
for \(u,v \in {\mathbb {R}}\) such that \(u \le v\). Then,
Thus, we see that the value of \(G_j(z)\) is naively computed from the values \(G_{j-1}(z')\) (\(z' \in \{1,2,\ldots ,z\}\)) and \(\tilde{a}_j\) in \(\mathrm {O}(z)\) time. We will later discuss a fast computation of \(G_j(z)\) based on a dynamic programming (see Lemma 3.3, and also Sect. 3.4 for detail).
3.2 Algorithm
Based on the arguments in Sect. 3.1, our algorithm is described as follows.
Algorithm 1
InputFootnote 2: \(\tilde{{\mathbf {a}}}=(\tilde{a}_1,\ldots ,\tilde{a}_n) \in {\mathbb {Q}}_{>0}^n\).
1. Let \(G_0(y):=0\) for \(y \le 0\), and let \(G_0(y):=1\) for \(y > 0\);
2. For \(j=1,\ldots ,n\)
3. For \(z=1,\ldots ,M\)
4. Compute \(G_j(z)\);
5. Output \(G_n(M)\).
For convenience, let G(M) denote \(G_n(M)\), in the following. The following proposition about the time complexity of Algorithm 1 is easy from the arguments in Sect. 3.1.
Proposition 3.2
The running time of Algorithm 1 is \(\mathrm {O}(n M^2)\).
Proof
As stated in Sect. 3.1, \(G_j(z)\) is computed at line 4 in \(\mathrm {O}(M)\) time. Now, the claim is easy. \(\square \)
In fact, the time complexity of lines 3 and 4 in Algorithm 1, that is \(\mathrm {O}(M^2)\), is improved to \(\mathrm {O}(M)\) by a dynamic programming. We will establish the following lemma later in Sect. 3.4.
Lemma 3.3
The running time of Algorithm 1 is \(\mathrm {O}(nM)\).
The approximation ratio of Algorithm 1 is given by the following lemma, which we will prove in the next subsection.
Lemma 3.4
For any \(\epsilon \) \((0 < \epsilon \le 1)\), set an integer \(M\ge 2 n^{2}\epsilon ^{-1}\), then we have
Theorem 1.1 is immediate from Lemmas 3.3 and 3.4.
3.3 Proof of Lemma 3.4, for Approximation Ratio
We prove Lemma 3.4. As a preliminary, we observe the following facts from the definitions of \(\overline{G}_j(y)\) and \(G_j(y)\).
Observation 3.5
For any \(j \in \{1,2,\ldots ,n\}\), \(\varPhi _j(y)\), \(\overline{G}_j(y)\) and \(G_j(y)\) are monotone nondecreasing (with respect to y), respectively.
Observation 3.6
For each \(j \in \{1,2,\ldots ,n\}\), \(\overline{G}_j(y) \le G_j(y) \le \overline{G}_j(y+1)\) holds for any \(y\in {\mathbb {R}}\).
Proposition 3.7
For each \(j \in \{1,2,\ldots ,n\}\), \(\varPhi _j(y) \le \overline{G}_j(y)\) for any \(y\in {\mathbb {R}}\).
Proof
By the definition, \(\varPhi _0(y) = \overline{G}_0(y)\) for any \(y\in {\mathbb {R}}\). Inductively assuming that \(\varPhi _{j-1}(y) \le \overline{G}_{j-1}(y)\) holds for any \(y\in {\mathbb {R}}\), we have that
for any \(y\in {\mathbb {R}}\). \(\square \)
Now, we establish the following Lemma 3.8, which claims a “horizontal” approximation ratio, in spite of Lemma 3.4 claiming a “vertical” bound.
Lemma 3.8
For each \(j \in \{1,\ldots ,n\}\),
holds for any \(y\in {\mathbb {R}}\).
Proof
The former inequality is immediate from Proposition 3.7 and Observation 3.6. Now, we are concerned with the latter inequality. Observation 3.6 implies that
and we obtain the claim for \(j=1\). Inductively assuming that \(G_{j-1}(y) \le \varPhi _{j-1}(y+j-1)\) holds for any \(y \in {\mathbb {R}}\), we show that \(G_j(y) \le \varPhi _j(y+j)\). Notice that
holds for any \(y \in {\mathbb {R}}\). Using Observation 3.6, (11) implies that
and we obtain the claim. \(\square \)
To transform the horizontal bound to a vertical one, we prepare the following.
Lemma 3.9
Proof
For convenience, let \(\tilde{K}(y) \mathop {=}\limits ^{\mathrm{def}}\{ {\mathbf {x}} \in [0,1]^n \mid \tilde{{\mathbf {a}}}^{\top }{\mathbf {x}} \le y\}\) for \(y \ge 0\), i.e., \(\varPhi (M)=\mathrm{Vol}(\tilde{K}(M))\) and \(\varPhi (M+n)=\mathrm{Vol}(\tilde{K}(M+n))\). Let \(H_M\) be a hyperplane defined by \(H_M \mathop {=}\limits ^{\mathrm{def}}\{ {\mathbf {x}} \in {\mathbb {R}}^n \mid \tilde{{\mathbf {a}}}^{\top }{\mathbf {x}}=M \}\), and let \(F_M = \tilde{K}(M) \cap H_M\) i.e., \(F_M= \{{\mathbf {x}} \in \tilde{K}(M) \mid \tilde{{\mathbf {a}}}^{\top }{\mathbf {x}}=M\}\). Let C(y) for \(y \ge M\) be (a truncation of) a cone defined by
Notice that \(C(y) \cap H_M = F_M\) for any \(y \ge M\). Figure 1 illustrates \(\tilde{K}(M)\), \(\tilde{K}(M+n)\), \(H_M\), \(F_M\), C(M), and \(C(M+n)\). It is not difficult from the definitions to see that \(C(M) \subseteq \tilde{K}(M)\) holds, since \(\tilde{K}(M)\) is convex and it contains \(F_M\) and the origin \(\mathbf{0}\).
Next, we claim that \(C(M+n) \setminus C(M) \supseteq \tilde{K}(M+n) \setminus \tilde{K}(M)\) holds. Let \({\mathbf {u}} \in \tilde{K}(M+n) \setminus \tilde{K}(M)\). For convenience, let \(z=\tilde{{\mathbf {a}}}^{\top }{\mathbf {u}}\), then \( M < z \le M+n\) holds. Let \({\mathbf {u}}' \mathop {=}\limits ^{\mathrm{def}}(M/z) {\mathbf {u}}\) then \({\mathbf {u}}'\in F_M\) since \(\tilde{{\mathbf {a}}}^{\top }{\mathbf {u}}'= (M/z) \tilde{{\mathbf {a}}}^{\top }{\mathbf {u}}=M\). This implies that \({\mathbf {u}} = (z/M) {\mathbf {u}}' \in C(M+n)\).
Now, we obtain that
where we remark that \(C(M+n) \setminus \tilde{K}(M)=C(M+n) \setminus C(M)\) for the last inequality. Then,
where the last equality follows C(M) is similar to \(C(M+n)\) in the n dimensional space. \(\square \)
Now, Lemma 3.4 is easy from Lemmas 3.8 and 3.9.
Proof
(of Lemma 3.4 ) The first inequality \(\varPhi (M) \le G(M)\) is immediate from Lemma 3.8. Lemma 3.9 suggests that
holds. Thus,
for \(\epsilon \le 1\), and we obtain the claim. \(\square \)
3.4 Proof of Lemma 3.3, for the Time Complexity
For a proof of Lemma 3.3, this subsection explains a dynamic programming to compute \(G_j(z)\) for \(z=0,1,\ldots ,M\) from \(G_{j-1}(z')\) (\(z'=0,1,\ldots ,M\)).
Recall (8) [see also (7)], which is rewritten as
as well as recall (10), that is rewritten as
where we remark for the last equality that \(|T| = \lfloor \tilde{a}_j \rfloor \) holds in the case of \(z-\tilde{a}_j > 0\), and that \(|T| = z\) in the other case.
Thus, it is not difficult to see that
holds when \(z \le \lfloor \tilde{a} \rfloor \). Similarly, in case that \(z = \lfloor \tilde{a} \rfloor + 1\), we see that
holds, as well as in the other case, that is \(z > \lfloor \tilde{a}_j \rfloor +1\), we obtain that
Equations (12), (13) and (14) suggest that \(G_j(z)\) is computed from \(G_j(z-1)\) in \(\mathrm {O}(1)\) time. It implies that the time complexity of computing \(G_j(z)\) for \(z=0,1,\ldots ,M\) is \(\mathrm {O}(M)\), in total. Now, Lemma 3.3 is easy. The whole procedure of computing \(G_j(z)\) for \(z=0,1,\ldots ,M\) from \(G_{j-1}(z')\) (\(z'=0,1,\ldots ,M\)) is described as follows.
Procedure 2
(Compute \(G_j\) from \(G_{j-1}\), for lines 3–4 in Algorithm 1)
1. Read \(G_{j-1}(z)\) for \(z \in \{0,1,\ldots ,M\}\).
2. Set \(G_j(0) :=0\);
3. For(\(z=1,2,\ldots ,M\))
4. If \(z \le \lfloor \tilde{a}_j \rfloor \), then Compute \(G_j(z)\) from \(G_j(z-1)\) by (12);
5. ElseIf \(z = \lfloor \tilde{a}_j \rfloor +1\), then Compute \(G_j(z)\) from \(G_j(z-1)\) by (13);
6. Else (i.e., \(z > \lfloor \tilde{a}_j \rfloor +1\)), Compute \(G_j(z)\) from \(G_j(z-1)\) by (14);
4 Knapsack Polytope with a Constant Number of Constraints
Toward an extension of the technique to general polytopes, this section shows that the technique described in Sects. 2 and 3 is extended to multi-constrained knapsack polytopes with a constant number of constraints.
4.1 Problem Description and Preliminary
Suppose that m nonnegative integer vectors \({\mathbf {a}}_{i}^\top =(a_{i1},\ldots ,a_{in}) \in \mathbb {Z}_{\ge 0}^n\) for \(i=1,\ldots ,m\), and another positive integer vector \({\mathbf {b}}=(b_1,\ldots ,b_m)^{\top } \in \mathbb {Z}_{>0}^m\) are given. For convenience, let \(A \in \mathbb {Z}_{\ge 0}^{m \times n}\) be a matrix defined by
where \(A_j\) (\(j=1,\ldots ,n\)) denotes the column vectors of A, i.e., \(A_j {=} (a_{1,j}, \ldots ,a_{m,j})^{\top }\). Then, the knapsack polytope with m constraints \(K_m\) is given by
Clearly, computing \(\mathrm{Vol}(K_m)\) is \(\#P\)-hard. This section establishes the following theorem, extending the technique described in Sects. 2 and 3.
Theorem 4.1
For any \(\epsilon ~~ (0<\epsilon \le 1)\), there exists an \(\mathrm {O}((n^2 \epsilon ^{-1})^{m+1}nm\log m)\) time deterministic algorithm to approximate \(\mathrm{Vol}(K_m)\) with approximation ratio \(1+\epsilon \).
Notice that Theorem 4.1 claims \(\mathrm {O}(n^{2m+3}/\epsilon ^{m+1})\) time for any constant m.
As a preliminary step, we “normalize” the problem in a similar manner to Sect. 2. Let \(\tilde{A} = (\tilde{a}_{ij})\) be defined by
for \(i =1,\ldots ,m\) and \(j = 1,\ldots ,n\), and also let \(\tilde{{\mathbf {a}}}_i^{\top }\) (\(i =1,\ldots ,m\)) and \(\tilde{A}_j\) (\(j = 1,2,\ldots ,n\)) respectively denote the row and column vectors of \(\tilde{A}\) (cf. (15)). Let
where \(\mathbf{1}\) is an m-dimensional vector defined by \(\mathbf{1}\mathop {=}\limits ^{\mathrm{def}}(1,\ldots ,1)^{\top }\). It is not difficult to see that
holds.
4.2 Convolution for \(\mathrm{Vol}(K_m)\)
Now we explain a convolution for \(\mathrm{Vol}(K_m)\), in a similar manner to Sect. 2. Let \({\mathbf {X}}=(X_1,\ldots ,X_n)\) be a uniform random variable over \([0,1]^n\). Then, it is not difficult to see that \([\tilde{A} {\mathbf {X}} \le M \mathbf{1}]\) if and only if \([{\mathbf {X}} \in \tilde{K}_m]\), which implies that
holds.
We define \(\varPhi _0 :{\mathbb {R}}^m \rightarrow {\mathbb {R}}\) by
for \({\mathbf {y}} = (y_1,\ldots ,y_m)^{\top }\). For \(j=1,2,\ldots ,n\), we inductively define \(\varPhi _j :{\mathbb {R}}^m \rightarrow {\mathbb {R}}\) by
for \({\mathbf {y}}=(y_1,\ldots ,y_m)^{\top }\), where f is the uniform density function over [0, 1] (cf. (4)).
For convenience, let \({\mathbf {X}}_{[j]}=(X_1,\ldots ,X_j)^{\top }\) for \(j \in \{1,\ldots ,n\}\), as well as let \(\tilde{A}_{[j]}\) denote an \(m \times j\) submatrix of \(\tilde{A}\) defined by
for \(j \in \{1,\ldots ,n\}\).
Proposition 4.2
For each \(j \in \{1,2,\ldots ,n\}\),
holds for any \(y \in {\mathbb {R}}^m\).
Proof
To begin with, consider the case of \(j=1\). Notice that \(\varPhi _0\) is an indicator function in fact, then
where we remark that \({\mathbf {X}}_{[1]} = (X_1)\). We obtain the claim in the case.
Inductively assuming that \(\varPhi _{j-1}({\mathbf {y}})=\Pr \left[ \tilde{A}_{[j-1]} {\mathbf {X}}_{[j-1]} \le {\mathbf {y}} \right] \) holds, the case of j (\(j=1,2,\ldots ,n\)) is given by
We obtain the claim. \(\square \)
Let \(\varPhi (M\mathbf{1})\) denote \(\varPhi _n(M\mathbf{1})\), for convenience. Then, Proposition 4.2, with (17) and (18), suggests the following.
Corollary 4.3
\(\varPhi (M\mathbf{1}) = \mathrm{Vol}(K_m)\).
4.3 Approximation of \(\varPhi \)
Next, we explain an approximation of \(\varPhi _j({\mathbf {y}})\) by \(G_j({\mathbf {y}})\), in a similar manner to Sect. 3.1. We define \(G_0 :{\mathbb {R}}^m \rightarrow {\mathbb {R}}_{\ge 0}\) by
Inductively assuming \(G_{j-1}({\mathbf {y}})\), we define \(\overline{G}_j :{\mathbb {R}}^m \rightarrow {\mathbb {R}}_{\ge 0}\) for each \(j=1,\ldots ,n\)
for \({\mathbf {y}}=(y_1,\ldots ,y_m)^{\top }\). Then, we define a staircase function \(G_j:{\mathbb {R}}^m \rightarrow {\mathbb {R}}_{\ge 0}\) by
for \({\mathbf {y}} \in {\mathbb {R}}^m\), where \(\lceil {\mathbf {y}} \rceil =(\lceil y_1 \rceil ,\ldots ,\lceil y_m \rceil )^{\top }\). We remark the following fact.
Proposition 4.4
Here we explain the computation of \(G_j\). Remark that it is sufficient to compute \(G_j({\mathbf {z}})\) for \({\mathbf {z}} \in \mathbb {Z}^m\), because \(G_j({\mathbf {y}}) = G_j(\lceil {\mathbf {y}} \rceil )\) holds for any \({\mathbf {y}}\in {\mathbb {R}}^m\) by the definition (19) of \(G_j({\mathbf {y}})\). Let
Let \({\mathbf {t}}^{(1)},{\mathbf {t}}^{(2)},\ldots ,{\mathbf {t}}^{(|T|)}\) denote the whole members in T such that \({\mathbf {t}}^{(k)} < {\mathbf {t}}^{(k+1)}\) (\(k=1,2,\ldots ,|T|-1\)), i.e., \({\mathbf {t}}^{(k+1)}-{\mathbf {t}}^{(k)} = s \tilde{A}_j\) with an appropriate \(s > 0\) for any \(k=1,2,\ldots ,|T|-1\). For convenience, let \({\mathbf {t}}^{(0)}={\mathbf {z}}-\tilde{A}_j\) if \({\mathbf {z}}-\tilde{A}_j \in {\mathbb {R}}_{>0}\), otherwise \({\mathbf {t}}^{(0)} = {\mathbf {t}}^{(1)}\). We observe that
holds, because each element \(t^{(k)}_i\) (\(i \in \{1,\ldots ,m\}\)) of \({\mathbf {t}}^{(k)}\) is monotone nondecreasing with respect to k (\(k=1,2,\ldots ,|T|\)) for each \(i \in \{1,\ldots ,m\}\), and \(\exists i \in \{1,\ldots ,m\}\), \(\lfloor t^{(k+1)}_i \rfloor \ne \lfloor t^{(k)}_i \rfloor \) holds for any \(k=1,2,\ldots ,|T|-1\). Remark that \(\mathbf{1}\) in (20) corresponds to members \({\mathbf {t}} \in T\) satisfying that \(t_i = 0\) for some \(i \in \{1,\ldots ,m\}\). Let
for \({\mathbf {u}},{\mathbf {v}} \in {\mathbb {R}}^m\) such that \({\mathbf {v}} = {\mathbf {u}} + s \tilde{A}_j\) for \(s \in [0,1]\). Then,
holds, where the last equality follows the definition (19) of \(G_{j-1}\).
Thus, we see that the value of \(G_j({\mathbf {z}})\) is computed from the values \(G_{j-1}({\mathbf {z'}})\) (\(z' \in \{1,2,\ldots ,z\}^m\)) and \(\tilde{a}_{1,j}\), only. Observation (20) suggests that \(|T|=\mathrm {O}(mM)\) when \({\mathbf {z}} \in \{0,1,2,\ldots ,M\}^m\). Thus, the sequence \({\mathbf {t}}^{(1)},{\mathbf {t}}^{(2)},\ldots ,{\mathbf {t}}^{(|T|)}\) is found in \(\mathrm {O}(M m \log m)\) time when \({\mathbf {z}} \in \{0,1,2,\ldots ,M\}^m\), e.g., using a merge sort in a wise way. Once we obtain the sequence, \(G_j({\mathbf {z}})\) is computed in \(\mathrm {O}(mM)\) time.
4.4 Algorithm and Analysis
Based on the arguments in Sect. 4.3, our algorithm is described as follows.
Algorithm 3
Input: \(\tilde{{\mathbf {a}}}_1,\ldots ,\tilde{{\mathbf {a}}}_m \in {\mathbb {Q}}_{\ge 0}^n\).
1. Let \(G_0({\mathbf {y}}):=1\) for \({\mathbf {y}}\ge 0\), otherwise \(G_0({\mathbf {y}}):=0\);
2. For \(j=1,\ldots ,n\)
3. For each \({\mathbf {z}}\in \{0,1,\ldots ,M\}^m\)
4. Compute \(G_j({\mathbf {z}})\);
5. Output \(G_n(M\mathbf{1})\).
For convenience, let \(G(M \mathbf{1})\) denote \(G_n(M \mathbf{1})\), in the following. Firstly, we discuss the time complexity of Algorithm 3.
Lemma 4.5
The running time of Algorithm 3 is \(\mathrm {O}(n M^{m+1} m \log m)\).
Proof
As stated in Sect. 4.3, \(G_j({\mathbf {z}})\) is computed at line 4 in \(\mathrm {O}(M m \log m)\) time. Now, the claim is easy. \(\square \)
The time complexity is possible to be improved in a similar manner to Lemma 3.3 (see also Sect. 3.4), but this paper omits the arguments.
Next, we establish the following approximation ratio of Algorithm 3.
Lemma 4.6
For any \(\epsilon \) \((0<\epsilon \le 1)\), set \(M\ge 2 n^2 \epsilon ^{-1}\), then we have
Theorem 4.1 is immediate from Lemmas 4.5 and 4.6. As a preliminary, we observe the following facts from the definitions of \(\overline{G}_j({\mathbf {y}})\) and \(G_j({\mathbf {y}})\).
Observation 4.7
For any \(j \in \{1,2,\ldots ,n\}\), \(\varPhi _j({\mathbf {y}})\), \(\overline{G}_j({\mathbf {y}})\) and \(G_j({\mathbf {y}})\) are monotone nondecreasing (with respect to \({\mathbf {y}}\)), respectively.
Observation 4.8
For each \(j \in \{1,2,\ldots ,n\}\), \(\overline{G}_j({\mathbf {y}}) \le G_j({\mathbf {y}}) \le \overline{G}_j({\mathbf {y}}+\mathbf{1})\) holds for any \({\mathbf {y}}\in {\mathbb {R}}^m\).
Proposition 4.9
For each \(j \in \{1,2,\ldots ,n\}\), \(\varPhi _j({\mathbf {y}}) \le \overline{G}_j({\mathbf {y}})\) holds for any \({\mathbf {y}}\in {\mathbb {R}}^m\).
Proof
By the definition, \(\varPhi _0({\mathbf {y}}) = \overline{G}_0({\mathbf {y}})\) for any \({\mathbf {y}} \in {\mathbb {R}}^m\). Inductively assuming that \(\varPhi _{j-1}({\mathbf {y}}) \le \overline{G}_{j-1}({\mathbf {y}})\) holds for any \({\mathbf {y}}\in {\mathbb {R}}^m\), we have that
for any \({\mathbf {y}}\in {\mathbb {R}}^m\). \(\square \)
Now, we establish the following Lemma 4.10, similar to Lemma 3.8.
Lemma 4.10
For each \(j \in \{1,\ldots ,n\}\),
holds for any \({\mathbf {y}} \in {\mathbb {R}}^m\).
Proof
The former inequality is immediate from Proposition 4.9 and Observation 4.8. Now, we are concerned with the latter inequality. Observation 4.8 implies that
and obtain the claim for \(j=1\). Inductively assuming that \(G_{j-1}({\mathbf {y}}) \le \varPhi _{j-1}({\mathbf {y}}+(j-1)\mathbf{1})\) for any \({\mathbf {y}} \in {\mathbb {R}}^m\), we show that \(G_j({\mathbf {y}}) \le \varPhi _j({\mathbf {y}}+j\mathbf{1})\). Notice that
holds for any \({\mathbf {y}} \in {\mathbb {R}}^m\). Using Observation 4.8, (22) implies that
and we obtain the claim. \(\square \)
Corollary 4.11
To transform the horizontal bound to a vertical one, we prepare the following.
Lemma 4.12
Proof
For convenience, let \(\tilde{K}(c) \mathop {=}\limits ^{\mathrm{def}}\{ {\mathbf {x}} \in [0,1]^n \mid \tilde{A}{\mathbf {x}} \le c\mathbf{1}\}\) for \(c \ge 0\), i.e., \(\varPhi (M\mathbf{1})=\mathrm{Vol}(\tilde{K}(M))\) and \(\varPhi (M\mathbf{1}+n{\mathbf {1}})=\mathrm{Vol}(\tilde{K}(M+n))\). Let
Since \(\tilde{K}(M)\) is convex containing the origin \(\mathbf{0}\), it is not difficult to see that D is similar to \(\tilde{K}(M)\) in the n dimensional space, which implies that
holds. It may be helpful to consider a decomposition of \(\tilde{K}(M)\) into (truncated) cones for a confirmation of the above arguments.
Now, it is sufficient to prove that \(\tilde{K}(M+n) \subseteq D\). Let \({\mathbf {u}} \in \tilde{K}(M+n)\), which implies that \(\tilde{A}{\mathbf {u}} \le (M+n) \mathbf{1}\). Let \({\mathbf {u}}' = \tfrac{M}{M+n}{\mathbf {u}}\), then
holds. This implies that \({\mathbf {u}} \in D\). \(\square \)
Lemma 4.6 is now easy from Corollary 4.11 and Lemma 4.12, in a similar way to the proof of Lemma 3.4.
5 Supplemental Proof
Proposition 5.1
(Proposition 3.1)
Proof
The proof is an induction on j. Recall that \(G_0(y)=0\) for \(y \le 0\) and \(G_0(y)=1\) for \(y > 1\). Inductively assuming the claim holds for \(\overline{G}_{j-1}\), we prove the claim for \(\overline{G}_j\).
In case that \(y \le 0\), then \(y-\tilde{a}_j s \le 0\) holds for \(s \ge 0\) since \(\tilde{a}_j \ge 0\). Recall the definition (6), then \(G_{j-1} (y-\tilde{a}_j s) = \overline{G}_{j-1} (\lceil y-\tilde{a}_j s\rceil ) = 0\) where the last equality follows the induction hypothesis. Thus,
holds. We obtain the claim in the case.
In case that \(y \ge \sum _{j'=1}^j \tilde{a}_{j'}\), then \(y-\tilde{a}_j s \ge \sum _{j'=1}^{j-1} \tilde{a}_{j'}\) holds for \(s \le 1\). Recall the definition (6), then \(G_{j-1} (y-\tilde{a}_j s) = \overline{G}_{j-1} (\lceil y-\tilde{a}_j s\rceil ) = 1\) where the last equality follows the induction hypothesis. Thus,
holds. We obtain the claim. \(\square \)
Notes
In fact, M is a scaling parameter of our approximation algorithm described in Sect. 3 in detail, that is \(M = 2 \lceil n^2\epsilon ^{-1} \rceil \) for an approximate ratio \(\epsilon \) (\(0 < \epsilon \le 1\)). Arguments in this section also hold even in case that M is real. It might be convenient for this section to assume \(M=1\).
References
Ando, E., Kijima, S.: An FPTAS for the volume computation of 0-1 knapsack polytopes based on approximate convolution integral. Lect. Notes Comput. Sci. 8889, 376–386 (2014)
Bandyopadhyay, A., Gamarnik, D.: Counting without sampling: asymptotics of the log-partition function for certain statistical physics models. Random Struct. Algorithms 33, 452–479 (2008)
Bárány, I., Füredi, Z.: Computing the volume is difficult. Discrete Comput. Geom. 2, 319–326 (1987)
Bayati, M., Gamarnik, D., Katz, D., Nair, C., Tetali, P.: Simple deterministic approximation algorithms for counting matchings. In: Proceedings of STOC, pp. 122–127 (2007)
Cousins, B., Vempala, S., Bypassing, K.L.S.: Gaussian Cooling and an \(O^\ast (n^3)\) Volume Algorithm. In: Proceedings of STOC, pp. 539–548 (2015)
Dyer, M.: Approximate counting by dynamic programming. In: Proceedings of STOC, pp. 693–699 (2003)
Dyer, M., Frieze, A.: On the complexity of computing the volume of a polyhedron. SIAM J. Comput. 17(5), 967–974 (1988)
Dyer, M., Frieze, A., Kannan, R.: A random polynomial-time algorithm for approximating the volume of convex bodies. J. Assoc. Comput. Mach. 38(1), 1–17 (1991)
Elekes, G.: A geometric inequality and the complexity of computing volume. Discrete Comput. Geom. 1, 289–292 (1986)
Gamarnik, D., Katz, D.: Correlation decay and deterministic FPTAS for counting colorings of a graph. J. Discrete Algorithms 12, 29–47 (2012)
Gopalan, P., Klivans, A., Meka, R.: Polynomial-time approximation schemes for knapsack and related counting problems using branching programs. arXiv:1008.3187v1 (2010)
Gopalan, P., Klivans, A., Meka, R., Štefankovič, D., Vempala, S., Vigoda, E.: An FPTAS for #knapsack and related counting problems. In: Proceedings of FOCS, pp. 817–826 (2011)
Li, L., Lu, P., Yin, Y.: Approximate counting via correlation decay in spin systems. In: Proceedings of SODA, pp. 922–940 (2012)
Li, L., Lu, P., Yin, Y.: Correlation decay up to uniqueness in spin systems. In: Proceedings of SODA, pp. 67–84 (2013)
Li, J., Shi, T.: A fully polynomial-time approximation scheme for approximating a sum of random variables. Oper. Res. Lett. 42, 197–202 (2014)
Lin, C., Liu, J., Lu, P.: A simple FPTAS for counting edge covers. In: Proceedings of SODA, pp. 341–348 (2014)
Lovász, L.: An algorithmic theory of numbers, graphs and convexity. SIAM Society for Industrial and Applied Mathematics, Philadelphia (1986)
Lovász, L., Vempala, S.: Simulated annealing in convex bodies and an \(O^\ast (n^4)\) volume algorithm. J. Comput. Syst. Sci. 72, 392–417 (2006)
Štefankovič, D., Vempala, S., Vigoda, E.: A deterministic polynomial-time approximation scheme for counting knapsack solutions. SIAM J. Comput. 41(2), 356–366 (2012)
Weitz, D.: Counting independent sets up to the tree threshold. In: Proceedings of STOC, pp. 140–149 (2006)
Acknowledgments
The authors would like to thank the anonymous reviewers for their valuable comments. This work is partly supported by Grant-in-Aid for Scientific Research on Innovative Areas MEXT Japan “Exploring the Limits of Computation (ELC)” (Nos. 24106008, 24106005).
Author information
Authors and Affiliations
Corresponding author
Additional information
A preliminary version appeared in [1].
Rights and permissions
About this article
Cite this article
Ando, E., Kijima, S. An FPTAS for the Volume Computation of 0-1 Knapsack Polytopes Based on Approximate Convolution. Algorithmica 76, 1245–1263 (2016). https://doi.org/10.1007/s00453-015-0096-5
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00453-015-0096-5