For each item and value , you have two choices:
Skip item :
Take item : (if ) Take the minimum: After filling the table, scan from down to . The first where is your answer. This formula captures the relationship between smaller problems.
Minimum weight
For each item and value , you have two choices:
Skip item :
Take item : (if ) Take the minimum: After filling the table, scan from down to . The first where is your answer. This formula captures the relationship between smaller problems.