Problem is like below. There is a set of items $I = \{1,2,\cdots,n$}, where each item $i$ has a value $v_i \gt 0$ and a size $s_i \gt 0$. Now, knapsack problem is a “Find the maximum possible value with capacity $B$”.
There is a well-known dynamic programming algorithm to solve this.
In this case, $\operatorname{OPT}_{i,j}$ means an optimal value possible with $1,2,\cdots, i$ items and capacity below $j$.
There is an alternative algorithm to solve this.
$\operatorname{for} j \leftarrow 0, \cdots, V$
In this case, $\operatorname{OPT}_{i,j}$ means the smallest size possible with $1,2,\cdots, i$ items with value below $j$. Now, it is shown that we have two options. Algorithm bounded in O(nB) or O(nW).
However, $B$ and $W$ may arbitrary big and running time may become too long. Now, we will try to make a quantization for it.
Quantization
$\mu \leftarrow \epsilon \frac{M}{n}$
$\operatorname{for} i \leftarrow 1, \cdots, n$
$\operatorname{for} j \leftarrow 0, \cdots, V$
From the algorithm above, we can see that an approximation algorithm runs in polynomial time. Let’s define $v_i’$ $=$ [$\frac{v_i}{\mu}$]. Then for the new $V$ value, $V’$ $=$ $\sum\limits_{i = 1}^n v_i’$ $\le$ $\sum\limits_{i = 1}^n (\frac{v_i}{\mu})$ $=$ $\sum\limits_{i = 1}^n (\frac{v_i n}{M \epsilon})$ $\le$ $\sum\limits_{i = 1}^n (\frac{n}{\epsilon})$ $=$ $O(n^2/\epsilon)$.
Now, we need to show that it returns at least $(1 - \epsilon)$ of $\operatorname{OPT}$ for show it is a $\operatorname{FPAS}$. To prove this, we need some facts, 1, $M \le OPT$, 2. $\mu v_i’ \le v_i \le \mu(v_i’ + 1)$. Also, we can get $\mu v_i’ \ge v_i - \mu$, $\epsilon M = n \mu$.
Now, let $S$ as a set of items which an algorithm above gives and $O$ as a set of items in an optimal solution. Then, $\sum\limits_{i \in S} v_i$ $\ge$ $\sum\limits_{i \in S} \mu v_i’$ $\ge$ $\sum\limits_{i \in O} \mu v_i’$ $\ge$ $\sum\limits_{i \in O} (v_i - \mu)$ $=$ $\sum\limits_{i \in O}v_i - |O|\mu$ $\ge$ $\sum\limits_{i \in O}v_i - n\mu$ $=$ $\sum\limits_{i \in O}v_i - \epsilon M$ $=$ $\operatorname{OPT} - \epsilon M$ $\ge$ $\operatorname{OPT} - \epsilon \operatorname{OPT}$ $=$ $(1 - \epsilon)\operatorname{OPT}$.