Skip to main content
added 386 characters in body
Source Link
RobPratt
  • 5.4k
  • 1
  • 15
  • 25

This is a variant of the integer equality knapsack problem and can be solved via dynamic programming. The complexity is described here.

For a DP recursion, first define $$\Psi_k(x):=\min_{\begin{array}{c} \alpha_1x_1+\cdots+\alpha_k x_k=x \\ x_i\in \{0,1,\dots,m\}\\ \alpha_i \in \{0,1\} \end{array}}\sum_{i=1}^k f_i(x_i)$$ and then condition on $\alpha_k$ and $x_k$ to obtain $$\Psi_k(x) = \min_{\alpha_k, x_k}\{f_k(x_k)+\Psi_{k-1}(x-\alpha_k x_k)\}$$ You want to compute $\Psi_n(x)$.

This is the integer equality knapsack problem and can be solved via dynamic programming. The complexity is described here.

This is a variant of the integer equality knapsack problem and can be solved via dynamic programming. The complexity is described here.

For a DP recursion, first define $$\Psi_k(x):=\min_{\begin{array}{c} \alpha_1x_1+\cdots+\alpha_k x_k=x \\ x_i\in \{0,1,\dots,m\}\\ \alpha_i \in \{0,1\} \end{array}}\sum_{i=1}^k f_i(x_i)$$ and then condition on $\alpha_k$ and $x_k$ to obtain $$\Psi_k(x) = \min_{\alpha_k, x_k}\{f_k(x_k)+\Psi_{k-1}(x-\alpha_k x_k)\}$$ You want to compute $\Psi_n(x)$.

Source Link
RobPratt
  • 5.4k
  • 1
  • 15
  • 25

This is the integer equality knapsack problem and can be solved via dynamic programming. The complexity is described here.