Introduction - If you have any usage issues, please Google them yourself
Greedy knapsack, (1) the so-called greedy choice property means that the overall optimal solution of the problem can be achieved through a series of local optimal solutions, namely greedy selection. This is the first essential element of the greedy algorithm, and it is also the main difference between the greedy algorithm and the dynamic programming algorithm.
(2) when the optimal solution of a problem contains the optimal solution of its subproblem, it is called the optimal substructure property. The optimal substructure of the problem is the key feature of the problem which can be solved by the dynamic programming algorithm or the greedy algorithm.