A computer company wants to transfer K electronic components with bk and wk(weight and value respectively) from area A to area B. In particular, the total weight of the load should not exceed B. The goal is for the company to find the optimal distribution of load that maximizes its total value. We solve this problem using Dynamic Programming.
Determination of optimal control problem with load value criterion
Statutory Equation: π(π + π) = π(π) + π(π) β ππ, π(π) = π
Restrictions: π(π) β {π,π,π,β¦}, π β€ π(π) β€ π©
Cargo Value Criterion: π± = β π(π) β ππ
Input parameters
1. The number of products K
2. The total weight of cargo B
3. The weight wk and the value bk of each component
gcc -Wall -o main.c
./main.o